Opened 13 years ago
Closed 8 years ago
#11 closed defect (wontfix)
Periodical presence updates
Reported by: | aes | Owned by: | aes |
---|---|---|---|
Priority: | lowest | Milestone: | |
Component: | generic | Keywords: | presence compatibiliy |
Cc: |
Description
This is somewhat nebulous in documentation, but at least [ejabberd http://www.ejabberd.im/] seems to require periodical poking. The cautious approach would seem to be to assume that periodical updates are appropriate.
from twisted.internet.task import LoopingCall from wokkel import xmppim class AwakePresence(xmppim.PresenceClientProtocol): def connectionMade(self): self.ticker = LoopingCall(self.tick) self.ticker.start(60) def tick(self): if self.xmlstream: self.available()
Note that this always says it is available. Presence state is actually complex, which is silly, but it should be possible to accomodate it.
Taking the opportunity to record peer presences seen would also seem logical:
class RecordingPresence(xmppim.PresenceClientProtocol): def connectionMade(self): self.stati = {} def availableReceived(self, ent, show, status, prio=0): self.stati[ent] = (ent, show, status, prio) def unavailableReceived(self, ent, status): self.stati[ent] = (ent, show, status, prio)
More should probably be done to be able to answer questions like "what is the highest priority resource for <jid>?".
Now that I think about it, I think I can do better than this. I'll assign this to myself.
Change History (3)
comment:1 Changed 13 years ago by aes
- Status changed from new to assigned
comment:2 follow-up: ↓ 3 Changed 12 years ago by tofu
comment:3 in reply to: ↑ 2 Changed 8 years ago by ralphm
- Resolution set to wontfix
- Status changed from assigned to closed
Presence is not necessary. You can send blank data. You can also do ping. I think implementing ping is the best way.
http://xmpp.org/extensions/xep-0199.html