jsxc icon indicating copy to clipboard operation
jsxc copied to clipboard

Subscribe to bookmark changes (XEP-0048)

Open tmolitor-stud-tu opened this issue 9 years ago • 13 comments

Feature Request

If I add a new MUC bookmark to my roster using other clients like Conversations or Gajim, I want those MUC rooms to automatically show up in JSXC as well. But this doesn't happen, I have to manually join the room in JSXC as well.

Please add support for XEP-0048 (https://xmpp.org/extensions/xep-0048.html)

Steps to reproduce the behavior

  1. Join a room in Conversations
  2. Log in using JSXC
  3. MUC room isn't joined automatically

tmolitor-stud-tu avatar Nov 28 '17 13:11 tmolitor-stud-tu

We query for bookmarks only once on login, so I will rename this enhancement request to reflect that "only" a subscription is missing.

sualko avatar Nov 29 '17 09:11 sualko

Well, even after relogin the MUC rooms aren't joined by JSXC.

I veryfied that the autojoin flag is set on the bookmark and I used a new browser profile to login to JSXC but the boomarks still don't appear.

tmolitor-stud-tu avatar Nov 29 '17 10:11 tmolitor-stud-tu

Can you enable debugging and look if you can spot if the bookmark storage is retrieved? It would be helpful if you could post the storage, because the XEP is not very clear on this.

sualko avatar Nov 29 '17 12:11 sualko

It looks like the bookmarks are retrieved since after logging in, the debug console lists the messages:

[…]
discover http upload service
jsxc.js:165 Load roster 
jsxc.js:183 Load bookmarks from pubsub
jsxc.js:183 Roster loaded
[…]
Carbons enabled
jsxc.js:183 auto join [name of the bookmarked group]@conference.juforum.de
[…]
Variable [name of the bookmarked group] doesn't exist. It was created.
[…]
jsxc.js:165 onPresence <presence xmlns=​"jabber:​client" to=​"[my name]@juforum.de/​juforum" from=​"[name of the bookmarked group]@conference.juforum.de/[my name]">​…​</presence>​
jsxc.js:183 Presence ([name of the bookmarked group]@conference.juforum.de/[my name]): online
jsxc.js:165 webrtc.onpresence [name of the bookmarked group]@conference.juforum.de/[my name]
jsxc.js:165 Update icon [name of the bookmarked group]@conference.juforum.de
jsxc.js:165 vCard <iq xmlns=​"jabber:​client" type=​"result" to=​"[my name]@juforum.de/​juforum" from=​"[other name]@juforum.de" id=​"[…]:​sendIQ">​…​</iq>​
jsxc.js:183 No photo provided
[…]
Update icon [name of the bookmarked group]@conference.juforum.de
[…]

At this point the buddy list does not display any contacts (this might be another issue). Navigating to another page or reloading the current page makes JSXC display the contacts properly in the buddy list – except the bookmarked group which was auto-joined believing the log above. After navigating, the log does not contain anything of interest:

jsxc.js:183 State changed to INITIATING
jsxc.dep.js:49953 i18next: languageChanged de
jsxc.dep.js:49953 i18next: initialized {debug: true, initImmediate: true, ns: Array(1), defaultNS: Array(1), fallbackLng: Array(1), …}
jsxc.js:183 State changed to PREVCONFOUND
jsxc.js:183 check master
jsxc.js:183 I am master.
jsxc.js:183 State changed to ESTABLISHING
jsxc.js:183 Try to attach
jsxc.js:183 SID: […]
jsxc.js:183 ATTACHED: null
jsxc.js:183 UI State changed to INITIATING
jsxc.js:165 Send presence <presence xmlns='jabber:client'><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://jsxc.org/' ver=[…]'/></presence>
jsxc.js:183 UI State changed to READY
jsxc.js:183 DSA key loaded
jsxc.js:183 State changed to READY

Though, the local cache contains information which emphasize that the group was joined properly. Additionally, it seems that even the group members are assigned correctly:

jsxc:[my name]@juforum.de:buddy:[name of the bookmarked group]@conference.juforum.de:
	{"jid":"[name of the bookmarked group]@conference.juforum.de","name":"[name of the bookmarked group]","sub":"both","status":0,"type":"groupchat","state":0,"subject":null,"bookmarked":true,"autojoin":true,"nickname":"[my name]","res":["[another name]","[my name]"]}

jsxc:[my name]@juforum.de:buddylist:
	[[…],"[name of the bookmarked group]@conference.juforum.de"]

jsxc:[my name]@juforum.de:res:[name of the bookmarked group]@conference.juforum.de:
	{"[another name]":5,"[my name]":5}

The only issue is that the group is not displayed in the buddy list unless it is rejoined manually using the respective dialog of JSXC. Do you have any clue?

tmolitor-stud-tu avatar Dec 01 '17 22:12 tmolitor-stud-tu

I will probably investigate this next week. Sorry for the delay.

sualko avatar Dec 08 '17 10:12 sualko

No problem :)

tmolitor-stud-tu avatar Dec 08 '17 13:12 tmolitor-stud-tu

I would to build a gourpchat app. I use the muc. but I found what I really need is the group-chat, not a room-chat. the user will always leave the room then go-offline, even I set it the the room-member. and when the user go-online again, it not goto the same room auto.

does that any solution or hooks for this?

devendrawebdeveloper avatar Dec 17 '17 19:12 devendrawebdeveloper

and when the user go-online again, it not goto the same room auto.

@devendrawebdeveloper that's the described issue in this issue. Please be patient until I had time to fix it.

sualko avatar Dec 21 '17 12:12 sualko

Thank you for working on this @sualko !

I noticed that after I join a MUC from oJSXC it sticks around the next time I log into Nextcloud. Does (o?)JSXC have a secret extra roster where it merges the roster-of-users with a roster-of-groupchats?

kousu avatar Jan 10 '18 20:01 kousu

I had some time to look at this and I have bad news for you. At least gajim uses Private XML Storage (XEP-0049) as backend, while the latest recommendation is to use Publish-Subscribe (XEP-0060), which we use. For this reason you don't see your bookmarks in JSXC.

I also tried to look at the bookmark updates, but for some reason I don't get update messages in my dev setup and I have no more time to debug this further. I'm sorry.

Does (o?)JSXC have a secret extra roster where it merges the roster-of-users with a roster-of-groupchats?

Like most other clients we keep all mucs in the roster until you leave it.

sualko avatar Mar 01 '18 13:03 sualko

Please see this standards@ thread here: https://mail.jabber.org/pipermail/standards/2018-March/034498.html It seems like every other implementation uses XEP-0049 (private XML) and it seems likely that the recommendation will be taken back.

Also the usage of XEP-0060 for storage seems to have some severe security problems which likely affect JSXC, too. See here for an explanation: https://gultsch.de/converse_bookmarks.html

tmolitor-stud-tu avatar Mar 08 '18 08:03 tmolitor-stud-tu

Let's summarize: Pubsub has privacy issues if the server doesn't support node permissions, but as Daniel wrote "XEP-0048 based on XEP-0049 has big problems with multi client environments and long standing sessions". I think it's best to wait until there is a proper solution/decision.

sualko avatar Mar 08 '18 13:03 sualko

"Bookmarks2" seems to be now widely supported and I guess corresponds to this XEP: https://xmpp.org/extensions/xep-0402.html

poVoq avatar Aug 09 '21 02:08 poVoq