powered by Jive Software

Room.as patch to allow custom MUCExtension on joining

Our client implementation had reason to send a custom MUCExtension on joining a MUC (to set discussion history parameters, see: http://xmpp.org/extensions/xep-0045.html#enter-managehistory). So, added an API method to Room class allowing caller to send whatever MUC extension they want as a joining presence.

Patch attached for review.

Karthik
room.patch.zip (703 Bytes)

Could you add documentation to the comments of what is possible to accomplish with this new method and possibly a usage example?

Feel free to commit once comments added.

Committed in r11556.

It reminds me that I made myself a little update in my version of Room.as so that the inherited maxchars attribute of the parent class can be set to 0 to disable history in Rooms.

Does it seem correct ?

Hi geomaster,

Sounds interesting – could you post a patch so that we can clearly see what you did?

Karthik

Here is the patch.

I don’t know the way XIFF is developed so it’s just an example.

The way it works is simple : I added a class attribute historyEnabled in Room.as and if the flag is false when the join method is called, I set the muc.maxchars attribute to 0 so that I don’t retrieve the history of the chatroom I’m joining. If the flag is true, I don’t do anything and I suppose that XIFF is using the XMPP server muc configuration default value.
Room.as.patch.zip (670 Bytes)

That’s a working solution for the history case, but I prefer the current trunk version which is much more extensible (doesn’t require a new field for each customization that we want to add to the initial presence).

I understand your point but my fix with a new class property was not here to replace yours with the custom MUCExtension but to add a new functionnality that I thought not available in the Room class.

Or maybe I don’t understand how I could use your changes to disable room history ?

I put an example in the ASDoc comment for the function, I think the example covers setting the history fields. Let me know if it needs to be clearer.