summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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):
"""