aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-21 10:52:20 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-21 10:52:22 +0200
commit1d7a7c84707e4ad349c3795acd723616aa3046e1 (patch)
tree2fce8d39bc8c6423f37a79e1455d15ae01789bfd /src
parentc1c7daea00058fc20b85fd1628bb35ddd7bcef23 (diff)
Only update when receiving message in currently visible channel
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp7
1 files changed, 5 insertions, 2 deletions
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())
{