this commit was sponsored by mizkif
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"gosrc.io/xmpp"
|
||||
"gosrc.io/xmpp/stanza"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// This file has small functions that can be used to do XMPP stuff without writing tons of boilerplate
|
||||
@@ -116,3 +117,27 @@ func JidMustParse(s string) *stanza.Jid {
|
||||
}
|
||||
return j
|
||||
}
|
||||
|
||||
func sendVoiceRequest(c xmpp.Sender, sendTo string) error {
|
||||
err := c.SendRaw(fmt.Sprintf(`
|
||||
<message from='%s'
|
||||
id='yd53c486'
|
||||
to='%s'>
|
||||
<x xmlns='jabber:x:data' type='submit'>
|
||||
<field var='FORM_TYPE'>
|
||||
<value>http://jabber.org/protocol/muc#request</value>
|
||||
</field>
|
||||
<field var='muc#role'
|
||||
type='list-single'
|
||||
label='Requested role'>
|
||||
<value>participant</value>
|
||||
</field>
|
||||
</x>
|
||||
</message>
|
||||
`, clientroot.Session.BindJid, sendTo))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user