Commit 0f69b02c authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #28351: im: use range-based for loops

parent 63502022
......@@ -99,20 +99,17 @@ void InstantMessaging::sip_send(pjsip_inv_session *session, const std::string& i
void InstantMessaging::send_sip_message(pjsip_inv_session *session, const std::string &id, const std::string &message)
{
std::vector<std::string> msgs(split_message(message));
std::vector<std::string>::const_iterator iter;
for (iter = msgs.begin(); iter != msgs.end(); ++iter)
sip_send(session, id, *iter);
for (const auto &iter : msgs)
sip_send(session, id, iter);
}
#if HAVE_IAX
void InstantMessaging::send_iax_message(iax_session *session, const std::string &/* id */, const std::string &message)
{
std::vector<std::string> msgs(split_message(message));
std::vector<std::string>::const_iterator iter;
for (iter = msgs.begin(); iter != msgs.end(); ++iter)
iax_send_text(session, (*iter).c_str());
for (const auto &iter : msgs)
iax_send_text(session, iter.c_str());
}
#endif
......@@ -138,8 +135,8 @@ std::string InstantMessaging::generateXmlUriList(UriList &list)
"<resource-lists xmlns=\"urn:ietf:params:xml:ns:resource-lists\" xmlns:cp=\"urn:ietf:params:xml:ns:copycontrol\">"
"<list>";
for (UriList::iterator iter = list.begin(); iter != list.end(); ++iter)
xmlbuffer += "<entry uri=" + (*iter)[sfl::IM_XML_URI] + " cp:copyControl=\"to\" />";
for (auto &iter : list)
xmlbuffer += "<entry uri=" + iter[sfl::IM_XML_URI] + " cp:copyControl=\"to\" />";
return xmlbuffer + "</list></resource-lists>";
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment