mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 06:35:08 -04:00
Refactor chat cache to get remote GXS from GxsIdentityDelegate.qml instead from ChatView
This commit is contained in:
parent
a0f59959a1
commit
7c4ee55fcf
2 changed files with 10 additions and 6 deletions
|
@ -37,10 +37,6 @@ QtObject {
|
|||
console.log("updateLastMessage (chatId, chatModel)")
|
||||
var lastMessage = findChatLastMessage (chatModel)
|
||||
lastMessageList[chatId].lastMessage = lastMessage
|
||||
if (!lastMessageList[chatId].remoteGXS) {
|
||||
var firstMessage = findChatFirstMessage (chatModel)
|
||||
setRemoteGXS(chatId, firstMessage.author_id)
|
||||
}
|
||||
lastMessageChanged(chatId, lastMessage)
|
||||
}
|
||||
|
||||
|
@ -55,6 +51,10 @@ QtObject {
|
|||
}
|
||||
|
||||
function setRemoteGXS (chatId, remoteGXS){
|
||||
if (!lastMessageList[chatId]) {
|
||||
lastMessageList[chatId] = {}
|
||||
console.log("Last message cache created!")
|
||||
}
|
||||
if (lastMessageList[chatId] && !lastMessageList[chatId].remoteGXS){
|
||||
lastMessageList[chatId].remoteGXS = remoteGXS
|
||||
return true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue