fix: harden channel rights and sticker compatibility
Co-authored-by: HSgram <3013954224@qq.com>
This commit is contained in:
parent
6867d201ed
commit
599453a3c4
33 changed files with 1520 additions and 130 deletions
|
|
@ -50,6 +50,15 @@ func (s *ChannelStore) SetChannelMessageReactions(_ context.Context, req domain.
|
|||
if err != nil {
|
||||
return domain.ChannelMessageReactionsResult{}, err
|
||||
}
|
||||
if len(req.Reactions) > 0 {
|
||||
selfBoostsApplied := 0
|
||||
if channel.Megagroup {
|
||||
selfBoostsApplied = s.selfBoostsAppliedLocked(req.UserID, req.ChannelID, req.Date)
|
||||
}
|
||||
if domain.ChannelBannedRightsBlockReactions(channel, member, selfBoostsApplied) {
|
||||
return domain.ChannelMessageReactionsResult{}, domain.ErrChannelWriteForbidden
|
||||
}
|
||||
}
|
||||
idx, ok := s.findMessageIndexLocked(req.ChannelID, req.MessageID)
|
||||
if !ok {
|
||||
return domain.ChannelMessageReactionsResult{}, domain.ErrMessageIDInvalid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue