mirror of
https://dev.narayana.im/narayana/telegabber.git
synced 2026-08-05 12:17:06 +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
|
var status telegram.ChatMemberStatus
|
||||||
|
|
||||||
|
if item.Role != "" && item.Affiliation != "" {
|
||||||
|
iqAnswerSetError(answer, 400)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
switch item.Role {
|
switch item.Role {
|
||||||
case "none":
|
case "none":
|
||||||
status = telegram.ChatMemberStatusKicked
|
status = telegram.ChatMemberStatusKicked
|
||||||
|
|
@ -1823,7 +1828,6 @@ func handleSetQueryMucAdmin(s xmpp.Sender, iq *stanza.IQ, query *extensions.Quer
|
||||||
case "moderator":
|
case "moderator":
|
||||||
status = telegram.ChatMemberStatusPromoted
|
status = telegram.ChatMemberStatusPromoted
|
||||||
}
|
}
|
||||||
// affiliations have a higher priority over roles
|
|
||||||
switch item.Affiliation {
|
switch item.Affiliation {
|
||||||
case "none":
|
case "none":
|
||||||
status = telegram.ChatMemberStatusKicked
|
status = telegram.ChatMemberStatusKicked
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue