From 7edd041e80897dafd583860e75e9443171997e5e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 21 May 2018 23:58:36 +0200 Subject: Set channel name when creating it, fetch new data from newest to oldest --- src/Channel.cpp | 2 +- src/main.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Channel.cpp b/src/Channel.cpp index 5015975..adcb9be 100644 --- a/src/Channel.cpp +++ b/src/Channel.cpp @@ -26,7 +26,7 @@ namespace dchat if(database) { - database->seed(databaseNodeInfo); + database->seed(databaseNodeInfo, odhtdb::DatabaseFetchOrder::NEWEST_FIRST); pingKey = odhtdb::DhtKey(*databaseNodeInfo.getRequestHash()).getPingKey(); // TODO: Ban peers that spam this key (take in account that creator of packets can be forged) diff --git a/src/main.cpp b/src/main.cpp index ecfd058..ed3bfd6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -431,6 +431,7 @@ int main(int argc, char **argv) ChannelSidePanel::addChannel(channel); channels.push_back(channel); Channel::setCurrent(channel); + channel->setName(args[0]); lastFocusedTimer.restart(); localNodeUsers[*createResponse->getRequestHash()] = { createResponse->getNodeEncryptionKey(), createResponse->getNodeAdminKeyPair() }; @@ -612,7 +613,7 @@ int main(int argc, char **argv) printf("Got a response from a person in the channel, we might get added...\n"); waitingToJoinChannels.push_back(databaseNode); lock_guard lock(channelMessageMutex); - database->seed(databaseNode); + database->seed(databaseNode, odhtdb::DatabaseFetchOrder::NEWEST_FIRST); return false; } catch(std::exception &e) -- cgit v1.2.3