mirror of
https://dev.narayana.im/narayana/telegabber.git
synced 2026-08-05 04:07:07 +00:00
Setting both role and affiliation should yield bad-request
This commit is contained in:
parent
6d24823bb3
commit
de74787a48
1 changed files with 5 additions and 1 deletions
|
|
@ -1813,6 +1813,11 @@ func handleSetQueryMucAdmin(s xmpp.Sender, iq *stanza.IQ, query *extensions.Quer
|
|||
|
||||
var status telegram.ChatMemberStatus
|
||||
|
||||
if item.Role != "" && item.Affiliation != "" {
|
||||
iqAnswerSetError(answer, 400)
|
||||
return
|
||||
}
|
||||
|
||||
switch item.Role {
|
||||
case "none":
|
||||
status = telegram.ChatMemberStatusKicked
|
||||
|
|
@ -1823,7 +1828,6 @@ func handleSetQueryMucAdmin(s xmpp.Sender, iq *stanza.IQ, query *extensions.Quer
|
|||
case "moderator":
|
||||
status = telegram.ChatMemberStatusPromoted
|
||||
}
|
||||
// affiliations have a higher priority over roles
|
||||
switch item.Affiliation {
|
||||
case "none":
|
||||
status = telegram.ChatMemberStatusKicked
|
||||
|
|
|
|||
Loading…
Reference in a new issue