XEP-0045: Add a set_subject() helper

This commit is contained in:
Emmanuel Gil Peyrot 2020-12-27 02:59:43 +01:00
parent c05cafc963
commit 1e08c90018

View file

@ -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 rooms 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."""