@@ -19,7 +19,9 @@ void Factorio::sendToLinked(const std::string& message) {
19
19
Factorio::Factorio (ConfigModelI& conf, Contact3Registry& cr, RegistryMessageModelI& rmm, FactorioLogParser& flp) :
20
20
_cr(cr),
21
21
_rmm(rmm),
22
- _flp(flp)
22
+ _rmm_sr(_rmm.newSubRef(this )),
23
+ _flp(flp),
24
+ _flp_sr(_flp.newSubRef(this ))
23
25
{
24
26
// config
25
27
for (const auto && [contact_id, enabled] : conf.entries_bool (" Factorio" , " link_to_contact" )) {
@@ -46,16 +48,18 @@ Factorio::Factorio(ConfigModelI& conf, Contact3Registry& cr, RegistryMessageMode
46
48
_linked_contacts.push_back (h);
47
49
}
48
50
49
- _rmm.subscribe (this , RegistryMessageModel_Event::message_construct);
50
-
51
- _flp.subscribe (this , FactorioLogParser_Event::join);
52
- _flp.subscribe (this , FactorioLogParser_Event::leave);
53
- _flp.subscribe (this , FactorioLogParser_Event::chat);
54
- _flp.subscribe (this , FactorioLogParser_Event::died);
55
- _flp.subscribe (this , FactorioLogParser_Event::evolution);
56
- _flp.subscribe (this , FactorioLogParser_Event::research_started);
57
- _flp.subscribe (this , FactorioLogParser_Event::research_finished);
58
- _flp.subscribe (this , FactorioLogParser_Event::research_cancelled);
51
+ _rmm_sr.subscribe (RegistryMessageModel_Event::message_construct);
52
+
53
+ _flp_sr
54
+ .subscribe (FactorioLogParser_Event::join)
55
+ .subscribe (FactorioLogParser_Event::leave)
56
+ .subscribe (FactorioLogParser_Event::chat)
57
+ .subscribe (FactorioLogParser_Event::died)
58
+ .subscribe (FactorioLogParser_Event::evolution)
59
+ .subscribe (FactorioLogParser_Event::research_started)
60
+ .subscribe (FactorioLogParser_Event::research_finished)
61
+ .subscribe (FactorioLogParser_Event::research_cancelled)
62
+ ;
59
63
}
60
64
61
65
Factorio::~Factorio (void ) {
0 commit comments