25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Advertise privacy lists support via disco#info

This commit is contained in:
Evgeniy Khramtsov 2013-06-15 04:17:38 +10:00 committed by Alexey Shchepin
parent 7865c6a146
commit 0baf4e6088
2 changed files with 3 additions and 7 deletions

View File

@ -64,6 +64,7 @@ start(Host, Opts) ->
update_table();
_ -> ok
end,
mod_disco:register_feature(Host, ?NS_PRIVACY),
ejabberd_hooks:add(privacy_iq_get, Host, ?MODULE,
process_iq_get, 50),
ejabberd_hooks:add(privacy_iq_set, Host, ?MODULE,
@ -80,6 +81,7 @@ start(Host, Opts) ->
?NS_PRIVACY, ?MODULE, process_iq, IQDisc).
stop(Host) ->
mod_disco:unregister_feature(Host, ?NS_PRIVACY),
ejabberd_hooks:delete(privacy_iq_get, Host, ?MODULE,
process_iq_get, 50),
ejabberd_hooks:delete(privacy_iq_set, Host, ?MODULE,

View File

@ -356,13 +356,7 @@ last(Config) ->
disconnect(Config).
privacy(Config) ->
%% BUG: the feature MUST be advertised via disco#info:
%% http://xmpp.org/extensions/xep-0016.html#disco
%% It seems like this bug exists because Privacy Lists
%% were implemented according to the old RFC where support
%% needn't be advertised via service discovery.
%% TODO: fix in ejabberd
%% true = is_feature_advertised(Config, ?NS_PRIVACY),
true = is_feature_advertised(Config, ?NS_PRIVACY),
I1 = send(Config, #iq{type = get, sub_els = [#privacy{}]}),
#iq{type = result, id = I1, sub_els = [#privacy{}]} = recv(),
JID = <<"tybalt@example.com">>,