On Mi, 2015-03-04 at 22:23 +0100, Christian Ulrich wrote: > So I'm proposing the following: > A user MAY include a device id in the enable stanza. If he does so, the > XMPP server MUST distinguish between devices by the combination of full > jid and device id when updating the list of enabled devices. If the user > does not include a device id the XMPP server MUST distinguish only by > the full jid. > > This means, if a user enabled push for full jid A with multiple device > ids and then sends an disable (or enable) stanza for A *without* device > id, all entries of A are deleted from the list of enabled devices (and a > new entry without device is added in case of the enable stanza).
I'm replying to myself because my proposal wasn't very wise. Of course multiple devices with the same resource must not be enabled at the same time (they would wake up at the same time and there would be a race condition). They may be registered at the app server at the same time, so there a device id would be necessary to meet your two requirements, but registration is not defined in the XEP (I'll keep in in mind for my implementation though). So I think using the node name as a device identifier (or more precicely: an identifier for entities that want to receive the same push notifications and are thus registered for the same node) is sufficient for the xmpp server. When a client sends an enable stanza the server updates an existing record for the client's full jid with the stanza's new 'node' value. That's actually already described in the XEP. One of your requirements is still not met: you have to know the resource to enable / disable push. So what if my phone gets stolen and I want disable push notifications for it? I could log in from another device using the same full jid. But you also mentioned random strings as resources... If there was a mechanism to retrieve all enabled devices from the server and we could enable / disable push for all of them, this would completely bypass the server's routing mechanism, I don't like that. I do want to have a possibility to set the "active device" (the most available device where I want to be reachable) without touching other online devices, but why treat push devices in a special way? I think this is what presence priorities are for. How exactly this "setting active" can work with push, I don't know yet though. As I said earlier, I think the push module must check if arriving stanzas are addressed to a push-enabled device that's currently offline but *would be* the most available resource if it was still online. That's also bypassing the server's routing but in a more gentle way. One solution to the stolen phone problem would be an emergency-off switch (disable all resources of the user on all nodes): <iq type='set' id='x97'> <disable-all xmlns='urn:xmpp:push:0' jid='push-5.client.example' /> </iq>
