]> granicus.if.org Git - ejabberd/commitdiff
Only advertise conversion feature when mod_pubsub is loaded
authorEvgeny Khramtsov <ekhramtsov@process-one.net>
Fri, 23 Nov 2018 11:01:06 +0000 (14:01 +0300)
committerEvgeny Khramtsov <ekhramtsov@process-one.net>
Fri, 23 Nov 2018 11:01:06 +0000 (14:01 +0300)
src/mod_private.erl

index 7d139080a6ecb70c71f980143a89f37358742c23..db82e1295614064dbf37a4cd3aef44557a34b4e0 100644 (file)
@@ -102,12 +102,17 @@ mod_options(Host) ->
                             {error, stanza_error()} | empty | {result, [binary()]}.
 get_sm_features({error, _Error} = Acc, _From, _To, _Node, _Lang) ->
     Acc;
-get_sm_features(Acc, _From, _To, <<"">>, _Lang) ->
-    {result, [?NS_BOOKMARKS_CONVERSION_0 |
-             case Acc of
-                 {result, Features} -> Features;
-                 empty -> []
-             end]};
+get_sm_features(Acc, _From, To, <<"">>, _Lang) ->
+    case gen_mod:is_loaded(To#jid.lserver, mod_pubsub) of
+       true ->
+           {result, [?NS_BOOKMARKS_CONVERSION_0 |
+                     case Acc of
+                         {result, Features} -> Features;
+                         empty -> []
+                     end]};
+       false ->
+           Acc
+    end;
 get_sm_features(Acc, _From, _To, _Node, _Lang) ->
     Acc.