Color the JID in locking/unlocking messages

This commit is contained in:
mathieui 2014-10-12 22:34:41 +02:00
parent 577d6ea87b
commit 6c62f62402
No known key found for this signature in database
GPG key ID: C59F84CEEFD616E3

View file

@ -385,11 +385,15 @@ class DynamicConversationTab(ConversationTab):
assert(resource) assert(resource)
if resource != self.locked_resource: if resource != self.locked_resource:
self.locked_resource = resource self.locked_resource = resource
info = '\x19%s}' % dump_tuple(get_theme().COLOR_INFORMATION_TEXT)
jid_c = '\x19%s}' % dump_tuple(get_theme().COLOR_MUC_JID)
message = _('\x19%s}Conversation locked to %s/%s.') % ( message = _('%(info)sConversation locked to '
dump_tuple(get_theme().COLOR_INFORMATION_TEXT), '%(jid_c)s%(jid)s/%(resource)s%(info)s.') % {
self.name, 'info': info,
resource) 'jid_c': jid_c,
'jid': self.name,
'resource': resource}
self.add_message(message, typ=0) self.add_message(message, typ=0)
self.check_features() self.check_features()
@ -405,16 +409,18 @@ class DynamicConversationTab(ConversationTab):
self.remote_wants_chatstates = None self.remote_wants_chatstates = None
if self.locked_resource != None: if self.locked_resource != None:
self.locked_resource = None self.locked_resource = None
info = '\x19%s}' % dump_tuple(get_theme().COLOR_INFORMATION_TEXT)
jid_c = '\x19%s}' % dump_tuple(get_theme().COLOR_MUC_JID)
if from_: if from_:
message = _('\x19%s}Conversation unlocked ' message = _('%(info)sConversation unlocked (received activity'
'(received activity from %s).') % ( ' from %(jid_c)s%(jid)s%(info)s).') % {
dump_tuple(get_theme().COLOR_INFORMATION_TEXT), 'info': info,
from_) 'jid_c': jid_c,
'jid': from_}
self.add_message(message, typ=0) self.add_message(message, typ=0)
else: else:
message = _('\x19%s}Conversation unlocked.') % ( message = _('%sConversation unlocked.') % info
dump_tuple(get_theme().COLOR_INFORMATION_TEXT))
self.add_message(message, typ=0) self.add_message(message, typ=0)
def get_dest_jid(self): def get_dest_jid(self):