we now don't send online and offline show to be RFC complient

This commit is contained in:
Yann Leboulanger 2005-06-04 14:27:09 +00:00
parent a483c7247c
commit 27869ea679
1 changed files with 12 additions and 3 deletions

View File

@ -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))