summaryrefslogtreecommitdiff
path: root/src/message.cpp
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2021-01-06 21:52:53 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2021-01-06 21:52:53 +0100
commit381b6505b5afaacc9194168697f6bc93c43d2775 (patch)
tree1190917b6ee40d6f4a74bf724466b3062ab86f4f /src/message.cpp
parent96eb8471d11667a56466a6f701d1d23fa64c2225 (diff)
Access services via Server object
Diffstat (limited to 'src/message.cpp')
-rw-r--r--src/message.cpp12
1 files changed, 6 insertions, 6 deletions
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::ThreadWatcher> 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)