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

Unified Diff: remoting/webapp/crd/js/format_iq.js

Issue 1070223003: [Webapp Refactor] Remove remoting.js. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer's feedback Created 5 years, 8 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 | « remoting/webapp/crd/js/feedback.js ('k') | remoting/webapp/crd/js/remoting.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/format_iq.js
diff --git a/remoting/webapp/crd/js/format_iq.js b/remoting/webapp/crd/js/format_iq.js
index 6fb8e55c2427e39a9712cbc2b64689495567db51..89a5bbe7db441467774a22556652982347dcb9b3 100644
--- a/remoting/webapp/crd/js/format_iq.js
+++ b/remoting/webapp/crd/js/format_iq.js
@@ -14,10 +14,14 @@ var remoting = remoting || {};
/**
* @constructor
+ * @param {string} clientJid
+ * @param {string} hostJid
*/
-remoting.FormatIq = function() {
- this.clientJid = '';
- this.hostJid = '';
+remoting.FormatIq = function(clientJid, hostJid) {
+ /** @private */
+ this.clientJid_ = clientJid;
+ /** @private */
+ this.hostJid_ = hostJid;
};
/**
@@ -44,18 +48,6 @@ remoting.FormatIq.prototype.verifyAttributes = function(node, validAttrs) {
};
/**
- * Record the client and host JIDs so that we can check them against the
- * params in the IQ packets.
- *
- * @param {string} clientJid The client JID string.
- * @param {string} hostJid The host JID string.
- */
-remoting.FormatIq.prototype.setJids = function(clientJid, hostJid) {
- this.clientJid = clientJid;
- this.hostJid = hostJid;
-};
-
-/**
* Calculate the 'pretty' version of data from the |server| node.
*
* @param {Node} server Xml node with server info.
@@ -623,11 +615,11 @@ remoting.FormatIq.prototype.prettyIq = function(send, message) {
var action = '';
var bot = remoting.settings.DIRECTORY_BOT_JID;
if (send) {
- if (to && to != this.hostJid && to != bot) {
+ if (to && to != this.hostJid_ && to != bot) {
console.warn('FormatIq: bad to: ' + to);
return null;
}
- if (from && from != this.clientJid) {
+ if (from && from != this.clientJid_) {
console.warn('FormatIq: bad from: ' + from);
return null;
}
@@ -637,11 +629,11 @@ remoting.FormatIq.prototype.prettyIq = function(send, message) {
action = action + " (to bot)";
}
} else {
- if (to && to != this.clientJid) {
+ if (to && to != this.clientJid_) {
console.warn('FormatIq: bad to: ' + to);
return null;
}
- if (from && from != this.hostJid && from != bot) {
+ if (from && from != this.hostJid_ && from != bot) {
console.warn('FormatIq: bad from: ' + from);
return null;
}
@@ -704,6 +696,3 @@ remoting.FormatIq.prototype.prettifyReceiveIq = function(message) {
}
return result;
};
-
-/** @type {remoting.FormatIq} */
-remoting.formatIq = null;
« no previous file with comments | « remoting/webapp/crd/js/feedback.js ('k') | remoting/webapp/crd/js/remoting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698