Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2841)

Unified Diff: remoting/protocol/jingle_messages.cc

Issue 1999443004: Clear the channel and endpoint_id in SetAddress for the XMPP channel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/jingle_messages.cc
diff --git a/remoting/protocol/jingle_messages.cc b/remoting/protocol/jingle_messages.cc
index 57f9968e4ad3392e7a5df5445c94e5c2ddad4471..e9cf485aed75040f11e6899dd9d5d8d9659e0aed 100644
--- a/remoting/protocol/jingle_messages.cc
+++ b/remoting/protocol/jingle_messages.cc
@@ -202,6 +202,9 @@ void SetAddress(buzz::XmlElement* iqElement,
const SignalingAddress& address,
bool from) {
if (address.empty()) {
+ iqElement->ClearAttr(GetQNameByField(Field::JID, from));
+ iqElement->ClearAttr(GetQNameByField(Field::CHANNEL, from));
+ iqElement->ClearAttr(GetQNameByField(Field::ENDPOINT_ID, from));
Jamie 2016/05/20 00:48:35 I think it might be clearer to clear everything up
return;
}
@@ -212,6 +215,9 @@ void SetAddress(buzz::XmlElement* iqElement,
address.endpoint_id);
const char* channel_str = ValueToName(kChannelTypes, address.channel);
iqElement->AddAttr(GetQNameByField(Field::CHANNEL, from), channel_str);
+ } else {
+ iqElement->ClearAttr(GetQNameByField(Field::CHANNEL, from));
+ iqElement->ClearAttr(GetQNameByField(Field::ENDPOINT_ID, from));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698