solanaceae_tox/solanaceae/tox_messages/tox_message_manager.hpp

34 lines
1.1 KiB
C++
Raw Permalink Normal View History

2023-07-24 13:20:53 +02:00
#pragma once
#include <solanaceae/toxcore/tox_event_interface.hpp>
#include <solanaceae/message3/registry_message_model.hpp>
#include <solanaceae/tox_contacts/tox_contact_model2.hpp>
// fwd
struct ToxI;
class ToxMessageManager : public RegistryMessageModelEventI, public ToxEventI {
protected:
2024-10-06 11:14:54 +02:00
RegistryMessageModelI& _rmm;
2024-10-24 15:55:44 +02:00
RegistryMessageModelI::SubscriptionReference _rmm_sr;
2023-07-24 13:20:53 +02:00
Contact3Registry& _cr;
ToxContactModel2& _tcm;
ToxI& _t;
2024-10-24 15:55:44 +02:00
ToxEventProviderI::SubscriptionReference _tep_sr;
2023-07-24 13:20:53 +02:00
public:
2024-10-06 11:14:54 +02:00
ToxMessageManager(RegistryMessageModelI& rmm, Contact3Registry& cr, ToxContactModel2& tcm, ToxI& t, ToxEventProviderI& tep);
2023-07-24 13:20:53 +02:00
virtual ~ToxMessageManager(void);
public: // mm3
bool sendText(const Contact3 c, std::string_view message, bool action = false) override;
protected: // tox events
bool onToxEvent(const Tox_Event_Friend_Message* e) override;
bool onToxEvent(const Tox_Event_Friend_Read_Receipt* e) override;
2023-07-24 13:20:53 +02:00
bool onToxEvent(const Tox_Event_Group_Message* e) override;
bool onToxEvent(const Tox_Event_Group_Private_Message* e) override;
};