mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
map with string instead of address
This commit is contained in:
parent
42ab9978e6
commit
aa6498b6c9
3 changed files with 9 additions and 14 deletions
|
|
@ -130,18 +130,14 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con
|
|||
|
||||
content.setBody(notifyBody);
|
||||
char token[17];
|
||||
ostringstream os;
|
||||
os.str("");
|
||||
belle_sip_random_token(token, sizeof(token));
|
||||
os << token << "@sip.linphone.org";
|
||||
Address cid(os.str());
|
||||
content.addHeader("Content-Id", cid.asStringUriOnly());
|
||||
content.addHeader("Content-Id", token);
|
||||
contents.push_back(content);
|
||||
|
||||
// Add entry into the Rlmi content of the notify body
|
||||
Xsd::Rlmi::Resource resource(addr.asStringUriOnly());
|
||||
Xsd::Rlmi::Resource::InstanceSequence instances;
|
||||
Xsd::Rlmi::Instance instance(cid.asStringUriOnly(), Xsd::Rlmi::State::Value::active);
|
||||
Xsd::Rlmi::Instance instance(token, Xsd::Rlmi::State::Value::active);
|
||||
instances.push_back(instance);
|
||||
resource.setInstance(instances);
|
||||
resources.push_back(resource);
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ void RemoteConferenceListEventHandler::notifyReceived (const Content *notifyCont
|
|||
|
||||
list<Content> contents = ContentManager::multipartToContentList(*notifyContent);
|
||||
bctbx_free(from);
|
||||
map<IdentityAddress, IdentityAddress> addresses;
|
||||
map<string, IdentityAddress> addresses;
|
||||
for (const auto &content : contents) {
|
||||
const string &body = content.getBodyAsString();
|
||||
const ContentType &contentType = content.getContentType();
|
||||
|
|
@ -157,11 +157,10 @@ void RemoteConferenceListEventHandler::notifyReceived (const Content *notifyCont
|
|||
continue;
|
||||
}
|
||||
|
||||
const string &value = content.getHeaderValue("Content-Id");
|
||||
if (value.empty())
|
||||
const string &cid = content.getHeaderValue("Content-Id");
|
||||
if (cid.empty())
|
||||
continue;
|
||||
|
||||
IdentityAddress cid(value);
|
||||
IdentityAddress peer = addresses[cid];
|
||||
ChatRoomId id(peer, local);
|
||||
RemoteConferenceEventHandler *handler = findHandler(id);
|
||||
|
|
@ -200,13 +199,13 @@ void RemoteConferenceListEventHandler::removeHandler (RemoteConferenceEventHandl
|
|||
handlers.remove(handler);
|
||||
}
|
||||
|
||||
map<IdentityAddress, IdentityAddress> RemoteConferenceListEventHandler::parseRlmi (const string &xmlBody) const {
|
||||
map<string, IdentityAddress> RemoteConferenceListEventHandler::parseRlmi (const string &xmlBody) const {
|
||||
istringstream data(xmlBody);
|
||||
unique_ptr<Xsd::Rlmi::List> rlmi(Xsd::Rlmi::parseList(
|
||||
data,
|
||||
Xsd::XmlSchema::Flags::dont_validate
|
||||
));
|
||||
map<IdentityAddress, IdentityAddress> addresses;
|
||||
map<string, IdentityAddress> addresses;
|
||||
for (const auto &resource : rlmi->getResource()) {
|
||||
if (resource.getInstance().empty())
|
||||
continue;
|
||||
|
|
@ -216,7 +215,7 @@ map<IdentityAddress, IdentityAddress> RemoteConferenceListEventHandler::parseRlm
|
|||
if (!instance.getCid().present())
|
||||
continue;
|
||||
|
||||
IdentityAddress cid(instance.getCid().get());
|
||||
string cid = instance.getCid().get();
|
||||
addresses[cid] = peer;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ private:
|
|||
std::list<RemoteConferenceEventHandler *> handlers;
|
||||
LinphoneEvent *lev = nullptr;
|
||||
|
||||
std::map<IdentityAddress, IdentityAddress> parseRlmi (const std::string &xmlBody) const;
|
||||
std::map<std::string, IdentityAddress> parseRlmi (const std::string &xmlBody) const;
|
||||
|
||||
// CoreListener
|
||||
void onNetworkReachable (bool sipNetworkReachable, bool mediaNetworkReachable) override;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue