Commit 889cfaa9 authored by Link Mauve's avatar Link Mauve

XEP-0045: Add a helper method to request voice

This can be used in a moderated room when we are only a visitor.
parent b7f0160c
......@@ -591,6 +591,19 @@ class XEP_0045(BasePlugin):
msg['muc']['decline']['reason'] = reason
def request_voice(self, room: JID, role: str, *, mfrom: Optional[JID] = None):
"""Request voice in a moderated room.
:param room: Room to request voice from.
#form = self.xmpp['xep_0004'].make_form(ftype='submit')
msg = self.xmpp.make_message(room, mfrom=mfrom)
form = msg['form']
form['type'] = 'submit'
form.add_field(var='FORM_TYPE', ftype='hidden', value='')
form.add_field(var='muc#role', ftype='list-single', label='Requested role', value=role)
def jid_in_room(self, room: JID, jid: JID) -> bool:
"""Check if a JID is present in a room.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment