Rebasing issues fixed (#3005)
This commit is contained in:
parent
5e569865e4
commit
4ba08f02a5
|
@ -12,8 +12,7 @@ proc handleChatEvents(self: ChatController) =
|
||||||
# Display already saved messages
|
# Display already saved messages
|
||||||
self.status.events.on("messagesLoaded") do(e:Args):
|
self.status.events.on("messagesLoaded") do(e:Args):
|
||||||
let evArgs = MsgsLoadedArgs(e)
|
let evArgs = MsgsLoadedArgs(e)
|
||||||
self.view.onMessagesLoaded(evArgs.messages)
|
self.view.onMessagesLoaded(evArgs.chatId, evArgs.messages)
|
||||||
self.view.onMessagesLoaded(msgArgs.chatId, msgArgs.messages)
|
|
||||||
for statusUpdate in evArgs.statusUpdates:
|
for statusUpdate in evArgs.statusUpdates:
|
||||||
self.view.communities.updateMemberVisibility(statusUpdate)
|
self.view.communities.updateMemberVisibility(statusUpdate)
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ QtObject:
|
||||||
|
|
||||||
result.setup()
|
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:
|
for chat in chats:
|
||||||
self.channels[chat.id] = chat
|
self.channels[chat.id] = chat
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ QtObject:
|
||||||
if self.lastMessageTimestamps[chatId] > ts:
|
if self.lastMessageTimestamps[chatId] > ts:
|
||||||
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]) =
|
proc processChatUpdate(self: ChatModel, response: JsonNode): (seq[Chat], seq[Message]) =
|
||||||
var chats: seq[Chat] = @[]
|
var chats: seq[Chat] = @[]
|
||||||
|
@ -239,14 +239,6 @@ QtObject:
|
||||||
for communityId in self.communitiesToFetch:
|
for communityId in self.communitiesToFetch:
|
||||||
status_chat.requestCommunityInfo(communityId)
|
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) =
|
proc init*(self: ChatModel, pubKey: string) =
|
||||||
self.publicKey = pubKey
|
self.publicKey = pubKey
|
||||||
|
|
||||||
|
@ -354,6 +346,10 @@ QtObject:
|
||||||
var response = status_chat.sendImageMessages(chatId, images)
|
var response = status_chat.sendImageMessages(chatId, images)
|
||||||
discard self.processMessageUpdateAfterSend(response)
|
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) =
|
proc sendSticker*(self: ChatModel, chatId: string, sticker: Sticker) =
|
||||||
var response = status_chat.sendStickerMessage(chatId, sticker)
|
var response = status_chat.sendStickerMessage(chatId, sticker)
|
||||||
self.events.emit("stickerSent", StickerArgs(sticker: sticker, save: true))
|
self.events.emit("stickerSent", StickerArgs(sticker: sticker, save: true))
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 6c67aaf3a3031af92931dce9673418e81f80749f
|
Subproject commit a8e830f76caca16718353b84dfe77b5eac363943
|
|
@ -308,7 +308,6 @@ Item {
|
||||||
active: stackLayoutChatMessages.currentIndex === index
|
active: stackLayoutChatMessages.currentIndex === index
|
||||||
sourceComponent: ChatMessages {
|
sourceComponent: ChatMessages {
|
||||||
id: chatMessages
|
id: chatMessages
|
||||||
messageList: messages
|
|
||||||
messageContextMenuInst: MessageContextMenu {
|
messageContextMenuInst: MessageContextMenu {
|
||||||
reactionModel: EmojiReactions { }
|
reactionModel: EmojiReactions { }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit eaa394d711f757b859030349aeaf41a10e1bad2b
|
Subproject commit a838753904615610667e704efec5864e0d27e7c2
|
|
@ -1 +1 @@
|
||||||
Subproject commit f1ec58561d7b48f6c8b664f3806fd8a113164fba
|
Subproject commit f4463f3955a96e162e9881b73ba02f819e0374a4
|
|
@ -1 +1 @@
|
||||||
Subproject commit 65fa68c244fa52037de652520755430ec65c77df
|
Subproject commit 8ca765ca11a9fde6a43d60289afcea312d3e6ed8
|
|
@ -1 +1 @@
|
||||||
Subproject commit dd66d0f49ca9158a05fa4294419f9a6f322aa591
|
Subproject commit c4a71f813a783e310b1c8ca59d2390a8d76f6a0c
|
Loading…
Reference in New Issue