From 1e08c900185dec05111fb9f158497c8b3ff634d3 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 27 Dec 2020 02:59:43 +0100 Subject: XEP-0045: Add a set_subject() helper --- slixmpp/plugins/xep_0045/muc.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/slixmpp/plugins/xep_0045/muc.py b/slixmpp/plugins/xep_0045/muc.py index aa1ed9e9..4220978d 100644 --- a/slixmpp/plugins/xep_0045/muc.py +++ b/slixmpp/plugins/xep_0045/muc.py @@ -229,6 +229,13 @@ class XEP_0045(BasePlugin): self.rooms[room] = {} self.our_nicks[room] = nick + def set_subject(self, room: JID, subject: str, *, mfrom: Optional[JID] = None): + """Set a room’s subject.""" + msg = self.xmpp.make_message(room, mfrom=mfrom) + msg['type'] = 'groupchat' + msg['subject'] = subject + msg.send() + async def destroy(self, room: JID, reason='', altroom='', *, ifrom: Optional[JID] = None, **iqkwargs): """Destroy a room.""" -- cgit v1.2.3