mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Advertise privacy lists support via disco#info
This commit is contained in:
parent
7865c6a146
commit
0baf4e6088
@ -64,6 +64,7 @@ start(Host, Opts) ->
|
|||||||
update_table();
|
update_table();
|
||||||
_ -> ok
|
_ -> ok
|
||||||
end,
|
end,
|
||||||
|
mod_disco:register_feature(Host, ?NS_PRIVACY),
|
||||||
ejabberd_hooks:add(privacy_iq_get, Host, ?MODULE,
|
ejabberd_hooks:add(privacy_iq_get, Host, ?MODULE,
|
||||||
process_iq_get, 50),
|
process_iq_get, 50),
|
||||||
ejabberd_hooks:add(privacy_iq_set, Host, ?MODULE,
|
ejabberd_hooks:add(privacy_iq_set, Host, ?MODULE,
|
||||||
@ -80,6 +81,7 @@ start(Host, Opts) ->
|
|||||||
?NS_PRIVACY, ?MODULE, process_iq, IQDisc).
|
?NS_PRIVACY, ?MODULE, process_iq, IQDisc).
|
||||||
|
|
||||||
stop(Host) ->
|
stop(Host) ->
|
||||||
|
mod_disco:unregister_feature(Host, ?NS_PRIVACY),
|
||||||
ejabberd_hooks:delete(privacy_iq_get, Host, ?MODULE,
|
ejabberd_hooks:delete(privacy_iq_get, Host, ?MODULE,
|
||||||
process_iq_get, 50),
|
process_iq_get, 50),
|
||||||
ejabberd_hooks:delete(privacy_iq_set, Host, ?MODULE,
|
ejabberd_hooks:delete(privacy_iq_set, Host, ?MODULE,
|
||||||
|
@ -356,13 +356,7 @@ last(Config) ->
|
|||||||
disconnect(Config).
|
disconnect(Config).
|
||||||
|
|
||||||
privacy(Config) ->
|
privacy(Config) ->
|
||||||
%% BUG: the feature MUST be advertised via disco#info:
|
true = is_feature_advertised(Config, ?NS_PRIVACY),
|
||||||
%% 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),
|
|
||||||
I1 = send(Config, #iq{type = get, sub_els = [#privacy{}]}),
|
I1 = send(Config, #iq{type = get, sub_els = [#privacy{}]}),
|
||||||
#iq{type = result, id = I1, sub_els = [#privacy{}]} = recv(),
|
#iq{type = result, id = I1, sub_els = [#privacy{}]} = recv(),
|
||||||
JID = <<"tybalt@example.com">>,
|
JID = <<"tybalt@example.com">>,
|
||||||
|
Loading…
Reference in New Issue
Block a user