diff options
Diffstat (limited to 'src/contact.cpp')
-rw-r--r-- | src/contact.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/contact.cpp b/src/contact.cpp index 787831c..0050f95 100644 --- a/src/contact.cpp +++ b/src/contact.cpp @@ -142,7 +142,12 @@ Ref ContactData::store(const Storage & st) const return st.storeObject(Record(std::move(items))); } -ContactService::ContactService() = default; +ContactService::ContactService(Config && config, const Server & s): + PairingService(move(config)), + server(s) +{ +} + ContactService::~ContactService() = default; UUID ContactService::uuid() const @@ -150,12 +155,6 @@ UUID ContactService::uuid() const return serviceUUID; } -void ContactService::serverStarted(const Server & s) -{ - PairingService<ContactAccepted>::serverStarted(s); - server = &s; -} - void ContactService::request(const Peer & peer) { requestPairing(serviceUUID, peer); @@ -163,7 +162,7 @@ void ContactService::request(const Peer & peer) Stored<ContactAccepted> ContactService::handlePairingComplete(const Peer & peer) { - server->localHead().update([&] (const Stored<LocalState> & local) { + server.localHead().update([&] (const Stored<LocalState> & local) { auto cdata = local.ref().storage().store(ContactData { .prev = {}, .identity = peer.identity()->finalOwner().data(), |