Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to XEP-0402 for bookmarks management #1494

Open
raspbeguy opened this issue Mar 4, 2021 · 5 comments
Open

Move to XEP-0402 for bookmarks management #1494

raspbeguy opened this issue Mar 4, 2021 · 5 comments
Labels

Comments

@raspbeguy
Copy link
Contributor

First I had in mind to create an issue because I had to restart profanity to update my bookmarks list. Then I discovered that profanity used old and deprecated XEP-0048 for bookmarks. The up-to-date XEP is XEP-0402.

It might be a good idea to switch to the new XEP. For XMPP server devs it takes effort to maintain two sets of bookmarks and protocol translation between them, and they will eventually move on and completely drop XEP-0048.

@jubalh jubalh added the feature label Mar 4, 2021
@ghost
Copy link

ghost commented Mar 11, 2021

The new standard requires that arbitrary <extension> data MUST be preserved. Currently, the only preserved 'extension' data is ext_gajim_minimize. I think we don't want to store all of these data in the struct bookmark_t. For modifying bookmarks, we could retrieve the complete entry and upload the updated data.

@ghost
Copy link

ghost commented Mar 12, 2021

The current implementation in Profanity only supports XEP-0048 with the legacy "Private XML Storage".

I think we should follow the backward compatibility strategy that Gajim has implemented:

https://dev.gajim.org/gajim/gajim/-/blob/master/gajim/common/modules/bookmarks.py#L144

  • If PubSub is not supported at all (which should be rare), use (legacy) Private XML storage bookmarks
  • (Use native bookmarks if forced by a user option)
  • If the server announced compatibility between PEP storage and PEP Native Bookmarks (XEP-04-02) (via the urn:xmpp:bookmarks:1#compat feature), use PEP Native Bookmarks.
  • If conversion between Private XML storage and PEP storage (announced via the 'unofficial' urn:xmpp:bookmarks-conversion:0 feature) is supported, use PEP storage.
  • As a fallback, use XML private storage.

Implementation roadmap

Fortunately, the data structures in all three versions are almost the same. Thus, most code can be reused. The most complicated logic is the method choice.

  • First remove the 'external Gajim option', since it is not used any more even by Gajim
  • Finish the implementation of PEP Storage Bookmarks (XEP-0048) (currently #if 0-ed) and use PEP storage whenever conversion between legacy XML storage and PEP storage is announced (via urn:xmpp:bookmarks-conversion:0)
  • Implement Native PEP bookmarks (XEP-0402)
    • Use it by default if the compatibility to XEP-0402 is announced (urn:xmpp:bookmarks:1#compat)
    • For full compliance with XEP-0402, store the optional <extensions> stanza. I don't know though whether other clients are actually using this.

@jubalh
Copy link
Member

jubalh commented Jun 10, 2021

For XMPP server devs it takes effort to maintain two sets of bookmarks and protocol translation between them, and they will eventually move on and completely drop XEP-0048.

Seems so far not even supported by ejabberd ;)

@raspbeguy
Copy link
Contributor Author

Well then, so we have a lot of time before this becomes critical :)

Would be good not to miss the boat when it does though.

@jubalh
Copy link
Member

jubalh commented Jun 10, 2021

Sure. But if servers didn't even implement it yet it's not like we need to be afraid that the will drop support anytime soon ;) So this "eventually" is quite far in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants