summaryrefslogtreecommitdiff
path: root/poezio/multiuserchat.py
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2020-12-27 01:37:35 +0100
committerLink Mauve <linkmauve@linkmauve.fr>2020-12-28 19:10:53 +0100
commit85b122222253361a933d5d45e92fa14afc90a93c (patch)
tree03692c7faec04e42380b3e4132eaaaba4b56a310 /poezio/multiuserchat.py
parent826fa779c431033549545b0a8c0240c60fd712f4 (diff)
downloadpoezio-85b122222253361a933d5d45e92fa14afc90a93c.tar.gz
poezio-85b122222253361a933d5d45e92fa14afc90a93c.tar.bz2
poezio-85b122222253361a933d5d45e92fa14afc90a93c.tar.xz
poezio-85b122222253361a933d5d45e92fa14afc90a93c.zip
Add (back?) reason and altroom arguments for /destroy_room.
Also make use of slixmpp’s new destroy_room() function.
Diffstat (limited to 'poezio/multiuserchat.py')
-rw-r--r--poezio/multiuserchat.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/poezio/multiuserchat.py b/poezio/multiuserchat.py
index 71b5cceb..d7029adf 100644
--- a/poezio/multiuserchat.py
+++ b/poezio/multiuserchat.py
@@ -39,41 +39,6 @@ NS_MUC_ADMIN = 'http://jabber.org/protocol/muc#admin'
NS_MUC_OWNER = 'http://jabber.org/protocol/muc#owner'
-def destroy_room(
- xmpp: ClientXMPP,
- room: str,
- reason: str = '',
- altroom: str = ''
-) -> bool:
- """
- destroy a room
- """
- room = safeJID(room)
- if not room:
- return False
- iq = xmpp.make_iq_set()
- iq['to'] = room
- query = ET.Element('{%s}query' % NS_MUC_OWNER)
- destroy = ET.Element('{%s}destroy' % NS_MUC_OWNER)
- if altroom:
- destroy.attrib['jid'] = altroom
- if reason:
- xreason = ET.Element('{%s}reason' % NS_MUC_OWNER)
- xreason.text = reason
- destroy.append(xreason)
- query.append(destroy)
- iq.append(query)
-
- def callback(iq: Iq) -> None:
- if not iq or iq['type'] == 'error':
- xmpp.core.information('Unable to destroy room %s' % room, 'Info')
- else:
- xmpp.core.information('Room %s destroyed' % room, 'Info')
-
- iq.send(callback=callback)
- return True
-
-
def change_show(
xmpp: ClientXMPP,
jid: JID,