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: Changed 12 years ago by tofu

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

comment:3 in reply to: ↑ 2 Changed 8 years ago by ralphm

  • Resolution set to wontfix
  • Status changed from assigned to closed

Replying to tofu:

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

The XMPP Ping protocol was implemented in #55, released with Wokkel 0.6.2.

I don't see a use case for repeating presence from the client.

Note: See TracTickets for help on using tickets.