Refactored in a way modules have access to bot infrastructure

This commit is contained in:
Blue 2025-03-09 21:01:41 +02:00
parent c605b3ba93
commit 89c04254b8
Signed by: blue
GPG key ID: 9B203B252A63EE38
25 changed files with 245 additions and 216 deletions

View file

@ -5,8 +5,9 @@
#include "gloox/message.h"
Module::Module::Module(const std::shared_ptr<gloox::Client>& client):
client(client)
Module::Module::Module(const std::shared_ptr<Core>& core, const std::shared_ptr<Connection>& connection):
core(core),
connection(connection)
{}
Module::Module::~Module() noexcept {}
@ -25,11 +26,3 @@ std::vector<std::string> Module::Module::split(const std::string& string, const
return result;
}
void Module::Module::sendMessage(const std::shared_ptr<Actor>& actor, const std::string& body) {
client->send(gloox::Message(
gloox::Message::Chat,
actor->jid,
body
));
}