mirror of
https://dev.narayana.im/narayana/telegabber.git
synced 2026-08-05 12:17:06 +00:00
Return bad-request for disco attempts on MUC occupants
This commit is contained in:
parent
541acdf372
commit
06645eaa8c
1 changed files with 17 additions and 1 deletions
|
|
@ -916,6 +916,14 @@ func handleGetDiscoInfo(s xmpp.Sender, iq *stanza.IQ, di *stanza.DiscoInfo) {
|
|||
answer.Payload = disco
|
||||
toID, toOk, toIsGroup := toToID(iq.To)
|
||||
|
||||
if toIsGroup {
|
||||
toJid, err := stanza.NewJid(iq.To)
|
||||
if err == nil && toJid.Resource != "" {
|
||||
iqAnswerSetError(answer, 400)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if di.Node == "" {
|
||||
var isMuc bool
|
||||
bare, _, fromOk := gateway.SplitJID(iq.From)
|
||||
|
|
@ -1033,7 +1041,15 @@ func handleGetDiscoItems(s xmpp.Sender, iq *stanza.IQ, di *stanza.DiscoItems) {
|
|||
|
||||
log.Debugf("discoItems: %#v", di)
|
||||
|
||||
toID, toOk, _ := toToID(iq.To)
|
||||
toID, toOk, toIsGroup := toToID(iq.To)
|
||||
|
||||
if toIsGroup {
|
||||
toJid, err := stanza.NewJid(iq.To)
|
||||
if err == nil && toJid.Resource != "" {
|
||||
iqAnswerSetError(answer, 400)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
disco := answer.DiscoItems()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue