aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp14
1 files changed, 10 insertions, 4 deletions
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)
{