mirror of
https://github.com/processone/ejabberd.git
synced 2024-09-27 14:30:55 +02:00
* src/mod_last.erl: Adapted to mod_privacy changes.
SVN Revision: 826
This commit is contained in:
parent
ad16c0f4a4
commit
df57442d75
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
-include("ejabberd.hrl").
|
-include("ejabberd.hrl").
|
||||||
-include("jlib.hrl").
|
-include("jlib.hrl").
|
||||||
|
-include("mod_privacy.hrl").
|
||||||
|
|
||||||
-record(last_activity, {us, timestamp, status}).
|
-record(last_activity, {us, timestamp, status}).
|
||||||
|
|
||||||
@ -76,23 +77,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,
|
||||||
get_last(IQ, SubEl, User, Server);
|
#userlist{},
|
||||||
List ->
|
[User, Server]),
|
||||||
case catch mod_privacy:check_packet(
|
case ejabberd_hooks:run_fold(
|
||||||
User, Server, List,
|
privacy_check_packet, Server,
|
||||||
|
allow,
|
||||||
|
[User, Server, UserListRecord,
|
||||||
{From, To,
|
{From, To,
|
||||||
{xmlelement, "presence", [], []}},
|
{xmlelement, "presence", [], []}},
|
||||||
out) of
|
out]) of
|
||||||
{'EXIT', _Reason} ->
|
|
||||||
get_last(IQ, SubEl, User, Server);
|
|
||||||
allow ->
|
allow ->
|
||||||
get_last(IQ, SubEl, User, Server);
|
get_last(IQ, SubEl, User, Server);
|
||||||
deny ->
|
deny ->
|
||||||
IQ#iq{type = error,
|
IQ#iq{type = error,
|
||||||
sub_el = [SubEl, ?ERR_NOT_ALLOWED]}
|
sub_el = [SubEl, ?ERR_NOT_ALLOWED]}
|
||||||
end
|
|
||||||
end;
|
end;
|
||||||
true ->
|
true ->
|
||||||
IQ#iq{type = error,
|
IQ#iq{type = error,
|
||||||
|
Loading…
Reference in New Issue
Block a user