Logging of the messages, customizable replies, assigning groups
This commit is contained in:
parent
f03f392cee
commit
7f57cd3bf6
21 changed files with 288 additions and 62 deletions
|
@ -13,7 +13,7 @@ Connection::~Connection() noexcept {
|
|||
deinitialize();
|
||||
}
|
||||
|
||||
void Connection::initiialize() {
|
||||
void Connection::initialize() {
|
||||
if (state != initial)
|
||||
return;
|
||||
|
||||
|
@ -65,9 +65,16 @@ void Connection::send(const std::string& jid, const std::string& body) {
|
|||
}
|
||||
|
||||
void Connection::handleMessage(const gloox::Message& message, gloox::MessageSession* session) {
|
||||
if (message.subtype() != gloox::Message::Chat)
|
||||
return;
|
||||
|
||||
std::string body = message.body();
|
||||
if (body.empty())
|
||||
return;
|
||||
|
||||
std::string jid = message.from().bare();
|
||||
core->logger.log(Logger::debug, "received message \"" + message.body() + "\" from " + jid, {"Connection"});
|
||||
core->router.routeMessage(jid, message.body());
|
||||
core->logger.log(Logger::debug, "received message \"" + body + "\" from " + jid, {"Connection"});
|
||||
core->router.routeMessage(jid, body);
|
||||
}
|
||||
|
||||
void Connection::onConnect() {
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
Connection(const std::shared_ptr<Core>& core);
|
||||
~Connection() noexcept;
|
||||
|
||||
void initiialize();
|
||||
void initialize();
|
||||
void deinitialize();
|
||||
void connect();
|
||||
void send(const std::string& jid, const std::string& body);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue