diff options
m--------- | depends/dchat_core | 0 | ||||
-rw-r--r-- | src/main.cpp | 14 |
2 files changed, 10 insertions, 4 deletions
diff --git a/depends/dchat_core b/depends/dchat_core -Subproject 6b46f7eccda2fd415727f731f655c6f03d9f9be +Subproject f8ec6a14e0c7b3b6da4bbde441242e999a487df diff --git a/src/main.cpp b/src/main.cpp index 2be28b2..1ae5eb6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -211,7 +211,7 @@ int main(int argc, char **argv) }; // Login to account - Command::add("login", [&channelMessageMutex](const vector<string> &args) + Command::add("login", [&channelMessageMutex, &addSystemMessage](const vector<string> &args) { lock_guard<recursive_mutex> lock(channelMessageMutex); if(args.size() != 2) @@ -227,7 +227,10 @@ int main(int argc, char **argv) try { rooms->loginUser(args[0], args[1]); - printf("Successfully logged into user %s\n", args[0].c_str()); + std::string msg = "Successfully logged into user "; + msg += args[0]; + addSystemMessage(msg); + printf("%s\n", msg.c_str()); } catch(std::exception &e) { @@ -236,7 +239,7 @@ int main(int argc, char **argv) }); // Register account - Command::add("register", [&channelMessageMutex](const vector<string> &args) + Command::add("register", [&channelMessageMutex, &addSystemMessage](const vector<string> &args) { lock_guard<recursive_mutex> lock(channelMessageMutex); if(args.size() != 2) @@ -252,7 +255,10 @@ int main(int argc, char **argv) try { rooms->registerUser(args[0], args[1]); - printf("Successfully registered user %s\n", args[0].c_str()); + std::string msg = "Successfully registered user "; + msg += args[0]; + addSystemMessage(msg); + printf("%s\n", msg.c_str()); } catch(odhtdb::SqlExecException &e) { |