summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-05-09 13:13:11 +0200
committerFlorent Le Coz <louiz@louiz.org>2013-05-09 13:18:44 +0200
commit53170fd4f298e09ee737154733f65e0280db3f2b (patch)
treee62724495f224ddd937157b4a88104d6edc0b13f /src
parent38af82501c05f007464f2c73f44446c1dea7e127 (diff)
downloadpoezio-53170fd4f298e09ee737154733f65e0280db3f2b.tar.gz
poezio-53170fd4f298e09ee737154733f65e0280db3f2b.tar.bz2
poezio-53170fd4f298e09ee737154733f65e0280db3f2b.tar.xz
poezio-53170fd4f298e09ee737154733f65e0280db3f2b.zip
Add the 'changing_nick' event
Diffstat (limited to 'src')
-rw-r--r--src/events.py1
-rw-r--r--src/multiuserchat.py7
-rw-r--r--src/tabs.py2
3 files changed, 7 insertions, 3 deletions
diff --git a/src/events.py b/src/events.py
index f90624a6..71687d14 100644
--- a/src/events.py
+++ b/src/events.py
@@ -39,6 +39,7 @@ class EventHandler(object):
'muc_presence': [],
'muc_join': [],
'joining_muc': [],
+ 'changing_nick': [],
'muc_kick': [],
'muc_nickchange': [],
'muc_ban': [],
diff --git a/src/multiuserchat.py b/src/multiuserchat.py
index 7aefae28..386da341 100644
--- a/src/multiuserchat.py
+++ b/src/multiuserchat.py
@@ -55,11 +55,14 @@ def change_subject(xmpp, jid, subject):
msg['subject'] = subject
msg.send()
-def change_nick(xmpp, jid, nick, status=None, show=None):
+def change_nick(core, jid, nick, status=None, show=None):
"""
Change our own nick in a room
"""
- xmpp.make_presence(pshow=show, pstatus=status, pto=safeJID('%s/%s' % (jid, nick))).send()
+ xmpp = core.xmpp
+ presence = xmpp.make_presence(pshow=show, pstatus=status, pto=safeJID('%s/%s' % (jid, nick)))
+ core.events.trigger('changing_nick', presence)
+ presence.send()
def join_groupchat(core, jid, nick, passwd='', maxhistory=None, status=None, show=None, seconds=0):
xmpp = core.xmpp
diff --git a/src/tabs.py b/src/tabs.py
index 72b78d83..e927a0c7 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -1015,7 +1015,7 @@ class MucTab(ChatTab):
current_status = self.core.get_status()
if not safeJID(self.get_name() + '/' + nick):
return self.core.information('Invalid nick', 'Info')
- muc.change_nick(self.core.xmpp, self.name, nick, current_status.message, current_status.show)
+ muc.change_nick(self.core, self.name, nick, current_status.message, current_status.show)
def command_part(self, arg):
"""