aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index efb354f..3abff99 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -25,6 +25,7 @@
#include <ntp/NtpClient.hpp>
#include <sibs/SafeSerializer.hpp>
#include <X11/Xlib.h>
+#include <math.h>
using namespace std;
using namespace dchat;
@@ -397,7 +398,7 @@ int main(int argc, char **argv)
}
}
};
- database = new odhtdb::Database("bootstrap.ring.cx", 4222, Cache::getDchatDir(), callbackFuncs);
+ database = new odhtdb::Database("206.189.13.66", 27130, Cache::getDchatDir(), callbackFuncs);
auto addSystemMessage = [&lastFocusedTimer](const std::string &msg, bool plainText = true)
{
@@ -550,7 +551,7 @@ int main(int argc, char **argv)
sibs::SafeSerializer keySerializer;
keySerializer.add((const u8*)channelNodeHash->getData(), channelNodeHash->getSize());
keySerializer.add((const u8*)encryptionKey->data, odhtdb::ENCRYPTION_KEY_BYTE_SIZE);
- dht::InfoHash key = odhtdb::Database::getInfoHash(keySerializer.getBuffer().data(), keySerializer.getBuffer().size());
+ odhtdb::InfoHash key = odhtdb::Database::getInfoHash(keySerializer.getBuffer().data(), keySerializer.getBuffer().size());
database->receiveCustomMessage(key, [&channelMessageMutex, encryptionKey, channelEncryptionKey, currentChannel, &database](const void *data, usize size)
{
// TODO: User can remove channel @currentChannel before we get here, meaning @currentChannel is deleted and would be invalid; causing the program to crash
@@ -648,8 +649,10 @@ int main(int argc, char **argv)
sibs::SafeSerializer keySerializer;
keySerializer.add((const u8*)nodeHash->getData(), nodeHash->getSize());
keySerializer.add((const u8*)encryptionKeyBinRaw.data(), odhtdb::ENCRYPTION_KEY_BYTE_SIZE);
- dht::InfoHash key = odhtdb::Database::getInfoHash(keySerializer.getBuffer().data(), keySerializer.getBuffer().size());
- database->sendCustomMessage(key, move(serializer.getBuffer()), [&database, nodeHash, encryptionKey, &waitingToJoinChannels, &channelMessageMutex, keyPair, &currentUsername, &currentPassword, &localNodeUsers](bool gotResponse, const void *data, usize size)
+ odhtdb::InfoHash key = odhtdb::Database::getInfoHash(keySerializer.getBuffer().data(), keySerializer.getBuffer().size());
+ database->sendCustomMessage(key, serializer.getBuffer().data(), serializer.getBuffer().size(),
+ [&database, nodeHash, encryptionKey, &waitingToJoinChannels, &channelMessageMutex, keyPair, &currentUsername, &currentPassword, &localNodeUsers]
+ (bool gotResponse, const void *data, usize size)
{
if(!gotResponse)
{
@@ -695,7 +698,6 @@ int main(int argc, char **argv)
fprintf(stderr, "Failed while parsing join response for invite link, reason: %s\n", e.what());
}
return true;
-
});
waitingToJoin = true;
});