diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index a06cec09a..57a74f7b1 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -1345,8 +1345,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco) if not self.last_history_line.has_key(jid): return self.dispatch('GC_MSG', (frm, msgtxt, tim)) - if self.name not in no_log_for and jid in self.last_history_line \ - and not int(float(time.mktime(tim))) <= \ + if self.name not in no_log_for and not int(float(time.mktime(tim))) <= \ self.last_history_line[jid] and msgtxt: gajim.logger.write('gc_msg', frm, msgtxt, tim = tim) elif mtype == 'chat': # it's type 'chat' @@ -1478,7 +1477,16 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco) if not ptype or ptype == 'unavailable': if gajim.config.get('log_contact_status_changes') and self.name\ not in no_log_for and jid_stripped not in no_log_for: - gajim.logger.write('gcstatus', who, status, show) + gc_c = gajim.contacts.get_gc_contact(self.name, jid_stripped, resource) + st = status or '' + if gc_c: + jid = gc_c.jid + else: + jid = prs.getJid() + if jid: + # we know real jid, save it in db + st += ' (%s)' % jid + gajim.logger.write('gcstatus', who, st, show) if avatar_sha: if self.vcard_shas.has_key(who): if avatar_sha != self.vcard_shas[who]: diff --git a/src/groupchat_control.py b/src/groupchat_control.py index f341d217b..4b599765e 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -902,15 +902,18 @@ class GroupchatControl(ChatControlBase): break if print_status is None: print_status = gajim.config.get('print_status_in_muc') + nick_jid = nick + if jid: + nick_jid += ' (%s)' % jid if show == 'offline' and print_status in ('all', 'in_and_out'): - st = _('%s has left') % nick + st = _('%s has left') % nick_jid if reason: st += ' [%s]' % reason else: if newly_created and print_status in ('all', 'in_and_out'): - st = _('%s has joined the room') % nick + st = _('%s has joined the room') % nick_jid elif print_status == 'all': - st = _('%s is now %s') % (nick, helpers.get_uf_show(show)) + st = _('%s is now %s') % (nick_jid, helpers.get_uf_show(show)) if st: if status: st += ' (' + status + ')'