mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-11-30 10:43:30 +00:00
state: Fix decrementing reaction count (#302)
* state: fix updating reaction count in reaction remove event * move r.Me branch to if
This commit is contained in:
parent
11432e426c
commit
2d3bf2974a
|
@ -276,12 +276,14 @@ func (s *State) onEvent(iface interface{}) {
|
|||
copy(m.Reactions[0:], old[:i])
|
||||
copy(m.Reactions[i:], old[i+1:])
|
||||
|
||||
case r.Me: // If reaction removal is the user's
|
||||
u, err := s.Cabinet.Me()
|
||||
if err == nil && ev.UserID == u.ID {
|
||||
r.Me = false
|
||||
}
|
||||
default:
|
||||
r.Count--
|
||||
if r.Me { // If reaction removal is the user's
|
||||
u, err := s.Cabinet.Me()
|
||||
if err == nil && ev.UserID == u.ID {
|
||||
r.Me = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
|
|
Loading…
Reference in a new issue