mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
Implement last message cache when a message is received
This commit is contained in:
parent
93c6a1a7e8
commit
464c16b825
2 changed files with 8 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue