powered by Jive Software

MUC: Time for the owner/admin changes after 6 years [OF-98]

As noted in OF-98, Openfire currently uses an outdated version of the XEP (at this time known as JEP) for MUC changes and user listings. Smack does so too, which can be seen in SMACK-371. In fact SMACK-371 and OF-98 are the same issue: One belonging to the client implementation, the other one belongs to the server.

I have already made and tested the changes needed for Smack to work with more up to date XMPP servers (basically everything besides openfire) and I think that the changes are minimal for openfire too: Basically everything from IQOwnerHandler.java:170http://fisheye.igniterealtime.org/browse/openfire/trunk/src/java/org/jivesoftwar e/openfire/muc/spi/IQOwnerHandler.java?r=12978 handleItemsElement()needs to be shifted to the according function in IQAdminHandler.java.

Owner and Admin are no longer listed and modified by muc#owner, but by muc#admin instead. In the latest versions of XEP-0045 muc#owner is only used for initial MUC configuration, the configuration form of the MUC and MUC destruction.

Now, after over 6 years, is the time right for both, Smack and Openfire, to adopt the changes simulatnuesly. While there are sure other XEP-0045 updates/changes to both have missed, this is becoming more and more a problem, because many client’s aren’t able to change the owner list of a openfire server and many servers don’t understand Smack. I also believe that these changes can be made backwards compatible, so that openfire also accepts muc#owner for what now muc#admin is the supposed namespace.

I would test and send patches for openfire too, but I am unable to build it at the moment.

Flow

Great to hear that you are willing to fix this and provide patches. I would test those patches too, to check the backward compatibility with older clients.

Here is the patch. It seems to compile but I am unable to build an .deb to install the modified version on my server an test it.

@wroot: Could you create an .deb from the latest openfire trunk with my patch applied and send it to me?
of-98.patch.zip (1272 Bytes)

No, i can’t build installers either (not even trying, too much for me). I will test only with the compiled server version.

You can download the .deb with my changes here: http://dl.dropbox.com/u/14807061/openfire_3.7.2_all.deb

Happy testing

I’m on Windows, huh But maybe this link will be useful for someone else.

There probably were some MUC changes imn the trunk, because i have just compiled it (without your patch yet) and room configuration doesn’t work for Exodus client, though it works fine with the 3.7.1 version. Will test your patch later.

Quick update about my testing progress. Unfortunately it was not positive. Openfire still answers owner list requests send wie the muc#admin namespace with an bad-request error. Plus there are additional errors and I am not sure if they are introduced by my patch or are already there (which I suspect). It would be great if someone could verify the behaviour of the current trunk. But first here is what I see:











**

<query xmlns=“http://jabber.org/protocol/muc#admin
/>




** ******

******This was captured with gajim’s XML console. The incoming stanzas are from openfire. The element is closed to early. Seems like more debuging needs to be done.


It seems that my problems with Exodus and MUC were because of Jingle Nodes plugin installed. Now it works fine with Openfire 3.7.1 and 3.7.2 alpha and Exodus 0.9.1.0 (our primary client at work). Exodus 0.10.0.0 is suddenly not able to login to Openfire when SSL is enabled. Was working just a few weeks ago and now can’t. I haven’t changed anything on the server. Ah, we should get rid of this piece of crap long time ago, but it is hard to move all our staff to a newer client (like Spark or else).

But i can’t test your patch for backward compatibility as i can’t compile with your patch in NetBeans:

Compiling 579 source files to D:\My Documents\JiveSoftware\Openfire\work\classes

warning: [options] bootstrap class path not set in conjunction with -source 1.5

D:\My Documents\JiveSoftware\Openfire\src\java\org\jivesoftware\openfire\sasl\SaslSer verFactoryImpl.java:28: warning: PolicyUtils is internal proprietary API and may be removed in a future release

import com.sun.security.sasl.util.PolicyUtils;

D:\My Documents\JiveSoftware\Openfire\src\java\org\jivesoftware\openfire\muc\spi\IQAd minHandler.java:209: error: incompatible types

** for (String jid : room.getOwners()) {**

** required: String**

** found: JID**

D:\My Documents\JiveSoftware\Openfire\src\java\org\jivesoftware\openfire\muc\spi\IQAd minHandler.java:215: error: method getOccupantsByBareJID in class LocalMUCRoom cannot be applied to given types;

** List roles = room.getOccupantsByBareJID(jid);**

** required: JID**

** found: String**

** reason: actual argument String cannot be converted to JID by method invocation conversion**

D:\My Documents\JiveSoftware\Openfire\src\java\org\jivesoftware\openfire\muc\spi\IQAd minHandler.java:228: error: incompatible types

** for (String jid : room.getAdmins()) {**

** required: String**

** found: JID**

D:\My Documents\JiveSoftware\Openfire\src\java\org\jivesoftware\openfire\muc\spi\IQAd minHandler.java:234: error: method getOccupantsByBareJID in class LocalMUCRoom cannot be applied to given types;

** List roles = room.getOccupantsByBareJID(jid);**

** required: JID**

** found: String**

reason: actual argument String cannot be converted to JID by method invocation conversion

D:\My Documents\JiveSoftware\Openfire\src\java\org\jivesoftware\openfire\sasl\SaslSer verFactoryImpl.java:40: warning: PolicyUtils is internal proprietary API and may be removed in a future release

private static final int mechPolicies[] = { PolicyUtils.NOANONYMOUS, PolicyUtils.NOANONYMOUS };

D:\My Documents\JiveSoftware\Openfire\src\java\org\jivesoftware\openfire\sasl\SaslSer verFactoryImpl.java:40: warning: PolicyUtils is internal proprietary API and may be removed in a future release

private static final int mechPolicies[] = { PolicyUtils.NOANONYMOUS, PolicyUtils.NOANONYMOUS };

D:\My Documents\JiveSoftware\Openfire\src\java\org\jivesoftware\openfire\sasl\SaslSer verFactoryImpl.java:60: warning: PolicyUtils is internal proprietary API and may be removed in a future release

if (mechanism.equals(myMechs[PLAIN]) && PolicyUtils.checkPolicy(mechPolicies[PLAIN], props)) {

D:\My Documents\JiveSoftware\Openfire\src\java\org\jivesoftware\openfire\sasl\SaslSer verFactoryImpl.java:66: warning: PolicyUtils is internal proprietary API and may be removed in a future release

else if (mechanism.equals(myMechs[CLEARSPACE]) && PolicyUtils.checkPolicy(mechPolicies[CLEARSPACE], props)) {

D:\My Documents\JiveSoftware\Openfire\src\java\org\jivesoftware\openfire\sasl\SaslSer verFactoryImpl.java:82: warning: PolicyUtils is internal proprietary API and may be removed in a future release

return PolicyUtils.filterMechs(myMechs, mechPolicies, props);

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: Some input files use unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

4 errors

7 warnings

D:\My Documents\JiveSoftware\Openfire\build.xml:282: Compile failed; see the compiler error output for details.

BUILD FAILED (total time: 6 seconds)

**Success! Openfire answers now owner/admin listings and change requests within the muc#admin namespace:
**

<

The patch is attached and should fix OF-98 while remaining backwards compatible, since no code is removed.

@wroot it should also fix your compilation issues. I have used an older svn revision while developing the patch.

of-98.patch.zip (1384 Bytes)

Try attaching your new patch to the ticket now.

Worked.

@wroot My new patch should compile. Feel free to test and report back.

This patch version does compile. Tested with the old Exodus version. MUC is working fine, so backward compatibility should be ok, i think.

Also, please check the comment on OF-475 and reopen the ticket if it is really about the different issue.

I have added an comment on OF-475.

Wroot, could you also test if Gajim or tkabber are now able to fetch and/or modify the admin/owner list of a MUC on the patched openfire? This was not possible without the patch and should work now. At least it works here on my gajim instance. But a second test couldn’t hurt.

I was able to get the list of admins/owners on Gajim and add new admins/owners. On Tkabber it doesn’t show configuration window for a new chat room and automatically confirm settings and unlocks the room. I haven’t found a menu to configure room settings, but i was able to add other users as admins and they got their permissions.