SoftwareVersion Change Listener

Issue #50 new
Markus KARG created an issue

As the chat partner might switch from one device to a different, partner's software version can change from time to time, and with it, the restrictions of a device. In case a user switches e. g. from laptop to mobile phone, the chat partner might like to get informed about that, since it has the impact that for example he (as a human) SHOULD abstain from offering large pictures, or writing too wide text lines, as the mobile phone user is getting annoyed by that due to the limited bandwidth and small screen of the mobile phone.

The SoftwareVersionManager can be used to explicitly ask for the software version the chat partner is using. Unfortunately it does not offer a simple way to continuously trace a software version, like e. g. the AvatarManager provides. Hence it is a bit tricky to closely follow software version changes in an ongoing chat session.

Therefore it would be a great thing to have a SoftwareVersion Change Listener just the same way there is an Avatar Change Listener: SoftwareVersionManager.addSoftwareVersionChangeListener(Consumer<SoftwareVersionChangeEvent>). This would make it much simpler for chat applications to trace ongoing software version changes compared to the current situation where an app has to listen for resource binding and explicitly request software versions as soon as another resource is bound -- and remove current software version once no resource is bound anymore.

Comments (2)

  1. Christian Schudt repo owner

    I am afraid this is not possible from a XMPP point of view. If you read through http://xmpp.org/extensions/xep-0092.html there's no such event, which could be triggered as it is a pure polling protocol.

    Furthermore XEP-0092 is not suited for your use case, because you rarely know what a SoftwareVersion of "XYZ 2.3" really means.

    Instead I suggest to use the identity of an XMPP entity. See XEP-0030. E.g. when the presence changes, you could ask the new resource for it's identity, similar to:

    xmppSession.getManager(EntityCapabilitiesManager.class).discoverCapabilities(jid).getIdentities().contains(Identity.clientPc());
    

    ==> New resource is of category "client" and type "pc".

  2. Markus KARG reporter

    Christian, as you know, I'm looking at the API from an app vendor, not from an XMPP user. My target is to simplify app programming, not to exactly model XMPP use cases. :-)

    First, thanks a lot for the idea with Entity Capabilities, which are in fact better suited for exactly the described use case. But still this leaves open the wish for registering a listener with the EntityCapabilitiesManager then, so you just move the target of the listener. As capabilities can be sent at any time, it would be nice if an application would be informed about changed capabilities without the need to poll these. :-)

    On the other hand, I'd actually still like to keep the idea of SoftwareVersion change listener, too, as it some use cases it is actually simply pure interest of the app user to know what product another user running, whether this provides useful information or not. I mean, isn't that the driver for footers like "Sent from my iPhone"? In fact, this is what our users like to know really: "Are you using Pidging, too? -- No, I'm using AQQ!". It's kind of showing-off. :-)

    About whether this is supposeldy impossible: Actually it is possible, as my chat app already has implements this. The solution "simply" is to listen for ChatPartnerEvent and when it reports a full JID use that one to query the software version. Works pretty well, is straightforward, but simply a lot of code that should not be part of each application but part of the SoftwareVersionManager. I could move it there and send a PR, but it makes no sense if you don't like to have it.

  3. Log in to comment