Basic handling of modes, both ways

This commit is contained in:
Florent Le Coz
2013-11-12 23:48:10 +01:00
parent b60cbda4f9
commit 5817a95b5e
8 changed files with 85 additions and 22 deletions
+7
View File
@@ -4,6 +4,7 @@
#include <network/poller.hpp>
#include <utils/encoding.hpp>
#include <utils/split.hpp>
#include <iostream>
static const char* action_prefix = "\01ACTION ";
@@ -83,6 +84,12 @@ void Bridge::send_channel_message(const Iid& iid, const std::string& body)
std::cout << "Cannot send message: no client exist for server " << iid.server << std::endl;
return;
}
if (body.substr(0, 6) == "/mode ")
{
std::vector<std::string> args = utils::split(body.substr(6), ' ', false);
irc->send_mode_command(iid.chan, args);
return;
}
if (body.substr(0, 4) == "/me ")
irc->send_channel_message(iid.chan, action_prefix + body.substr(4) + "\01");
else