summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-03-11 17:54:29 +0100
committermathieui <mathieui@mathieui.net>2013-03-11 17:54:29 +0100
commitd2d04162146e6df454d67a4e48ee6655af1d6c0a (patch)
treef0b132de550c62dfe4ac9fb59234ea14ecd1874a /src/tabs.py
parent34af8f69c7aff2d02a10fab954ae7ddf15cee193 (diff)
downloadpoezio-d2d04162146e6df454d67a4e48ee6655af1d6c0a.tar.gz
poezio-d2d04162146e6df454d67a4e48ee6655af1d6c0a.tar.bz2
poezio-d2d04162146e6df454d67a4e48ee6655af1d6c0a.tar.xz
poezio-d2d04162146e6df454d67a4e48ee6655af1d6c0a.zip
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 <nick/> at the beginning of a normal chat - not implemented in MUC (wontfix)
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py9
1 files changed, 8 insertions, 1 deletions
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):