fix: issues

This commit is contained in:
Richard Ramos 2021-07-01 16:58:57 -04:00 committed by Iuri Matias
parent 689b36e6da
commit 2c553f48f7
5 changed files with 8 additions and 1 deletions

View File

@ -277,6 +277,9 @@ QtObject:
of "isEdited": result = if self.isEdited.hasKey(message.id): $self.isEdited[message.id] else: $false
else: result = ("")
proc contains*(self: ChatMessageList, message: Message):bool =
return self.messageIndex.hasKey(message.id)
proc add*(self: ChatMessageList, message: Message) =
if self.messageIndex.hasKey(message.id) and message.editedAt == "0": return # duplicated msg

View File

@ -236,6 +236,8 @@ QtObject:
msgIndex = self.messageList[timelineChatId].messages.len - 1
else:
self.messageList[msg.chatId].add(msg)
if self.pinnedMessagesList[msg.chatId].contains(msg):
self.pinnedMessagesList[msg.chatId].add(msg)
msgIndex = self.messageList[msg.chatId].messages.len - 1
self.messagePushed(msgIndex)
if self.channelOpenTime.getOrDefault(msg.chatId, high(int64)) < msg.timestamp.parseFloat.fromUnixFloat.toUnix:

View File

@ -197,6 +197,7 @@ ScrollView {
}
onMessageNotificationPushed: function(chatId, msg, messageType, chatType, timestamp, identicon, username, hasMention, isAddedContact, channelName) {
if (messageType == Constants.editType) return;
if (appSettings.notificationSetting == Constants.notifyAllMessages ||
(appSettings.notificationSetting == Constants.notifyJustMentions && hasMention)) {
if (chatId === chatsModel.channelView.activeChannel.id && applicationWindow.active === true) {

View File

@ -198,7 +198,7 @@ Item {
chatInputPlaceholder: qsTrId("type-a-message-")
chatType: chatsModel.channelView.activeChannel.chatType
isEdit: true
textInput.text: Emoji.parse(message.replace(/(<a href="\/\/0x[0-9A-Fa-f]+" class="mention">)/g, "$1@"))
textInput.text: Utils.getMessageWithStyle(Emoji.parse(message.replace(/(<a href="\/\/0x[0-9A-Fa-f]+" class="mention">)/g, "$1@")))
}
StatusButton {

View File

@ -92,6 +92,7 @@ ModalPopup {
pinnedMessage: true
pinnedBy: model.pinnedBy
forceHoverHandler: true
isEdited: model.isEdited
}
}
}