aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-01 15:28:23 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-01 15:28:25 +0200
commit1818ee0d0b5c1560fb72681094639e270579bc50 (patch)
tree20c74faab25ab0f71cb4f58478718f62fff17c7d /src
parent418940b10605e1a6c9b87146b9aac3c26c431788 (diff)
Fix again...
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 4986e6c..c7dd433 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -165,12 +165,6 @@ int main(int argc, char **argv)
database.setOnAddUserCallback([&currentUserKeyPair, &channels, &channelMessageMutex, &waitingToJoin](const odhtdb::DatabaseAddUserRequest &request)
{
lock_guard<recursive_mutex> lock(channelMessageMutex);
- if(currentUserKeyPair && request.userToAdd->getPublicKey() == currentUserKeyPair->getPublicKey())
- {
- printf("You were added to channel %s by %s\n", request.nodeHash->toString().c_str(), request.creatorUser->getName().c_str());
- return;
- }
-
for(Channel *channel : channels)
{
if(*request.nodeHash == *channel->getNodeInfo().getRequestHash())
@@ -178,6 +172,7 @@ int main(int argc, char **argv)
User *userToAdd = channel->getUserByPublicKey(request.userToAdd->getPublicKey());
if(userToAdd && 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));
waitingToJoin = false;
return;