From e27c6d74ada2dbe81c41b991a26028a4d9436ee4 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sat, 4 Jun 2011 20:15:18 +0200 Subject: fix the display of the action 'emptying the status', and some few minor changes --- src/multiuserchat.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/multiuserchat.py') 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) -- cgit v1.2.3