summaryrefslogtreecommitdiff
path: root/src/multiuserchat.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-06-18 11:55:21 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-06-18 11:55:21 +0200
commite56b8d9853bae436ccd2845ae63c6b30fa628cad (patch)
tree2cabab2cc990670790c93a8d39892fe2bbdfbdff /src/multiuserchat.py
parent63db93c9992f41283002a7034ce610ae75736a58 (diff)
parentdd9186c72a04f449c427bce31d35a283f3c61c25 (diff)
downloadpoezio-e56b8d9853bae436ccd2845ae63c6b30fa628cad.tar.gz
poezio-e56b8d9853bae436ccd2845ae63c6b30fa628cad.tar.bz2
poezio-e56b8d9853bae436ccd2845ae63c6b30fa628cad.tar.xz
poezio-e56b8d9853bae436ccd2845ae63c6b30fa628cad.zip
Merge, j'ai rien compris
Diffstat (limited to 'src/multiuserchat.py')
-rw-r--r--src/multiuserchat.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/multiuserchat.py b/src/multiuserchat.py
index 87443e07..dd936039 100644
--- a/src/multiuserchat.py
+++ b/src/multiuserchat.py
@@ -25,6 +25,8 @@ from xml.etree import cElementTree as ET
import logging
log = logging.getLogger(__name__)
+NS_MUC_ADMIN = 'http://jabber.org/protocol/muc#admin'
+
def send_private_message(xmpp, jid, line):
"""
Send a private message
@@ -77,10 +79,10 @@ def eject_user(xmpp, jid, nick, reason):
(try to) Eject an user from the room
"""
iq = xmpp.makeIqSet()
- query = ET.Element('{http://jabber.org/protocol/muc#admin}query')
- item = ET.Element('{http://jabber.org/protocol/muc#admin}item', {'nick':nick, 'role':'none'})
+ query = ET.Element('{%s}query' % NS_MUC_ADMIN)
+ item = ET.Element('{%s}item' % NS_MUC_ADMIN, {'nick':nick, 'role':'none'})
if reason:
- reason_el = ET.Element('{http://jabber.org/protocol/muc#admin}reason')
+ reason_el = ET.Element('{%s}reason' % NS_MUC_ADMIN)
reason_el.text = reason
item.append(reason_el)
query.append(item)