gco / rietveld

Automatically exported from code.google.com/p/rietveld
Apache License 2.0
0 stars 0 forks source link

Use xmpp_presence to hold messages when users are online #412

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If xmpp_presence is enabled [1], messages for a given user can be held in the 
datastore until the user comes available.

To probe for a user's status:

    from google.appengine.api import xmpp

    xmpp.send_presence(sender_jid, presence_type=xmpp.PRESENCE_TYPE_PROBE)

and implementing handlers for "/_ah/xmpp/presence/(available|unavailable)" and 
"/_ah/xmpp/presence/probe" as in [2] could be used to handle the logic around 
online/offline status and pushing out this queue of messages.

Reference:
[1]: 
https://developers.google.com/appengine/docs/python/xmpp/overview#Handling_User_
Presence
[2]: https://developers.google.com/appengine/articles/using_xmpp

Original issue reported on code.google.com by dhermes@google.com on 22 Jan 2013 at 2:37

GoogleCodeExporter commented 9 years ago
In addition I'd add a hook when an issue is closed that purges the queue for an 
issue (maybe except for the closed message itself) and/or a timeout for 
messages in this queue.

First I was a bit hesitating if I like that proposal, but OTOH it would be just 
a fair use to respect at least the PRESENCE_SHOW_DND flag.

Original comment by albrecht.andi on 24 Jan 2013 at 7:42