we now don't send online and offline show to be RFC complient
This commit is contained in:
parent
a483c7247c
commit
27869ea679
1 changed files with 12 additions and 3 deletions
|
@ -646,6 +646,9 @@ class Connection:
|
||||||
def change_status(self, show, msg):
|
def change_status(self, show, msg):
|
||||||
if not show in STATUS_LIST:
|
if not show in STATUS_LIST:
|
||||||
return -1
|
return -1
|
||||||
|
sshow = show # show to be send
|
||||||
|
if show == 'online':
|
||||||
|
sshow = None
|
||||||
signed = ''
|
signed = ''
|
||||||
keyID = gajim.config.get_per('accounts', self.name, 'keyid')
|
keyID = gajim.config.get_per('accounts', self.name, 'keyid')
|
||||||
if keyID and USE_GPG:
|
if keyID and USE_GPG:
|
||||||
|
@ -667,7 +670,7 @@ class Connection:
|
||||||
if show == 'invisible':
|
if show == 'invisible':
|
||||||
ptype = 'invisible'
|
ptype = 'invisible'
|
||||||
prio = str(gajim.config.get_per('accounts', self.name, 'priority'))
|
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:
|
if msg:
|
||||||
p.setStatus(msg)
|
p.setStatus(msg)
|
||||||
if signed:
|
if signed:
|
||||||
|
@ -698,7 +701,7 @@ class Connection:
|
||||||
if show == 'invisible':
|
if show == 'invisible':
|
||||||
ptype = 'invisible'
|
ptype = 'invisible'
|
||||||
prio = str(gajim.config.get_per('accounts', self.name, 'priority'))
|
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:
|
if msg:
|
||||||
p.setStatus(msg)
|
p.setStatus(msg)
|
||||||
if signed:
|
if signed:
|
||||||
|
@ -901,8 +904,12 @@ class Connection:
|
||||||
def join_gc(self, nick, room, server, password):
|
def join_gc(self, nick, room, server, password):
|
||||||
if not self.connection:
|
if not self.connection:
|
||||||
return
|
return
|
||||||
|
show = STATUS_LIST[self.connected]
|
||||||
|
ptype = None
|
||||||
|
if show == 'online':
|
||||||
|
show = None
|
||||||
p = common.xmpp.Presence(to = '%s@%s/%s' % (room, server, nick),
|
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')
|
t = p.setTag(common.xmpp.NS_MUC + ' x')
|
||||||
if password:
|
if password:
|
||||||
t.setTagData('password', password)
|
t.setTagData('password', password)
|
||||||
|
@ -933,6 +940,8 @@ class Connection:
|
||||||
if show == 'offline':
|
if show == 'offline':
|
||||||
ptype = 'unavailable'
|
ptype = 'unavailable'
|
||||||
show = None
|
show = None
|
||||||
|
if show == 'online':
|
||||||
|
show = None
|
||||||
self.connection.send(common.xmpp.Presence(to = '%s/%s' % (jid, nick),
|
self.connection.send(common.xmpp.Presence(to = '%s/%s' % (jid, nick),
|
||||||
typ = ptype, show = show, status = status))
|
typ = ptype, show = show, status = status))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue