diff --git a/src/bridge.cpp b/src/bridge.cpp index be82996..f5ea22a 100644 --- a/src/bridge.cpp +++ b/src/bridge.cpp @@ -13,8 +13,8 @@ Bridge::Bridge( RegistryMessageModelI& rmm, ConfigModelI& conf, MessageCommandDispatcher* mcd -) : _cr(cr), _rmm(rmm), _conf(conf), _mcd(mcd) { - _rmm.subscribe(this, enumType::message_construct); +) : _cr(cr), _rmm(rmm), _rmm_sr(_rmm.newSubRef(this)), _conf(conf), _mcd(mcd) { + _rmm_sr.subscribe(RegistryMessageModel_Event::message_construct); if (!_conf.has_bool("Bridge", "username_angle_brackets")) { _conf.set("Bridge", "username_angle_brackets", true); diff --git a/src/bridge.hpp b/src/bridge.hpp index 6094889..e8b6464 100644 --- a/src/bridge.hpp +++ b/src/bridge.hpp @@ -15,6 +15,7 @@ class MessageCommandDispatcher; class Bridge : public RegistryMessageModelEventI { Contact3Registry& _cr; RegistryMessageModelI& _rmm; + RegistryMessageModelI::SubscriptionReference _rmm_sr; ConfigModelI& _conf; MessageCommandDispatcher* _mcd;