Bugfix : a presence MUST have a <status> element

This commit is contained in:
Yann Leboulanger 2004-10-07 22:35:14 +00:00
parent cbbcb23ba9
commit 15029f2436
2 changed files with 6 additions and 3 deletions

View File

@ -631,6 +631,9 @@ class GajimCore:
#('STATUS', account, (status, msg)) #('STATUS', account, (status, msg))
elif ev[0] == 'STATUS': elif ev[0] == 'STATUS':
activ = 1 activ = 1
msg = ev[2][1]
if not msg:
msg = ev[2][0]
signed = '' signed = ''
keyID = '' keyID = ''
if self.cfgParser.tab[ev[1]].has_key("keyid"): if self.cfgParser.tab[ev[1]].has_key("keyid"):
@ -657,7 +660,7 @@ class GajimCore:
prio = 0 prio = 0
if self.cfgParser.tab[ev[1]].has_key('priority'): if self.cfgParser.tab[ev[1]].has_key('priority'):
prio = str(self.cfgParser.tab[ev[1]]['priority']) prio = str(self.cfgParser.tab[ev[1]]['priority'])
con.sendPresence(typ, prio, ev[2][0], ev[2][1], signed) con.sendPresence(typ, prio, ev[2][0], msg, signed)
self.hub.sendPlugin('STATUS', ev[1], ev[2][0]) self.hub.sendPlugin('STATUS', ev[1], ev[2][0])
#ask our VCard #ask our VCard
iq = common.jabber.Iq(type="get") iq = common.jabber.Iq(type="get")
@ -680,7 +683,7 @@ class GajimCore:
prio = 0 prio = 0
if self.cfgParser.tab[ev[1]].has_key('priority'): if self.cfgParser.tab[ev[1]].has_key('priority'):
prio = str(self.cfgParser.tab[ev[1]]['priority']) prio = str(self.cfgParser.tab[ev[1]]['priority'])
con.sendPresence(typ, prio, ev[2][0], ev[2][1], signed) con.sendPresence(typ, prio, ev[2][0], msg, signed)
self.hub.sendPlugin('STATUS', ev[1], ev[2][0]) self.hub.sendPlugin('STATUS', ev[1], ev[2][0])
#('MSG', account, (jid, msg, keyID)) #('MSG', account, (jid, msg, keyID))
elif ev[0] == 'MSG': elif ev[0] == 'MSG':

View File

@ -2317,7 +2317,7 @@ class plugin:
if state == common.sleepy.STATE_AWAKE and \ if state == common.sleepy.STATE_AWAKE and \
self.sleeper_state[account] > 1: self.sleeper_state[account] > 1:
#we go online #we go online
self.send('STATUS', account, ('online', '')) self.send('STATUS', account, ('online', 'Online'))
self.sleeper_state[account] = 1 self.sleeper_state[account] = 1
elif state == common.sleepy.STATE_AWAY and \ elif state == common.sleepy.STATE_AWAY and \
self.sleeper_state[account] == 1 and \ self.sleeper_state[account] == 1 and \