summaryrefslogtreecommitdiff
path: root/src/message.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/message.cpp')
-rw-r--r--src/message.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/message.cpp b/src/message.cpp
index eb1212c..fd8e847 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -202,8 +202,14 @@ const Identity & DirectMessageThread::peer() const
}
-DirectMessageService::DirectMessageService():
- p(new Priv)
+DirectMessageService::Config & DirectMessageService::Config::onUpdate(ThreadWatcher w)
+{
+ watchers.push_back(w);
+ return *this;
+}
+
+DirectMessageService::DirectMessageService(Config && c, const Server &):
+ config(move(c))
{}
DirectMessageService::~DirectMessageService() = default;
@@ -229,16 +235,10 @@ void DirectMessageService::handle(Context & ctx)
lock.unlock();
- for (const auto & w : p->watchers)
+ for (const auto & w : config.watchers)
w(dmt, -1, -1);
}
-void DirectMessageService::onUpdate(ThreadWatcher w)
-{
- scoped_lock l(p->watcherLock);
- p->watchers.push_back(w);
-}
-
DirectMessageThread DirectMessageService::thread(const Identity & peer)
{
scoped_lock lock(threadLock);