Compare commits

..

No commits in common. "e4eaf91a68e9be5089794ec46ebc6007d9fb697a" and "f5cf44119b891498881c0ef0fd93498632a202f9" have entirely different histories.

4 changed files with 16 additions and 24 deletions

View File

@ -19,21 +19,19 @@ IRCClientContactModel::IRCClientContactModel(
Contact3Registry& cr, Contact3Registry& cr,
ConfigModelI& conf, ConfigModelI& conf,
IRCClient1& ircc IRCClient1& ircc
) : _cr(cr), _conf(conf), _ircc(ircc), _ircc_sr(_ircc.newSubRef(this)) { ) : _cr(cr), _conf(conf), _ircc(ircc) {
_ircc_sr _ircc.subscribe(this, IRCClient_Event::CONNECT);
.subscribe(IRCClient_Event::CONNECT)
.subscribe(IRCClient_Event::NUMERIC) _ircc.subscribe(this, IRCClient_Event::NUMERIC);
.subscribe(IRCClient_Event::JOIN) _ircc.subscribe(this, IRCClient_Event::JOIN);
.subscribe(IRCClient_Event::PART) _ircc.subscribe(this, IRCClient_Event::PART);
.subscribe(IRCClient_Event::TOPIC) _ircc.subscribe(this, IRCClient_Event::TOPIC);
.subscribe(IRCClient_Event::QUIT) _ircc.subscribe(this, IRCClient_Event::QUIT);
.subscribe(IRCClient_Event::CTCP_REQ) _ircc.subscribe(this, IRCClient_Event::CTCP_REQ);
.subscribe(IRCClient_Event::DISCONNECT) _ircc.subscribe(this, IRCClient_Event::DISCONNECT);
;
// dont create server self etc until connect event comes // dont create server self etc until connect event comes
@ -417,7 +415,6 @@ bool IRCClientContactModel::onEvent(const IRCClient::Events::Join& e) {
} }
channel.emplace_or_replace<Contact::Components::ContactModel>(this); channel.emplace_or_replace<Contact::Components::ContactModel>(this);
channel.emplace_or_replace<Contact::Components::Parent>(_server); channel.emplace_or_replace<Contact::Components::Parent>(_server);
_cr.get_or_emplace<Contact::Components::ParentOf>(_server).subs.push_back(channel);
channel.emplace_or_replace<Contact::Components::ParentOf>(); // start empty channel.emplace_or_replace<Contact::Components::ParentOf>(); // start empty
channel.emplace_or_replace<Contact::Components::IRC::ServerName>(std::string{_ircc.getServerName()}); channel.emplace_or_replace<Contact::Components::IRC::ServerName>(std::string{_ircc.getServerName()});
channel.emplace_or_replace<Contact::Components::IRC::ChannelName>(std::string{joined_channel_name}); channel.emplace_or_replace<Contact::Components::IRC::ChannelName>(std::string{joined_channel_name});

View File

@ -16,7 +16,6 @@ class IRCClientContactModel : public IRCClientEventI, public ContactModel3I {
Contact3Registry& _cr; Contact3Registry& _cr;
ConfigModelI& _conf; ConfigModelI& _conf;
IRCClient1& _ircc; IRCClient1& _ircc;
IRCClient1::SubscriptionReference _ircc_sr;
// cm needs the connect event to happen // cm needs the connect event to happen
bool _connected {false}; bool _connected {false};

View File

@ -22,16 +22,14 @@ IRCClientMessageManager::IRCClientMessageManager(
ConfigModelI& conf, ConfigModelI& conf,
IRCClient1& ircc, IRCClient1& ircc,
IRCClientContactModel& ircccm IRCClientContactModel& ircccm
) : _rmm(rmm), _rmm_sr(_rmm.newSubRef(this)), _cr(cr), _conf(conf), _ircc(ircc), _ircc_sr(_ircc.newSubRef(this)), _ircccm(ircccm) { ) : _rmm(rmm), _cr(cr), _conf(conf), _ircc(ircc), _ircccm(ircccm) {
_ircc_sr _ircc.subscribe(this, IRCClient_Event::CHANNEL);
.subscribe(IRCClient_Event::CHANNEL) _ircc.subscribe(this, IRCClient_Event::PRIVMSG);
.subscribe(IRCClient_Event::PRIVMSG) _ircc.subscribe(this, IRCClient_Event::NOTICE);
.subscribe(IRCClient_Event::NOTICE) _ircc.subscribe(this, IRCClient_Event::CHANNELNOTICE);
.subscribe(IRCClient_Event::CHANNELNOTICE) _ircc.subscribe(this, IRCClient_Event::CTCP_ACTION);
.subscribe(IRCClient_Event::CTCP_ACTION)
;
_rmm_sr.subscribe(RegistryMessageModel_Event::send_text); _rmm.subscribe(this, RegistryMessageModel_Event::send_text);
} }
IRCClientMessageManager::~IRCClientMessageManager(void) { IRCClientMessageManager::~IRCClientMessageManager(void) {

View File

@ -7,11 +7,9 @@
class IRCClientMessageManager : public IRCClientEventI, public RegistryMessageModelEventI { class IRCClientMessageManager : public IRCClientEventI, public RegistryMessageModelEventI {
protected: protected:
RegistryMessageModelI& _rmm; RegistryMessageModelI& _rmm;
RegistryMessageModelI::SubscriptionReference _rmm_sr;
Contact3Registry& _cr; Contact3Registry& _cr;
ConfigModelI& _conf; ConfigModelI& _conf;
IRCClient1& _ircc; IRCClient1& _ircc;
IRCClient1::SubscriptionReference _ircc_sr;
IRCClientContactModel& _ircccm; IRCClientContactModel& _ircccm;
public: public: