From 4ba08f02a5e090134be5b9484f7ca89948633bb8 Mon Sep 17 00:00:00 2001 From: Sale Djenic Date: Thu, 5 Aug 2021 16:41:32 +0200 Subject: [PATCH] Rebasing issues fixed (#3005) --- src/app/chat/event_handling.nim | 3 +-- src/status/chat.nim | 18 +++++++----------- ui/StatusQ | 2 +- ui/app/AppLayouts/Chat/ChatColumn.qml | 1 - vendor/DOtherSide | 2 +- vendor/nim-status-go | 2 +- vendor/nimqml | 2 +- vendor/status-go | 2 +- 8 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/app/chat/event_handling.nim b/src/app/chat/event_handling.nim index 28b6146f75..cc2b6add40 100644 --- a/src/app/chat/event_handling.nim +++ b/src/app/chat/event_handling.nim @@ -12,8 +12,7 @@ proc handleChatEvents(self: ChatController) = # Display already saved messages self.status.events.on("messagesLoaded") do(e:Args): let evArgs = MsgsLoadedArgs(e) - self.view.onMessagesLoaded(evArgs.messages) - self.view.onMessagesLoaded(msgArgs.chatId, msgArgs.messages) + self.view.onMessagesLoaded(evArgs.chatId, evArgs.messages) for statusUpdate in evArgs.statusUpdates: self.view.communities.updateMemberVisibility(statusUpdate) diff --git a/src/status/chat.nim b/src/status/chat.nim index 809305c563..0b1e67a7bb 100644 --- a/src/status/chat.nim +++ b/src/status/chat.nim @@ -104,7 +104,7 @@ QtObject: result.setup() - proc update*(self: ChatModel, chats: seq[Chat], messages: seq[Message], emojiReactions: seq[Reaction], communities: seq[Community], communityMembershipRequests: seq[CommunityMembershipRequest], pinnedMessages: seq[Message], activityCenterNotifications: seq[ActivityCenterNotification]) = + proc update*(self: ChatModel, chats: seq[Chat], messages: seq[Message], emojiReactions: seq[Reaction], communities: seq[Community], communityMembershipRequests: seq[CommunityMembershipRequest], pinnedMessages: seq[Message], activityCenterNotifications: seq[ActivityCenterNotification], statusUpdates: seq[StatusUpdate], deletedMessages: seq[string]) = for chat in chats: self.channels[chat.id] = chat @@ -117,7 +117,7 @@ QtObject: if self.lastMessageTimestamps[chatId] > ts: self.lastMessageTimestamps[chatId] = ts - self.events.emit("chatUpdate", ChatUpdateArgs(messages: messages,chats: chats, contacts: @[], emojiReactions: emojiReactions, communities: communities, communityMembershipRequests: communityMembershipRequests, pinnedMessages: pinnedMessages, activityCenterNotifications: activityCenterNotifications)) + self.events.emit("chatUpdate", ChatUpdateArgs(messages: messages,chats: chats, contacts: @[], emojiReactions: emojiReactions, communities: communities, communityMembershipRequests: communityMembershipRequests, pinnedMessages: pinnedMessages, activityCenterNotifications: activityCenterNotifications, statusUpdates: statusUpdates, deletedMessages: deletedMessages)) proc processChatUpdate(self: ChatModel, response: JsonNode): (seq[Chat], seq[Message]) = var chats: seq[Chat] = @[] @@ -239,14 +239,6 @@ QtObject: for communityId in self.communitiesToFetch: status_chat.requestCommunityInfo(communityId) - proc deleteMessageAndSend*(self: ChatModel, messageId: string) = - var response = status_chat.deleteMessageAndSend(messageId) - discard self.processMessageUpdateAfterSend(response, false) - - proc sendImage*(self: ChatModel, chatId: string, image: string) = - var response = status_chat.sendImageMessage(chatId, image) - discard self.processMessageUpdateAfterSend(response) - proc init*(self: ChatModel, pubKey: string) = self.publicKey = pubKey @@ -354,6 +346,10 @@ QtObject: var response = status_chat.sendImageMessages(chatId, images) discard self.processMessageUpdateAfterSend(response) + proc deleteMessageAndSend*(self: ChatModel, messageId: string) = + var response = status_chat.deleteMessageAndSend(messageId) + discard self.processMessageUpdateAfterSend(response, false) + proc sendSticker*(self: ChatModel, chatId: string, sticker: Sticker) = var response = status_chat.sendStickerMessage(chatId, sticker) self.events.emit("stickerSent", StickerArgs(sticker: sticker, save: true)) @@ -484,7 +480,7 @@ QtObject: result = status_chat.createCommunityChannel(communityId, name, description) proc editCommunityChannel*(self: ChatModel, communityId: string, channelId: string, name: string, description: string, categoryId: string): Chat = - result = status_chat.editCommunityChannel(communityId, channelId, name, description, categoryId) + result = status_chat.editCommunityChannel(communityId, channelId, name, description, categoryId) proc deleteCommunityChat*(self: ChatModel, communityId: string, channelId: string) = status_chat.deleteCommunityChat(communityId, channelId) diff --git a/ui/StatusQ b/ui/StatusQ index 6c67aaf3a3..a8e830f76c 160000 --- a/ui/StatusQ +++ b/ui/StatusQ @@ -1 +1 @@ -Subproject commit 6c67aaf3a3031af92931dce9673418e81f80749f +Subproject commit a8e830f76caca16718353b84dfe77b5eac363943 diff --git a/ui/app/AppLayouts/Chat/ChatColumn.qml b/ui/app/AppLayouts/Chat/ChatColumn.qml index 7b83744074..f6fa02a143 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn.qml @@ -308,7 +308,6 @@ Item { active: stackLayoutChatMessages.currentIndex === index sourceComponent: ChatMessages { id: chatMessages - messageList: messages messageContextMenuInst: MessageContextMenu { reactionModel: EmojiReactions { } } diff --git a/vendor/DOtherSide b/vendor/DOtherSide index eaa394d711..a838753904 160000 --- a/vendor/DOtherSide +++ b/vendor/DOtherSide @@ -1 +1 @@ -Subproject commit eaa394d711f757b859030349aeaf41a10e1bad2b +Subproject commit a838753904615610667e704efec5864e0d27e7c2 diff --git a/vendor/nim-status-go b/vendor/nim-status-go index f1ec58561d..f4463f3955 160000 --- a/vendor/nim-status-go +++ b/vendor/nim-status-go @@ -1 +1 @@ -Subproject commit f1ec58561d7b48f6c8b664f3806fd8a113164fba +Subproject commit f4463f3955a96e162e9881b73ba02f819e0374a4 diff --git a/vendor/nimqml b/vendor/nimqml index 65fa68c244..8ca765ca11 160000 --- a/vendor/nimqml +++ b/vendor/nimqml @@ -1 +1 @@ -Subproject commit 65fa68c244fa52037de652520755430ec65c77df +Subproject commit 8ca765ca11a9fde6a43d60289afcea312d3e6ed8 diff --git a/vendor/status-go b/vendor/status-go index dd66d0f49c..c4a71f813a 160000 --- a/vendor/status-go +++ b/vendor/status-go @@ -1 +1 @@ -Subproject commit dd66d0f49ca9158a05fa4294419f9a6f322aa591 +Subproject commit c4a71f813a783e310b1c8ca59d2390a8d76f6a0c