From 27869ea6791375937fa45a0e47bb2ba09a88e8ff Mon Sep 17 00:00:00 2001 From: Yann Leboulanger <asterix@lagaule.org> Date: Sat, 4 Jun 2005 14:27:09 +0000 Subject: [PATCH] we now don't send online and offline show to be RFC complient --- src/common/connection.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 8e975a8346..6dd7bd664d 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -646,6 +646,9 @@ class Connection: def change_status(self, show, msg): if not show in STATUS_LIST: return -1 + sshow = show # show to be send + if show == 'online': + sshow = None signed = '' keyID = gajim.config.get_per('accounts', self.name, 'keyid') if keyID and USE_GPG: @@ -667,7 +670,7 @@ class Connection: if show == 'invisible': ptype = 'invisible' prio = str(gajim.config.get_per('accounts', self.name, 'priority')) - p = common.xmpp.Presence(typ = ptype, priority = prio, show = show) + p = common.xmpp.Presence(typ = ptype, priority = prio, show = sshow) if msg: p.setStatus(msg) if signed: @@ -698,7 +701,7 @@ class Connection: if show == 'invisible': ptype = 'invisible' prio = str(gajim.config.get_per('accounts', self.name, 'priority')) - p = common.xmpp.Presence(typ = ptype, priority = prio, show = show) + p = common.xmpp.Presence(typ = ptype, priority = prio, show = sshow) if msg: p.setStatus(msg) if signed: @@ -901,8 +904,12 @@ class Connection: def join_gc(self, nick, room, server, password): if not self.connection: return + show = STATUS_LIST[self.connected] + ptype = None + if show == 'online': + show = None p = common.xmpp.Presence(to = '%s@%s/%s' % (room, server, nick), - show = STATUS_LIST[self.connected], status = self.status) + show = show, status = self.status) t = p.setTag(common.xmpp.NS_MUC + ' x') if password: t.setTagData('password', password) @@ -933,6 +940,8 @@ class Connection: if show == 'offline': ptype = 'unavailable' show = None + if show == 'online': + show = None self.connection.send(common.xmpp.Presence(to = '%s/%s' % (jid, nick), typ = ptype, show = show, status = status)) -- GitLab