xmpp icon indicating copy to clipboard operation
xmpp copied to clipboard

specs: mix: Always use mix:core:1 xmlns for mix_participant

Open lnjX opened this issue 1 year ago • 4 comments

The items from the participants node must have one specific namespace and we cannot support both versions at the same time. The current behaviour is to use the old mix:core:0 namespace (by default). This changes the behaviour to always use the new mix:core:1 namespace.

lnjX avatar Aug 19 '24 16:08 lnjX

Hello, could you tell me what look your code that has problem with distingishing between those two? is that a problem with parsing xml data, or using records from that directly. I think both those cases should work as long as xmlns field is set to correct namespace.

prefiks avatar Aug 20 '24 12:08 prefiks

Hi @prefiks, my issue is that ejabberd still outputs pubsub items with the old namespace. The code in ejabberd just doesn't set the xmlns attribute of the record (so it defaults to the first (old) namespace here). I thought that we can maybe just drop the old version to keep things simple. This way ejabberd will automatically use the new namespace without any further changes.

However I can also understand if you want to keep the parsing code of the old version. In that case we would need to set the xmlns explicitly in ejabberd everywhere to comply with the current MIX version.

lnjX avatar Aug 20 '24 15:08 lnjX

I'm not aware of a public client that supports the old revision, so maybe we could just ditch mix:core:0 support indeed? (Or are there closed solutions using it?)

Would of course just delay the problem until we arrive at mix:core:2 …

weiss avatar Sep 09 '24 10:09 weiss

I just noticed that the new mix:core:1 version actually differs from the mix:core:0 version:

<participant xmlns='urn:xmpp:mix:core:0' nick='thirdwitch'/>

vs.

<participant xmlns='urn:xmpp:mix:core:1'>
  <nick>thirdwitch</nick>
  <jid>[email protected]</jid>
</participant>

So the current version of mix_participant would generate wrong XML output with the new xmlns set.

If you want, I can adjust the PR and change that. :)


Would of course just delay the problem until we arrive at mix:core:2 …

I'd personally expect / hope for a migration path specified by the XEP in that case, e.g. a new participants node name for the new version. Otherwise it's not possible to support multiple versions at the same time.

lnjX avatar Sep 09 '24 11:09 lnjX

I fixed the definition of the element so that it uses XML subelements for nick and jid now (as specified in the new MIX version).

The old version is dropped since ejabberd cannot support both versions at the same time anyway. If you prefer to still have the old version in the xmpp lib, I could create two different records for both versions. :)

lnjX avatar Oct 26 '24 10:10 lnjX

@prefiks Are there any issues with this PR?

melvo avatar Dec 16 '24 09:12 melvo