Author: asterix Date: 2006-07-24 15:42:35 +0200 (Mon, 24 Jul 2006) New Revision: 6595
Modified: trunk/src/common/connection_handlers.py trunk/src/groupchat_control.py Log: print real jid in gc status and in logs when we know it. Fixes #1940
Modified: trunk/src/common/connection_handlers.py =================================================================== --- trunk/src/common/connection_handlers.py 2006-07-24 11:48:13 UTC (rev 6594) +++ trunk/src/common/connection_handlers.py 2006-07-24 13:42:35 UTC (rev 6595) @@ -1345,8 +1345,7 @@ 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 @@ 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]:
Modified: trunk/src/groupchat_control.py =================================================================== --- trunk/src/groupchat_control.py 2006-07-24 11:48:13 UTC (rev 6594) +++ trunk/src/groupchat_control.py 2006-07-24 13:42:35 UTC (rev 6595) @@ -902,15 +902,18 @@ 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 + ')'