get_sm_features({error, _Error} = Acc, _From, _To, _Node, _Lang) ->
Acc;
get_sm_features(Acc, _From, _To, <<"">>, _Lang) ->
- {result, [?NS_DISCO_INFO, ?NS_PEP_VCARD_CONVERSION_0 |
+ {result, [?NS_PEP_VCARD_CONVERSION_0 |
case Acc of
{result, Features} -> Features;
empty -> []
-spec get_sm_features(features_acc(), jid(), jid(), binary(), binary()) ->
{error, stanza_error()} | {result, [binary()]}.
-get_sm_features(empty, From, To, _Node, Lang) ->
+get_sm_features(empty, From, To, Node, Lang) ->
#jid{luser = LFrom, lserver = LSFrom} = From,
#jid{luser = LTo, lserver = LSTo} = To,
case {LFrom, LSFrom} of
- {LTo, LSTo} -> {error, xmpp:err_item_not_found()};
- _ ->
+ {LTo, LSTo} ->
+ case Node of
+ <<"">> -> {result, [?NS_DISCO_INFO, ?NS_DISCO_ITEMS]};
+ _ -> {error, xmpp:err_item_not_found()}
+ end;
+ _ ->
Txt = <<"Query to another users is forbidden">>,
{error, xmpp:err_not_allowed(Txt, Lang)}
end;
+get_sm_features({result, Features}, _From, _To, <<"">>, _Lang) ->
+ {result, [?NS_DISCO_INFO, ?NS_DISCO_ITEMS|Features]};
get_sm_features(Acc, _From, _To, _Node, _Lang) -> Acc.
-spec get_user_resources(binary(), binary()) -> [disco_item()].
<<"">> ->
case Acc of
{result, Features} ->
- {result, [?NS_DISCO_INFO, ?NS_VCARD | Features]};
- empty -> {result, [?NS_DISCO_INFO, ?NS_VCARD]}
+ {result, [?NS_VCARD | Features]};
+ empty -> {result, [?NS_VCARD]}
end;
_ -> Acc
end.