mirror of
https://dev.narayana.im/narayana/telegabber.git
synced 2026-08-05 12:17:06 +00:00
Reject groupchat 1.0 join attempts
This commit is contained in:
parent
d5c1d6ff2a
commit
ab9d041cef
1 changed files with 14 additions and 4 deletions
|
|
@ -657,16 +657,26 @@ func tryHandleMUCPresence(s xmpp.Sender, p stanza.Presence) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !session.MUCHasResource(chatId, fromResource) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
component, ok := s.(*xmpp.Component)
|
component, ok := s.(*xmpp.Component)
|
||||||
if !ok {
|
if !ok {
|
||||||
log.Error("Not a component")
|
log.Error("Not a component")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !session.MUCHasResource(chatId, fromResource) {
|
||||||
|
// groupchat 1.0 join
|
||||||
|
gateway.SendPresence(
|
||||||
|
component,
|
||||||
|
p.From,
|
||||||
|
gateway.SPFullFrom(p.To),
|
||||||
|
gateway.SPType("unavailable"),
|
||||||
|
gateway.SPMUCAffiliation("none"),
|
||||||
|
gateway.SPMUCRole("none"),
|
||||||
|
gateway.SPMUCStatusCodes([]uint16{110, 307, 333}),
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
switch p.Type {
|
switch p.Type {
|
||||||
case "":
|
case "":
|
||||||
handleMUCNicknameChange(component, p, session, chatId, toBare)
|
handleMUCNicknameChange(component, p, session, chatId, toBare)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue