mirror of
https://dev.narayana.im/narayana/telegabber.git
synced 2026-08-05 04:07:07 +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
|
||||
}
|
||||
|
||||
if !session.MUCHasResource(chatId, fromResource) {
|
||||
return
|
||||
}
|
||||
|
||||
component, ok := s.(*xmpp.Component)
|
||||
if !ok {
|
||||
log.Error("Not a component")
|
||||
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 {
|
||||
case "":
|
||||
handleMUCNicknameChange(component, p, session, chatId, toBare)
|
||||
|
|
|
|||
Loading…
Reference in a new issue