From 1d7a7c84707e4ad349c3795acd723616aa3046e1 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 21 May 2018 10:52:20 +0200 Subject: Only update when receiving message in currently visible channel --- src/main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index c21be47..8c13c80 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -169,6 +169,7 @@ int main(int argc, char **argv) ChannelSidePanel::addChannel(channel); channels.push_back(channel); Channel::setCurrent(channel); + lastFocusedTimer.restart(); if(localUser->type == User::Type::OFFLINE) { @@ -196,7 +197,8 @@ int main(int argc, char **argv) if(*request.nodeHash == *channel->getNodeInfo().getRequestHash()) { channelAddStoredMessage(channel, *request.requestHash, *request.creatorPublicKey, StringView((const char*)request.decryptedData.data, request.decryptedData.size), request.timestamp); - lastFocusedTimer.restart(); + if(channel == Channel::getCurrent()) + lastFocusedTimer.restart(); return; } } @@ -221,7 +223,8 @@ int main(int argc, char **argv) return; } - lastFocusedTimer.restart(); + if(channel == Channel::getCurrent()) + lastFocusedTimer.restart(); if(*request.userToAddPublicKey == nodeUserData->second.userKeyPair->getPublicKey()) { -- cgit v1.2.3