aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;