summaryrefslogtreecommitdiff
path: root/src/multiuserchat.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-06-20 00:26:23 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-06-20 00:26:23 +0200
commit3c120b3aa23456c0a0d2ca8c7edff2f51772ddf7 (patch)
treeb55c0b9a7c210a22080cbafe7d36e4fbcf697ea0 /src/multiuserchat.py
parent6ed46d1fe39620b776f08ce08280fac46f5929a0 (diff)
parentf4c24380466fa54924a925a12817e28d603fd4d1 (diff)
downloadpoezio-3c120b3aa23456c0a0d2ca8c7edff2f51772ddf7.tar.gz
poezio-3c120b3aa23456c0a0d2ca8c7edff2f51772ddf7.tar.bz2
poezio-3c120b3aa23456c0a0d2ca8c7edff2f51772ddf7.tar.xz
poezio-3c120b3aa23456c0a0d2ca8c7edff2f51772ddf7.zip
merge
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)