Between Desktop client and mobile XMPP client, which takes precedence?

I am running latest builds of OpenFire and SparkIM. I am running Spark IM on my MacBook and I’m running IM+ (Jabber / XMPP compatible client) on my iPhone. My question is thus: when I’m logged into both my desktop and mobile phone, which device would receive an inbound message from another user? I’ve experiemented and it seems that whichever client has had the most recent activity is the one continues to recieve future IM’s? I am looking for an better explanation of how this behavior is supposed to work?

There is a ‘priority’ associated with each client connected. Client with the highest priority takes precedence. Not all clients expose this priority, but you can look at the session list in Openfire to get priority of a connected client.

I have my desktop client set at 10 for available and 0 for away, then my mobile client set to 5.

So the big question would be how to I change priority of Spark IM client.

In addition to this, the behaviour is left to the server to figure out when both have the same priority.

Alternatively, you can configure the server to deliver to all clients (different resources) with the same priority as well (set route.all-resources to true), it just isn’t the default behaviour.

So is this set in server manager > System properties ? Once entered do I need to restart OpenFire for it to become active?

Yes, and a restart will be necessary.

Ok, for all those other poor souls out there trying to figure out how to do this. This is the process

OpenFire assigns all connections with a default priorty of 1. Each device is considered a connection (i.e. computer, phone, tablet, etc…) Priority status determines where an IM is delivered. So if you have a desktop client with a priority of 10 and a mobile device with a priority of 5 then the desktop would recieve the message and the phone would not. There is not an easy way to change priorities in the OpenFire server gui for a specific conneciton. The trick is to change it on the client side by creating a custom status message in the Spark IM client itself.

Given this scenario:

Spark IM on my laptop (running and logged in). I create a custom status message of “online - laptop” with a priority of 10. On my phone I use my jabber / XMPP client and set it’s priority to 5. In this case desktop wins. You can always go back and change it on either device. This works great. I would love to be able to set the desktop client to a default status so I don’t have to manually set my custom status but it looks like that’s not possible as of this version.

You can also as @@rcollier indicates set the server to deliver IM traffic to all connected devices. It’s just a standard configuration out of the box. To do so go to Server manager > System Properties.

Create a new system property called “route-all-resources” and set it’s value to **TRUE. **

You will then need to restart the OpenFire chat server.

Hope this helps everyone else!

1 Like

Just out of curiosity: What does it take to make route.all-resources really work? Basically I want to achieve something similar to your setup (multiple clients and message syncing howto? ) and see that, after days of playing with different XMPP clients and priorities, at least by now it works to have messages routed to the “right” device but still it would be considerable to have all messages on all devices in order to have all the information at hand, but routing all messages to all resources doesn’t seem to work so far…

TIA and all the best,

Kristian