From 3fc2712c460c90f33e9cb9b1d4729447b2ae95dd Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 16 May 2018 22:59:31 +0200 Subject: Fix bug when adding user to channel (invite key) --- depends/odhtdb | 2 +- src/main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/depends/odhtdb b/depends/odhtdb index 82b551f..c8f015c 160000 --- a/depends/odhtdb +++ b/depends/odhtdb @@ -1 +1 @@ -Subproject commit 82b551fad6712461bfaaa67ade44aa6091c9cf80 +Subproject commit c8f015c546d095857fde0f5fbef95156ce993691 diff --git a/src/main.cpp b/src/main.cpp index 56c38a6..f8820f3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -396,13 +396,13 @@ int main(int argc, char **argv) serializer.add((const u8*)encryptedChannelKey.getCipherText().data, encryptedChannelKey.getCipherText().size); const auto &localUserPublicKey = static_cast(currentChannel->getLocalUser())->getPublicKey(); auto localUserGroups = database->getUserGroups(*currentChannel->getNodeInfo().getRequestHash(), localUserPublicKey); - if(!localUserGroups.empty()) + if(localUserGroups.empty()) { fprintf(stderr, "No group to add user to...\n"); return sibs::SafeSerializer(); } lock_guard lock(channelMessageMutex); - currentChannel->addUser(localUserPublicKey, localUserGroups[0].getView()); + currentChannel->addUser(userToAddPublicKey, localUserGroups[0].getView()); return serializer; } catch(std::exception &e) -- cgit v1.2.3