From 381b6505b5afaacc9194168697f6bc93c43d2775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Wed, 6 Jan 2021 21:52:53 +0100 Subject: Access services via Server object --- src/message.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/message.cpp') diff --git a/src/message.cpp b/src/message.cpp index 354703e..601bc39 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -202,10 +202,10 @@ const Identity & DirectMessageThread::peer() const } -vector DirectMessageService::Priv::watchers; -mutex DirectMessageService::Priv::watcherLock; +DirectMessageService::DirectMessageService(): + p(new Priv) +{} -DirectMessageService::DirectMessageService() = default; DirectMessageService::~DirectMessageService() = default; UUID DirectMessageService::uuid() const @@ -229,14 +229,14 @@ void DirectMessageService::handle(Context & ctx) const lock.unlock(); - for (const auto & w : Priv::watchers) + for (const auto & w : p->watchers) w(dmt, -1, -1); } void DirectMessageService::onUpdate(ThreadWatcher w) { - scoped_lock l(Priv::watcherLock); - Priv::watchers.push_back(w); + scoped_lock l(p->watcherLock); + p->watchers.push_back(w); } DirectMessageThread DirectMessageService::thread(const Identity & peer) -- cgit v1.2.3