Miranda NG Official Community Forum

Forum for English speaking Miranda NG users => Bug reports => Topic started by: Tragen on 22 02 2019, 00:24:54

Title: XMPP Bug: You must join the room before sending presence updates
Post by: Tragen on 22 02 2019, 00:24:54
I installed the latest update from today and now XMPP connects, but I get this error multiple times.

Code: [Select]
---------------------------
Jabber Error
---------------------------
Error 0: Unknown error

You must join the room before sending presence updates
---------------------------
OK   
---------------------------

(https://i.imgur.com/TowZwYH.png)
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: ghazan on 22 02 2019, 18:59:39
means that a room is private, i.e. you need to be invited into it, you can't join it yourself on your wish
also a piece of network log would be appreciated
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: Tragen on 22 02 2019, 20:43:36
It's a public room.
prosody@conference.prosody.im
I was connected automatically before the last update.
Now it's just an entry in my list. When I try to "Join chat" I get the error

(https://i.imgur.com/maG0h07.png)
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: Tragen on 22 02 2019, 20:47:45
I tried to delete the room and add it again. I also get this message.
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: ghazan on 22 02 2019, 21:09:07
Tragen,
using development or stable version?
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: Tragen on 22 02 2019, 22:59:08
I'm using the latest stable version.
I will try to get a network log.
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: Tragen on 23 02 2019, 00:39:09
I just installed the latest stable version. Now I can connect to my own server rooms again, but the prosody@conference.prosody.im not.
Here is the output of the xml console:

Code: [Select]
<presence to="prosody@conference.prosody.im/Tragen">
<priority>0</priority>
<x xmlns="http://jabber.org/protocol/muc">
<password>Tragen</password>
</x>
<c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://miranda-ng.org/caps" ver="EMplRpI1ZVUMDeRT/EnvNaIUIcA=" ext="mirotr x64 mood activity mir_notes" />
<x xmlns="vcard-temp:x:update">
<photo />
</x>
<status>Yep, I'm here.</status>
</presence>
­
<presence from="prosody@conference.prosody.im/Tragen" to="name@domain.com/Miranda" type="error">
<error type="cancel" code="409">
<conflict xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
</error>
<x xmlns="http://jabber.org/protocol/muc" />
</presence>

I don't know why it tries to send a password which is wrong.
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: Tragen on 23 02 2019, 15:25:59
The network log for the xmpp connection shows the same info. No difference.
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: ghazan on 23 02 2019, 15:42:26
I don't know why it tries to send a password which is wrong.
because it's specified in a bookmark and might be transferred into a contact. open a contact of that room in dbeditor++ and wipe Password field
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: Tragen on 24 02 2019, 00:35:23
I will do that, but I still cannot join this room.
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: Tragen on 24 02 2019, 00:40:41
I don't know why but after the latest update where only Miranda, Discord and one other file was updated, it's working again.

 ???
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: ghazan on 25 02 2019, 20:39:52
I don't know why but after the latest update where only Miranda, Discord and one other file was updated, it's working again.
because chat engine is located into the core :)
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: beezle on 02 01 2020, 18:48:04
Hi - just updated my prosody server (long, long overdue) and can no longer connect to muc.  I've copied  the console output below.   No expert in this, but from what I can find at xmpp.org, presence should NOT be sent prior to joining and it seems that Miranda is not following that req?   Note - I can join conferences on non-prosody servers so its quite possible that other servers are not enforcing that requirement.   Clearly the prior, quite old, version of prosody I had been using did not either.

console output:

<presence to="CHATROOM@conference.XXX.com/MYNICK">
<priority>
0
</priority>
<status>
Yo!
</status>
</presence>
­
<presence type="error" to="MYNICK@XXX.com/Miranda" from="CHATROOM@conference.XXX.com/MYNICK">
<error type="cancel">
<item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">
You must join the room before sending presence updates
</text>
</error>
</presence>


from xmpp.org:

7.2.1 Basic MUC Protocol

In order to participate in the discussions held in a multi-user chat room, a user MUST first become an occupant by entering the room.

MUC clients MUST signal their ability to speak the MUC protocol by including in the initial presence stanza an empty <x/> element qualified by the 'http://jabber.org/protocol/muc' namespace (note the absence of the '#user' fragment):
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: ghazan on 05 01 2020, 15:20:14
beezle,
you shall be a room participant to enter it, or this room does not exists.
XMPP clients do join chatrooms by sending the presence packet to them, these matters are non-separatable
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: beezle on 06 01 2020, 17:13:56
I have another machine I use that has 1) a very old version of the original Miranda and 2) an slightly older version of Miranda-NG.   Both connect to Prosody server chatrooms with no issue.   

Below is the XML console from each, you can compare to my prior post showing the current release Miranda-NG.   Again - I am not an XMPP expert or serious coder, but clearly something has changed between 0.95.9.1 and 0.95.10.3 - I'm guessing the missing <x xlmns...> lines?  Perhaps unfortuantely, I do not always stay current on Mirana-NG and can't better pin-point what version had this connection issue first.   

OLD MIRANDA:

<presence to="XXX@conference.YYY.com/ME">
<priority>0</priority>
<x xmlns="http://jabber.org/protocol/muc" />
<c xmlns="http://jabber.org/protocol/caps" node="http://miranda-im.org/caps" ver="0.10.11.0" ext="mood activity mir_notes" />
<x xmlns="vcard-temp:x:update">
<photo>c457c394be108c312a7d7a8d3af2e3eac8c1d739</photo>
</x>
<status>Present and misaccounted for</status>
</presence>

MIRANDA-NG v0.95.9.1 build #20741 x64
<presence to="XXX@conference.YYY.com/ME">
<priority>0</priority>
<x xmlns="http://jabber.org/protocol/muc" />
<c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://miranda-ng.org/caps" ver="bVXgVJQucA8cFLmkVmD+lVxsaQI=" ext="x64 mood activity mir_notes" />
<x xmlns="vcard-temp:x:update">
<photo>c457c394be108c312a7d7a8d3af2e3eac8c1d739</photo>
</x>
<status>Present and misaccounted for</status>
</presence>

Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: ghazan on 08 01 2020, 15:56:05
beezle,
as for me they look pretty identical... any of <x> extensions might be simply skipped from the presence
of course, you can simply skip that <c> extension that differs and send a presence manually from XML console, but if the reaction was different, it would mean a serious problem in Prosody
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: beezle on 24 02 2020, 04:48:58
They are not.  Perhaps Prosody respects the xmpp.org spec for MUC and other servers do not, I really do not know but can only repeat:

7.2.1 Basic MUC Protocol
In order to participate in the discussions held in a multi-user chat room, a user MUST first become an occupant by entering the room.
MUC clients MUST signal their ability to speak the MUC protocol by including in the initial presence stanza an empty <x/> element qualified by the 'http://jabber.org/protocol/muc' namespace (note the absence of the '#user' fragment):


From XML console of the most recent miranda-ng, I can do this:

<presence to="chatroom@conference.XXX.com/USER">
<priority>0</priority>
<x xmlns="http://jabber.org/protocol/muc"/>
</presence>

Which does establish a proper connection to the chatroom.   

Current versions of Miranda-ng no longer send the x stanza when trying to join in the usual way and fail to connect with the previous mentioned presence error.    I really can't add anything more - this used to work, it used to include the <x> stanza, new(er) versions no longer include the <x> stanza and now fail to work with Prosody servers.  I don't know why it was removed, but it does seem to be critical to some servers.
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: ghazan on 24 02 2020, 10:38:39
beezle,
I've patched the development version according to XEP-045, you can try it
Title: Re: XMPP Bug: You must join the room before sending presence updates
Post by: beezle on 25 02 2020, 02:47:36
Works, thank you!