diff options
author | mathieui <mathieui@mathieui.net> | 2018-12-16 19:08:05 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2018-12-16 19:08:05 +0100 |
commit | f034f7d0000560711070053e7e0d51193e61d12c (patch) | |
tree | 46aca5d7e802154be61c4ad6795e5da9863fedca /poezio/core/handlers.py | |
parent | 8a23706b72a0f19405581e20c132fb442a960250 (diff) | |
parent | d619e0c5ff9c896c0eb35b24cb28f79b150595fe (diff) | |
download | poezio-f034f7d0000560711070053e7e0d51193e61d12c.tar.gz poezio-f034f7d0000560711070053e7e0d51193e61d12c.tar.bz2 poezio-f034f7d0000560711070053e7e0d51193e61d12c.tar.xz poezio-f034f7d0000560711070053e7e0d51193e61d12c.zip |
Merge branch 'master' into 'master'
self-ping: do not /cycle on timeout, log only
See merge request poezio/poezio!16
Diffstat (limited to 'poezio/core/handlers.py')
-rw-r--r-- | poezio/core/handlers.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py index b87e7307..0a6e7e50 100644 --- a/poezio/core/handlers.py +++ b/poezio/core/handlers.py @@ -1068,7 +1068,8 @@ class HandlerCore: '{http://jabber.org/protocol/muc#user}x') is not None: return jid = presence['from'] - if not logger.log_roster_change(jid.bare, 'got offline'): + status = presence['status'] + if not logger.log_roster_change(jid.bare, 'got offline{}'.format(' ({})'.format(status) if status else '')): self.core.information('Unable to write in the log file', 'Error') # If a resource got offline, display the message in the conversation with this # precise resource. @@ -1078,12 +1079,15 @@ class HandlerCore: roster.connected -= 1 if contact.name: name = contact.name + offline_msg = '%s is \x191}offline' % name + if status: + offline_msg += ' (\x19o%s\x191})' % status if jid.resource: self.core.add_information_message_to_conversation_tab( - jid.full, '\x195}%s is \x191}offline' % name) + jid.full, '\x195}' + offline_msg) self.core.add_information_message_to_conversation_tab( - jid.bare, '\x195}%s is \x191}offline' % name) - self.core.information('\x193}%s \x195}is \x191}offline' % name, + jid.bare, '\x195}' + offline_msg) + self.core.information('\x193}' + offline_msg, 'Roster') roster.modified() if isinstance(self.core.tabs.current_tab, tabs.RosterInfoTab): |