mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-28 22:52:27 +02:00
* src/mod_last_odbc.erl: Adapted to mod_privacy changes.
* src/mod_privacy_odbc.erl: Refactoring to extract records in include file. SVN Revision: 827
This commit is contained in:
parent
df57442d75
commit
9081f1f2b6
|
@ -1,7 +1,12 @@
|
||||||
2007-07-26 Mickael Remond <mickael.remond@process-one.net>
|
2007-07-26 Mickael Remond <mickael.remond@process-one.net>
|
||||||
|
|
||||||
|
* src/mod_last_odbc.erl: Adapted to mod_privacy changes.
|
||||||
|
* src/mod_privacy_odbc.erl: Refactoring to extract records in
|
||||||
|
include file.
|
||||||
|
|
||||||
* src/mod_last.erl: Adapted to mod_privacy changes.
|
* src/mod_last.erl: Adapted to mod_privacy changes.
|
||||||
* src/mod_privacy.erl: Refactoring to extract records in include file.
|
* src/mod_privacy.erl: Refactoring to extract records in include
|
||||||
|
file.
|
||||||
* src/mod_privacy.hrl: Likewise.
|
* src/mod_privacy.hrl: Likewise.
|
||||||
|
|
||||||
* src/mod_roster_odbc.erl: Fixed wrong call.
|
* src/mod_roster_odbc.erl: Fixed wrong call.
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
-include("ejabberd.hrl").
|
-include("ejabberd.hrl").
|
||||||
-include("jlib.hrl").
|
-include("jlib.hrl").
|
||||||
|
-include("mod_privacy.hrl").
|
||||||
|
|
||||||
start(Host, Opts) ->
|
start(Host, Opts) ->
|
||||||
IQDisc = gen_mod:get_opt(iqdisc, Opts, one_queue),
|
IQDisc = gen_mod:get_opt(iqdisc, Opts, one_queue),
|
||||||
|
@ -69,23 +69,22 @@ process_sm_iq(From, To, #iq{type = Type, sub_el = SubEl} = IQ) ->
|
||||||
{none, []}, [User, Server, From]),
|
{none, []}, [User, Server, From]),
|
||||||
if
|
if
|
||||||
(Subscription == both) or (Subscription == from) ->
|
(Subscription == both) or (Subscription == from) ->
|
||||||
case catch mod_privacy:get_user_list(User, Server) of
|
UserListRecord = ejabberd_hooks:run_fold(
|
||||||
{'EXIT', _Reason} ->
|
privacy_get_user_list, Server,
|
||||||
|
#userlist{},
|
||||||
|
[User, Server]),
|
||||||
|
case ejabberd_hooks:run_fold(
|
||||||
|
privacy_check_packet, Server,
|
||||||
|
allow,
|
||||||
|
[User, Server, UserListRecord,
|
||||||
|
{From, To,
|
||||||
|
{xmlelement, "presence", [], []}},
|
||||||
|
out]) of
|
||||||
|
allow ->
|
||||||
get_last(IQ, SubEl, User, Server);
|
get_last(IQ, SubEl, User, Server);
|
||||||
List ->
|
deny ->
|
||||||
case catch mod_privacy:check_packet(
|
IQ#iq{type = error,
|
||||||
User, Server, List,
|
sub_el = [SubEl, ?ERR_NOT_ALLOWED]}
|
||||||
{From, To,
|
|
||||||
{xmlelement, "presence", [], []}},
|
|
||||||
out) of
|
|
||||||
{'EXIT', _Reason} ->
|
|
||||||
get_last(IQ, SubEl, User, Server);
|
|
||||||
allow ->
|
|
||||||
get_last(IQ, SubEl, User, Server);
|
|
||||||
deny ->
|
|
||||||
IQ#iq{type = error,
|
|
||||||
sub_el = [SubEl, ?ERR_NOT_ALLOWED]}
|
|
||||||
end
|
|
||||||
end;
|
end;
|
||||||
true ->
|
true ->
|
||||||
IQ#iq{type = error,
|
IQ#iq{type = error,
|
||||||
|
|
|
@ -22,24 +22,7 @@
|
||||||
|
|
||||||
-include("ejabberd.hrl").
|
-include("ejabberd.hrl").
|
||||||
-include("jlib.hrl").
|
-include("jlib.hrl").
|
||||||
|
-include("mod_privacy.hrl").
|
||||||
-record(privacy, {us,
|
|
||||||
default = none,
|
|
||||||
lists = []}).
|
|
||||||
|
|
||||||
-record(listitem, {type = none,
|
|
||||||
value = none,
|
|
||||||
action,
|
|
||||||
order,
|
|
||||||
match_all = false,
|
|
||||||
match_iq = false,
|
|
||||||
match_message = false,
|
|
||||||
match_presence_in = false,
|
|
||||||
match_presence_out = false
|
|
||||||
}).
|
|
||||||
|
|
||||||
-record(userlist, {name = none, list = []}).
|
|
||||||
|
|
||||||
|
|
||||||
start(Host, Opts) ->
|
start(Host, Opts) ->
|
||||||
IQDisc = gen_mod:get_opt(iqdisc, Opts, one_queue),
|
IQDisc = gen_mod:get_opt(iqdisc, Opts, one_queue),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user