we don't send available presence anymore
This commit is contained in:
parent
d5a354fe50
commit
a2e8c7da6d
|
@ -233,7 +233,7 @@ class Connection:
|
||||||
if not prio:
|
if not prio:
|
||||||
prio = 0
|
prio = 0
|
||||||
ptype = prs.getType()
|
ptype = prs.getType()
|
||||||
if ptype == None: ptype = 'available'
|
if ptype == 'available': ptype = None
|
||||||
gajim.log.debug('PresenceCB : %s' % ptype)
|
gajim.log.debug('PresenceCB : %s' % ptype)
|
||||||
xtags = prs.getTags('x')
|
xtags = prs.getTags('x')
|
||||||
sigTag = None
|
sigTag = None
|
||||||
|
@ -247,7 +247,7 @@ class Connection:
|
||||||
#verify
|
#verify
|
||||||
sigmsg = sigTag.getData()
|
sigmsg = sigTag.getData()
|
||||||
keyID = self.gpg.verify(status, sigmsg)
|
keyID = self.gpg.verify(status, sigmsg)
|
||||||
if ptype == 'available':
|
if not ptype:
|
||||||
show = prs.getShow()
|
show = prs.getShow()
|
||||||
if not show:
|
if not show:
|
||||||
show = 'online'
|
show = 'online'
|
||||||
|
@ -291,7 +291,7 @@ class Connection:
|
||||||
else:
|
else:
|
||||||
self.dispatch('ERROR_ANSWER', (prs.getFrom().getStripped(), errmsg,
|
self.dispatch('ERROR_ANSWER', (prs.getFrom().getStripped(), errmsg,
|
||||||
errcode))
|
errcode))
|
||||||
if ptype == 'available' or ptype == 'unavailable':
|
if not ptype or ptype == 'unavailable':
|
||||||
gajim.logger.write('status', status, prs.getFrom().getStripped(), show)
|
gajim.logger.write('status', status, prs.getFrom().getStripped(), show)
|
||||||
self.dispatch('NOTIFY', (prs.getFrom().getStripped(), show, status,
|
self.dispatch('NOTIFY', (prs.getFrom().getStripped(), show, status,
|
||||||
prs.getFrom().getResource(), prio, keyID, prs.getRole(),
|
prs.getFrom().getResource(), prio, keyID, prs.getRole(),
|
||||||
|
@ -644,7 +644,7 @@ class Connection:
|
||||||
if self.connected == 2:
|
if self.connected == 2:
|
||||||
self.connected = STATUS_LIST.index(show)
|
self.connected = STATUS_LIST.index(show)
|
||||||
#send our presence
|
#send our presence
|
||||||
ptype = 'available'
|
ptype = None
|
||||||
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'))
|
||||||
|
@ -675,7 +675,7 @@ class Connection:
|
||||||
self.connection = None
|
self.connection = None
|
||||||
elif show != 'offline' and self.connected:
|
elif show != 'offline' and self.connected:
|
||||||
self.connected = STATUS_LIST.index(show)
|
self.connected = STATUS_LIST.index(show)
|
||||||
ptype = 'available'
|
ptype = None
|
||||||
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'))
|
||||||
|
@ -876,8 +876,6 @@ class Connection:
|
||||||
def send_agent_status(self, agent, ptype):
|
def send_agent_status(self, agent, ptype):
|
||||||
if not self.connection:
|
if not self.connection:
|
||||||
return
|
return
|
||||||
if not ptype:
|
|
||||||
ptype = 'available';
|
|
||||||
p = common.xmpp.Presence(to = agent, typ = ptype)
|
p = common.xmpp.Presence(to = agent, typ = ptype)
|
||||||
self.connection.send(p)
|
self.connection.send(p)
|
||||||
|
|
||||||
|
@ -912,11 +910,10 @@ class Connection:
|
||||||
def send_gc_status(self, nick, jid, show, status):
|
def send_gc_status(self, nick, jid, show, status):
|
||||||
if not self.connection:
|
if not self.connection:
|
||||||
return
|
return
|
||||||
|
ptype = None
|
||||||
if show == 'offline':
|
if show == 'offline':
|
||||||
ptype = 'unavailable'
|
ptype = 'unavailable'
|
||||||
show = None
|
show = None
|
||||||
else:
|
|
||||||
ptype = 'available'
|
|
||||||
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))
|
||||||
|
|
||||||
|
|
|
@ -587,7 +587,7 @@ class Roster_window:
|
||||||
if show != 'offline' and show != 'error':
|
if show != 'offline' and show != 'error':
|
||||||
item.set_sensitive(False)
|
item.set_sensitive(False)
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
item.connect('activate', self.on_agent_logging, jid, 'available', account)
|
item.connect('activate', self.on_agent_logging, jid, None, account)
|
||||||
|
|
||||||
item = gtk.MenuItem(_('Log _off'))
|
item = gtk.MenuItem(_('Log _off'))
|
||||||
if show == 'offline' or show == 'error':
|
if show == 'offline' or show == 'error':
|
||||||
|
|
Loading…
Reference in New Issue