summaryrefslogtreecommitdiff
path: root/src/multiuserchat.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-01-29 16:24:44 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-01-29 16:24:44 +0000
commit33cf82e0947be35bf4e4666d0db632b60e5c27f9 (patch)
tree5924de25ac5278e0c072e8a1511995be5bde87d6 /src/multiuserchat.py
parentba8d1803f41b776a1e761a7f8ece44f50c480e4c (diff)
downloadpoezio-33cf82e0947be35bf4e4666d0db632b60e5c27f9.tar.gz
poezio-33cf82e0947be35bf4e4666d0db632b60e5c27f9.tar.bz2
poezio-33cf82e0947be35bf4e4666d0db632b60e5c27f9.tar.xz
poezio-33cf82e0947be35bf4e4666d0db632b60e5c27f9.zip
gestion de la RECEPTION des kicks
Diffstat (limited to 'src/multiuserchat.py')
-rw-r--r--src/multiuserchat.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/multiuserchat.py b/src/multiuserchat.py
index 0d50b51d..5f5a1ffd 100644
--- a/src/multiuserchat.py
+++ b/src/multiuserchat.py
@@ -17,7 +17,7 @@
# Implementation of the XEP-0045: Multi-User Chat.
-from xmpp import NS_MUC_ADMIN
+from xmpp import NS_MUC_ADMIN, NS_MUC
from xmpp.protocol import Presence, Iq, Message, JID
from handler import Handler
@@ -41,11 +41,14 @@ class MultiUserChat(object):
self.rooms = []
self.rn = {}
+ self.own_jid = None
+
self.handler = Handler()
self.handler.connect('join-room', self.join_room)
self.handler.connect('on-connected', self.on_connected)
- def on_connected(self):
+ def on_connected(self, jid):
+ self.own_jid = jid
rooms = config.get('rooms', '')
if rooms == '':
return
@@ -67,6 +70,9 @@ class MultiUserChat(object):
self.rn[room] = nick
pres = Presence(to='%s/%s' % (room, nick))
+ pres.setFrom('%s'%self.own_jid)
+ pres.addChild(name='x', namespace=NS_MUC)
+ open('fion', 'w').write(str(pres))
self.connection.send(pres)
def quit_room(self, room, nick):