From 82a0fc0d36a410863712538caab0e0f365d982af Mon Sep 17 00:00:00 2001 From: Green Sky Date: Thu, 24 Oct 2024 12:07:06 +0200 Subject: [PATCH] use sr --- src/bridge.cpp | 4 ++-- src/bridge.hpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) 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;