aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-01 15:39:26 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-01 15:39:29 +0200
commit78c737a0990b3cd2139b0fcca60355ce9f9d4b11 (patch)
tree98f9d380068d5dab047455561e267b6d6f62dcc0 /src/main.cpp
parent1818ee0d0b5c1560fb72681094639e270579bc50 (diff)
Fix channel joining waiting status, fix duplicate message locally
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index c7dd433..bf74d23 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -169,8 +169,7 @@ int main(int argc, char **argv)
{
if(*request.nodeHash == *channel->getNodeInfo().getRequestHash())
{
- User *userToAdd = channel->getUserByPublicKey(request.userToAdd->getPublicKey());
- if(userToAdd && currentUserKeyPair && request.userToAdd->getPublicKey() == currentUserKeyPair->getPublicKey() && channel->getLocalUser()->type != User::Type::ONLINE)
+ if(currentUserKeyPair && request.userToAdd->getPublicKey() == currentUserKeyPair->getPublicKey() && channel->getLocalUser()->type != User::Type::ONLINE)
{
printf("You were added to channel %s by %s\n", request.nodeHash->toString().c_str(), request.creatorUser->getName().c_str());
channel->replaceLocalUser(new OnlineUser(request.userToAdd));
@@ -178,6 +177,7 @@ int main(int argc, char **argv)
return;
}
+ User *userToAdd = channel->getUserByPublicKey(request.userToAdd->getPublicKey());
if(userToAdd)
{
fprintf(stderr, "User %s already exists in channel\n", request.userToAdd->getPublicKey().toString().c_str());