diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2020-12-27 02:59:43 +0100 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2020-12-27 02:59:43 +0100 |
commit | 1e08c900185dec05111fb9f158497c8b3ff634d3 (patch) | |
tree | 4dbfaf6c253bec504e636f706d7f6777efdcc326 | |
parent | c05cafc9637854d21c1a7d6709c69f7e8dd1497a (diff) | |
download | slixmpp-1e08c900185dec05111fb9f158497c8b3ff634d3.tar.gz slixmpp-1e08c900185dec05111fb9f158497c8b3ff634d3.tar.bz2 slixmpp-1e08c900185dec05111fb9f158497c8b3ff634d3.tar.xz slixmpp-1e08c900185dec05111fb9f158497c8b3ff634d3.zip |
XEP-0045: Add a set_subject() helper
-rw-r--r-- | slixmpp/plugins/xep_0045/muc.py | 7 |
1 files changed, 7 insertions, 0 deletions
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.""" |