[core] Add moderator badge to broadcasters

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-11-09 12:54:28 +01:00
parent d75a719781
commit 7dd2640f3b
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

View file

@ -60,6 +60,15 @@ func ParseBadgeLevels(m *irc.Message) BadgeCollection {
out.Add(BadgeSubscriber, out.Get(BadgeFounder)) out.Add(BadgeSubscriber, out.Get(BadgeFounder))
} }
// In order to simplify queries and permissions add an
// implicit moderator badge to broadcasters as they have
// the same (and more) permissions than a moderator. So
// when allowing actions for moderators now broadcasters
// ill also be included.
if out.Has(BadgeBroadcaster) && !out.Has(BadgeModerator) {
out.Add(BadgeModerator, 1)
}
return out return out
} }