Skip to content
Snippets Groups Projects
Commit 3175c911 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

don't ask os info when we are invisible. For #1964

parent 00ee3a62
No related branches found
No related tags found
No related merge requests found
......@@ -880,6 +880,10 @@ class Connection(ConnectionHandlers):
def request_os_info(self, jid, resource):
if not self.connection:
return
# If we are invisible, do not request
if self.connected == gajim.SHOW_LIST.index('invisible'):
self.dispatch('OS_INFO', (jid, resource, _('Not fetched because of invisible status'), _('Not fetched because of invisible status')))
return
to_whom_jid = jid
if resource:
to_whom_jid += '/' + resource
......
......@@ -372,8 +372,8 @@ class VcardWindow:
# Request os info in contact is connected
if self.contact.show not in ('offline', 'error'):
gajim.connections[self.account].request_os_info(self.contact.jid,
self.contact.resource)
gobject.idle_add(gajim.connections[self.account].request_os_info,
self.contact.jid, self.contact.resource)
self.os_info = {0: {'resource': self.contact.resource, 'client': '',
'os': ''}}
i = 1
......@@ -386,7 +386,8 @@ class VcardWindow:
uf_resources += '\n' + c.resource + \
_(' resource with priority ') + unicode(c.priority)
if c.show not in ('offline', 'error'):
gajim.connections[self.account].request_os_info(c.jid,
gobject.idle_add(
gajim.connections[self.account].request_os_info, c.jid,
c.resource)
gajim.connections[self.account].request_last_status_time(c.jid,
c.resource)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment