diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2020-12-27 02:42:49 +0100 |
---|---|---|
committer | Link Mauve <linkmauve@linkmauve.fr> | 2020-12-28 19:10:53 +0100 |
commit | c38538f6b52fa8a3ff0a023559235fcc49135201 (patch) | |
tree | febddcfe623d5dd4de9aabf25b2a799b8eade20c /poezio/multiuserchat.py | |
parent | 4b0e481902084970e89eafd23acd535b0e6187bc (diff) | |
download | poezio-c38538f6b52fa8a3ff0a023559235fcc49135201.tar.gz poezio-c38538f6b52fa8a3ff0a023559235fcc49135201.tar.bz2 poezio-c38538f6b52fa8a3ff0a023559235fcc49135201.tar.xz poezio-c38538f6b52fa8a3ff0a023559235fcc49135201.zip |
Rework set_role() to use slixmpp.
Also remove a safeJID().
Diffstat (limited to 'poezio/multiuserchat.py')
-rw-r--r-- | poezio/multiuserchat.py | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/poezio/multiuserchat.py b/poezio/multiuserchat.py index 9cd94fa8..778e9f3f 100644 --- a/poezio/multiuserchat.py +++ b/poezio/multiuserchat.py @@ -14,7 +14,6 @@ from __future__ import annotations from xml.etree import ElementTree as ET from typing import ( - Callable, Optional, TYPE_CHECKING, ) @@ -35,10 +34,6 @@ if TYPE_CHECKING: from poezio.tabs import Tab -NS_MUC_ADMIN = 'http://jabber.org/protocol/muc#admin' -NS_MUC_OWNER = 'http://jabber.org/protocol/muc#owner' - - def change_show( xmpp: ClientXMPP, jid: JID, @@ -143,29 +138,3 @@ def leave_groupchat( "muc.leave_groupchat: could not leave the room %s", jid, exc_info=True) - - -def set_user_role( - xmpp: ClientXMPP, - jid: JID, - nick: str, - reason: str, - role: str, - callback: Callable[[Iq], None] -) -> None: - """ - (try to) Set the role of a MUC user - (role = 'none': eject user) - """ - jid = safeJID(jid) - iq = xmpp.make_iq_set() - query = ET.Element('{%s}query' % NS_MUC_ADMIN) - item = ET.Element('{%s}item' % NS_MUC_ADMIN, {'nick': nick, 'role': role}) - if reason: - reason_el = ET.Element('{%s}reason' % NS_MUC_ADMIN) - reason_el.text = reason - item.append(reason_el) - query.append(item) - iq.append(query) - iq['to'] = jid - iq.send(callback=callback) |