diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-07-29 20:18:02 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-07-30 18:31:58 (GMT) |
commit | b145bde2b103b0e688eef6300d34668431c5ad04 (patch) | |
tree | 4789bd165ed919e20f80bbfb658263302c8a71c7 /Swiften/LinkLocal/LinkLocalServiceBrowser.cpp | |
parent | 4b809245dd6a1236dda99ab780485599434a419a (diff) | |
download | swift-b145bde2b103b0e688eef6300d34668431c5ad04.zip swift-b145bde2b103b0e688eef6300d34668431c5ad04.tar.bz2 |
Created LinkLocalPresenceManager.
Diffstat (limited to 'Swiften/LinkLocal/LinkLocalServiceBrowser.cpp')
-rw-r--r-- | Swiften/LinkLocal/LinkLocalServiceBrowser.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Swiften/LinkLocal/LinkLocalServiceBrowser.cpp b/Swiften/LinkLocal/LinkLocalServiceBrowser.cpp index f7c5478..f65cd7a 100644 --- a/Swiften/LinkLocal/LinkLocalServiceBrowser.cpp +++ b/Swiften/LinkLocal/LinkLocalServiceBrowser.cpp @@ -102,19 +102,22 @@ void LinkLocalServiceBrowser::handleServiceRemoved(const DNSSDServiceID& service assert(i != resolveQueries.end()); i->second->stop(); resolveQueries.erase(i); - services.erase(service); - onServiceRemoved(service); + ServiceMap::iterator j = services.find(service); + assert(j != services.end()); + LinkLocalService linkLocalService(j->first, j->second); + services.erase(j); + onServiceRemoved(linkLocalService); } void LinkLocalServiceBrowser::handleServiceResolved(const DNSSDServiceID& service, const boost::optional<DNSSDResolveServiceQuery::Result>& result) { if (result) { std::pair<ServiceMap::iterator, bool> r = services.insert(std::make_pair(service, *result)); if (r.second) { - onServiceAdded(service); + onServiceAdded(LinkLocalService(r.first->first, r.first->second)); } else { r.first->second = *result; - onServiceChanged(service); + onServiceChanged(LinkLocalService(r.first->first, r.first->second)); } } } |