[PATCH] Misc MUC Fixes

I’ve been doing some work on the Openfire MUC component, and this patch fixes a few various issues including:

http://www.igniterealtime.org/issues/browse/OF-48

It also sends the room topic to users upon joining the room as outlined in this thread:

http://www.igniterealtime.org/community/thread/39460?tstart=30

The final problem it resolves is this: Currently when you uncheck the “broadcast presence for” for a certain role (say visitor), their join presence is correctly supressed, but their unavailable presence is not when they leave the room. This is because Openfire (correctly) sets their role to none upon departure.

Unfortunately this is done right before the check to see if their presence should be broadcast, resulting in the presence always being sent to the entire room, despite them previously being a visitor.

To solve this, I created a shouldBroadcastPresence function, and check to see if the user’s original presence should be broadcast. If not, the new presence (with role=none) is only sent to the user, and not the entire room. This also fixes the issue listed above where unavailable presence packets were being sent twice upon user departure.

If someone would like to review and possibly integrate this patch, that would be excellent:

http://pastie.org/private/nzavmyzd8jy3mrsfx8rw

Excellent, thanks! Hopefully neiss can check it out and commit it.

daryl

Is it ok to attach the same patch for the two tickets, Daryl? I wonder how this will affect SVN, though probably it will just apply it twise But i think patch should be split into 3 parts and one more ticket should be filed for the issue descibed in this thread.

I can help with splitting up the patch if it isn’t clear which piece of the patch does what. Let me know if you need any help from me.

Yes. I think it is better if you do the splitting. Split it to 3 parts and i will create the missing ticket for the third one. Then we will change the attachments in the bug tracker.

OF-64 Also, you may want/need to sign a contributors agreement and send/fax it to Jive. But Benjamin has to update pdfs wit the new Jive’s office address first http://www.igniterealtime.org/community/docs/DOC-1733

Thanks for the patch, I will review and test it the next days/weeks.

So I’ve attempted to split this out, but unfortunately two of the changes conflict with each other (OF-64 completely replaces some of the lines that would have been split out for OF-48), I’m not quite sure how to handle that. Anyway, here are two patches, I tested applying them in different order against 3.6.4, and it appears that patch is smart enough to figure it out.

Maybe we should just have OF-48 reference OF-64 and close it as a duplicate since the patch for OF-64 fixes both issues?

I’ve contributed a few patches before without signing anything, but if you need me to do so I can take care of that. I’m also doing some fairly extensive performance modifications relating to concurrency and BOSH (along with updating the connection manager to support the newest BOSH version) that aren’t quite ready for integration yet. We use MUC pretty extensively (35,000 concurrent users all in MUC with ~250 users per room), and some of the performance tweaks have really helped out in that area, so I’d like to contribute them eventually.

Let me know if you need anything else from me regarding these issues!
of-55.diff.zip (538 Bytes)
of-64.diff.zip (1583 Bytes)

Awesome, thanks! I split this up into two smaller patches if that is helpful. Feel free to contact or PM me if you have any questions!

Ben,

I have elevated your Jira privs, so feel free to create / modify tickets as you see fit. Would you like to persue SVN access?

daryl

Thanks, I think SVN access would be useful as well, although I would still probably prefer to have patches get reviewed before checking them in.

I’ve just looked on your patch for OF-55 and wrote a few things which should be improved. Next, I will look on OF-48 and OF-64.

Is there an easy way to apply these patches using the non-svn version that’s currently on the downloads page? I’ve tried to run my own compiled from SVN version but it’s missing some stuff I suppose and doesn’t want to function properly.

Hi,

Not really. At some point, you’d need to compile the source code. What do you think you are missing when you compiled the code?

daryl

Not sure…

I downloaded from SVN and compiled using ANT

when I started up openfire, I had to use /extras and openfired in there instead of the one that’s just in /bin.

When running openfire, the daemon continues to run even after it’s closed and I had to kill the PIDs.

EDIT: I’m running Ubuntu 9.04.

Is there a document out there anywhere detailing how to build/run from svn? I’d like to patch some of these issues out but am having trouble running the compiled version from SVN.

I was using the guide for compiling Spark with NetBeans. Some things are different, but in general it’s the same.

I have my own memo for quick reference:

RapidSVN:
Repository > Checkout
URL http://svn.igniterealtime.org/svn/repos/openfire/trunk
Destination Directory D:\My Documents\JiveSoftware\Openfire
Add to bookmark, Recursive
OK
Close RapidSVN
Open
Double click the bookmark
button - Update selected
OK

Openfire + Netbeans (create project before creating Openfire dir - rename it temporary)
create new Java project with existing source - set folder and project name, dont press Next yet
then rename Openfire_renamed to Openfire
copy build.xml from build dir to parent
edit build.xml in parent, change basedir=“…” to basedir=“”
add after
go to Netbeans and press next
press Add folder, choose src folder, Finish
in Netbeans right-click Openfire project, choose Properties
click Libraries - Add JAR/Folder
select /Openfire/build/lib dir (Absolute path) - OK
now Clean and Build
to launch - /target/build/bin/openfire.bat

to be able to run openfire.bat need to add System variable JAVA_HOME with value C:\Program Files\Java\jdk_version (no trailing slash) (My computer > Advanced > Environment variables)
I use RapidSVN, but you can use SVN app of your choice, like TortoiseSVN. And you can also find some hints in the http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/source-b uild.html

I’ve applied a small modified version of your patch for OF-48 and OF-64 to the trunk version.