parent
3ef21897fd
commit
4a2c5d089a
|
@ -439,6 +439,8 @@ method toggleReaction*(self: Module, messageId: string, emojiId: int) =
|
||||||
var emojiIdAsEnum: EmojiId
|
var emojiIdAsEnum: EmojiId
|
||||||
if(message_reaction_item.toEmojiIdAsEnum(emojiId, emojiIdAsEnum)):
|
if(message_reaction_item.toEmojiIdAsEnum(emojiId, emojiIdAsEnum)):
|
||||||
let item = self.view.model().getItemWithMessageId(messageId)
|
let item = self.view.model().getItemWithMessageId(messageId)
|
||||||
|
if(item.isNil):
|
||||||
|
return
|
||||||
let myPublicKey = singletonInstance.userProfile.getPubKey()
|
let myPublicKey = singletonInstance.userProfile.getPubKey()
|
||||||
if(item.shouldAddReaction(emojiIdAsEnum, myPublicKey)):
|
if(item.shouldAddReaction(emojiIdAsEnum, myPublicKey)):
|
||||||
self.controller.addReaction(messageId, emojiId)
|
self.controller.addReaction(messageId, emojiId)
|
||||||
|
@ -569,6 +571,8 @@ method onMessageRemoved*(self: Module, messageId, removedBy: string) =
|
||||||
if removedBy == "":
|
if removedBy == "":
|
||||||
# removedBy is empty if it was removed by the sender
|
# removedBy is empty if it was removed by the sender
|
||||||
let messageItem = self.view.model().getItemWithMessageId(messageId)
|
let messageItem = self.view.model().getItemWithMessageId(messageId)
|
||||||
|
if(messageItem.isNil):
|
||||||
|
return
|
||||||
if messageItem.id == "":
|
if messageItem.id == "":
|
||||||
return
|
return
|
||||||
removedByValue = messageItem.senderId
|
removedByValue = messageItem.senderId
|
||||||
|
|
Loading…
Reference in New Issue