From d2d04162146e6df454d67a4e48ee6655af1d6c0a Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 11 Mar 2013 17:54:29 +0100 Subject: Fix #1841 (User nickname) - add a use_pep_nick boolean option - use it as a nickname for roster contacts, but it does not supercede the user-defined handle - send a at the beginning of a normal chat - not implemented in MUC (wontfix) --- src/tabs.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/tabs.py') diff --git a/src/tabs.py b/src/tabs.py index b0ad9569..3805a690 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -2679,7 +2679,7 @@ class RosterInfoTab(Tab): self.core.xmpp.send_presence(pto=jid, ptype='subscribed') self.core.xmpp.client_roster.send_last_presence() if contact.subscription in ('from', 'none') and not contact.pending_out: - self.core.xmpp.send_presence(pto=jid, ptype='subscribe') + self.core.xmpp.send_presence(pto=jid, ptype='subscribe', pnick=self.core.own_nick) def refresh(self): if self.need_resize: @@ -2938,6 +2938,8 @@ class ConversationTab(ChatTab): message_type = 'chat' def __init__(self, jid): ChatTab.__init__(self, jid) + self.nick = None + self.nick_sent = False self.state = 'normal' self.name = jid # a conversation tab is linked to one specific full jid OR bare jid self.text_win = windows.TextWin() @@ -2988,6 +2990,9 @@ class ConversationTab(ChatTab): msg = self.core.xmpp.make_message(self.get_dest_jid()) msg['type'] = 'chat' msg['body'] = line + if not self.nick_sent: + msg['nick'] = self.core.own_nick + self.nick_sent = True # trigger the event BEFORE looking for colors. # and before displaying the message in the window # This lets a plugin insert \x19xxx} colors, that will @@ -3143,6 +3148,8 @@ class ConversationTab(ChatTab): if contact: return contact.name or jid.user else: + if self.nick: + return self.nick return jid.user def on_input(self, key, raw): -- cgit v1.2.3