-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle MessageDeleteBulk event #304
Conversation
case *MessageDeleteBulk: | ||
if s.MaxMessageCount != 0 { | ||
for _, mID := range t.Messages { | ||
s.MessageRemove(&Message{ID: mID, ChannelID: t.ChannelID}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we changed MessageRemove to call messageRemoveById() this could be modified to not create a bunch of junk data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
o7
@@ -519,12 +519,12 @@ func (s *State) MessageAdd(message *Message) error { | |||
} | |||
|
|||
// MessageRemove removes a message from the world state. | |||
func (s *State) MessageRemove(message *Message) error { | |||
func (s *State) MessageRemove(channelID, messageID string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arghh sorry to be a butthole dude. But I didn't want to change the existing API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh woops i misread what you wrote, sorry
c1ede2a
to
33c36fa
Compare
} | ||
|
||
// messageRemoveById removes a message by channelID and messageID from the world state. | ||
func (s *State) messageRemoveById(channelID, messageID string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lint is complaining this should be: messageRemoveByID
* Handle MessageDeleteBulk event * Changed State.MessageRemove to use id's * Revert State.MessageRemove change and add State.messageRemoveById * Fix linting
No description provided.