]> granicus.if.org Git - ejabberd/commitdiff
Fix returning value from mod_vcard_ldap's search() callback
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Sun, 25 Mar 2018 07:53:46 +0000 (10:53 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Sun, 25 Mar 2018 07:53:46 +0000 (10:53 +0300)
Fixes #2335

src/mod_vcard_ldap.erl

index ce4fcd702cb378c7897d2f0e814f6da1fa7c57ec..51de22e4c843f48c937fd2961acb3d0f1047217c 100644 (file)
@@ -143,7 +143,7 @@ search_items(Entries, State) ->
                                   #eldap_entry{attributes = Attrs} = E, Attrs
                           end,
                           Entries),
-    lists:flatmap(
+    lists:filtermap(
       fun(Attrs) ->
              case eldap_utils:find_ldap_attrs(UIDs, Attrs) of
                  {U, UIDAttrFormat} ->
@@ -163,15 +163,15 @@ search_items(Entries, State) ->
                                                  end,
                                                  SearchReported),
                                      J = <<Username/binary, $@, LServer/binary>>,
-                                     [{<<"jid">>, J} | RFields];
+                                     {true, [{<<"jid">>, J} | RFields]};
                                  _ ->
-                                     []
+                                     false
                              end;
                          _ ->
-                             []
+                             false
                      end;
                  <<"">> ->
-                     []
+                     false
              end
       end, Attributes).