This commit is contained in:
Green Sky 2024-10-25 12:25:39 +02:00
parent 6bc67efdc5
commit f2030667bd
No known key found for this signature in database
2 changed files with 7 additions and 5 deletions

View File

@ -43,15 +43,17 @@ CRDTNotesToxSync::CRDTNotesToxSync(
ToxI& t, ToxI& t,
ToxEventProviderI& tep, ToxEventProviderI& tep,
ToxContactModel2& tcm ToxContactModel2& tcm
) : _notes_sync(notes_sync), _cr(cr), _t(t), _tep(tep), _tcm(tcm) { ) : _notes_sync(notes_sync), _cr(cr), _t(t), _tep_sr(tep.newSubRef(this)), _tcm(tcm) {
// TODO: non groups // TODO: non groups
// should be called for every peer (except self) // should be called for every peer (except self)
// we hook here to inject ourself as contact sync model // we hook here to inject ourself as contact sync model
_tep.subscribe(this, Tox_Event_Type::TOX_EVENT_GROUP_PEER_JOIN); _tep_sr
.subscribe(Tox_Event_Type::TOX_EVENT_GROUP_PEER_JOIN)
_tep.subscribe(this, Tox_Event_Type::TOX_EVENT_GROUP_CUSTOM_PACKET); .subscribe(Tox_Event_Type::TOX_EVENT_GROUP_CUSTOM_PACKET)
_tep.subscribe(this, Tox_Event_Type::TOX_EVENT_GROUP_CUSTOM_PRIVATE_PACKET); .subscribe(Tox_Event_Type::TOX_EVENT_GROUP_CUSTOM_PRIVATE_PACKET)
;
} }
CRDTNotesToxSync::~CRDTNotesToxSync(void) { CRDTNotesToxSync::~CRDTNotesToxSync(void) {

View File

@ -16,7 +16,7 @@ class CRDTNotesToxSync : public CRDTNotesContactSyncModelI, public ToxEventI {
CRDTNotesEventI& _notes_sync; CRDTNotesEventI& _notes_sync;
Contact3Registry& _cr; Contact3Registry& _cr;
ToxI& _t; ToxI& _t;
ToxEventProviderI& _tep; ToxEventProviderI::SubscriptionReference _tep_sr;
ToxContactModel2& _tcm; ToxContactModel2& _tcm;
public: public: