mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Implement last message cache when a message is received
This commit is contained in:
parent
93c6a1a7e8
commit
464c16b825
@ -27,6 +27,7 @@ Item
|
||||
property string chatId
|
||||
property int token: 0
|
||||
|
||||
|
||||
function refreshData()
|
||||
{
|
||||
console.log("chatView.refreshData()", visible)
|
||||
@ -38,6 +39,8 @@ Item
|
||||
token = JSON.parse(par.response).statetoken
|
||||
TokensManager.registerToken(token, refreshData)
|
||||
|
||||
ChatCache.lastMessageCache.updateLastMessageCache(chatId, chatModel.json)
|
||||
|
||||
if(chatListView.visible)
|
||||
{
|
||||
chatListView.positionViewAtEnd()
|
||||
|
@ -101,6 +101,10 @@ Item
|
||||
TokensManager.registerToken(json.statetoken, refreshUnread)
|
||||
contactsSortWorker.sendMessage(
|
||||
{'action': 'refreshUnread', 'response': par.response})
|
||||
json.data.forEach (function (chat){
|
||||
console.log("@@@@@@@@@@@@ ",chat.chat_id)
|
||||
ChatCache.lastMessageCache.updateLastMessageCache(chat.chat_id)
|
||||
})
|
||||
}
|
||||
function refreshUnread()
|
||||
{
|
||||
@ -187,4 +191,5 @@ Item
|
||||
|
||||
property bool defaultIdentityCreated: false
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user