]> granicus.if.org Git - ejabberd/commitdiff
mod_private: Hardcode item ID for PEP bookmarks
authorHolger Weiss <holger@zedat.fu-berlin.de>
Tue, 8 Jan 2019 20:23:21 +0000 (21:23 +0100)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Tue, 8 Jan 2019 20:23:21 +0000 (21:23 +0100)
Set the item ID to "current" when publishing bookmarks via PEP.
XEP-0060 says: For singleton nodes, "it is RECOMMENDED for the publisher
to specify an ItemID of 'current' to ensure that the publication of a
new item will overwrite the existing item."

src/mod_private.erl

index b32fff98e22e2dbaae0efb3887408c39bd4e167f..52aed7aebe89a2b2292f1bd54083fe30868f061f 100644 (file)
@@ -255,7 +255,7 @@ publish_data(JID, Data) ->
                               {access_model, whitelist}],
                    case mod_pubsub:publish_item(
                           LBJID, LServer, ?NS_STORAGE_BOOKMARKS, JID,
-                          <<>>, [El], PubOpts, all) of
+                          <<"current">>, [El], PubOpts, all) of
                        {result, _} -> ok;
                        {error, _} = Err -> Err
                    end