Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

xmpp.js 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. /* global $ */
  2. import { getLogger } from 'jitsi-meet-logger';
  3. import { $msg, Strophe } from 'strophe.js';
  4. import 'strophejs-plugin-disco';
  5. import RandomUtil from '../util/RandomUtil';
  6. import * as JitsiConnectionErrors from '../../JitsiConnectionErrors';
  7. import * as JitsiConnectionEvents from '../../JitsiConnectionEvents';
  8. import browser from '../browser';
  9. import initEmuc from './strophe.emuc';
  10. import initJingle from './strophe.jingle';
  11. import initStropheUtil from './strophe.util';
  12. import initPing from './strophe.ping';
  13. import initRayo from './strophe.rayo';
  14. import initStropheLogger from './strophe.logger';
  15. import Listenable from '../util/Listenable';
  16. import Caps from './Caps';
  17. import GlobalOnErrorHandler from '../util/GlobalOnErrorHandler';
  18. import XMPPEvents from '../../service/xmpp/XMPPEvents';
  19. const logger = getLogger(__filename);
  20. /**
  21. *
  22. * @param token
  23. * @param bosh
  24. */
  25. function createConnection(token, bosh = '/http-bind') {
  26. // Append token as URL param
  27. if (token) {
  28. // eslint-disable-next-line no-param-reassign
  29. bosh += `${bosh.indexOf('?') === -1 ? '?' : '&'}token=${token}`;
  30. }
  31. const conn = new Strophe.Connection(bosh);
  32. // The default maxRetries is 5, which is too long.
  33. conn.maxRetries = 3;
  34. return conn;
  35. }
  36. /**
  37. * The name of the field used to recognize a chat message as carrying a JSON
  38. * payload from another endpoint.
  39. * If the json-message of a chat message contains a valid JSON object, and
  40. * the JSON has this key, then it is a valid json-message to be sent.
  41. */
  42. export const JITSI_MEET_MUC_TYPE = 'type';
  43. /**
  44. *
  45. */
  46. export default class XMPP extends Listenable {
  47. /**
  48. * FIXME describe all options
  49. * @param {Object} options
  50. * @param {Array<Object>} options.p2pStunServers see
  51. * {@link JingleConnectionPlugin} for more details.
  52. * @param token
  53. */
  54. constructor(options, token) {
  55. super();
  56. this.connection = null;
  57. this.disconnectInProgress = false;
  58. this.connectionTimes = {};
  59. this.options = options;
  60. this.token = token;
  61. this.authenticatedUser = false;
  62. this._initStrophePlugins(this);
  63. this.connection = createConnection(token, options.bosh);
  64. this.caps = new Caps(this.connection, this.options.clientNode);
  65. // Initialize features advertised in disco-info
  66. this.initFeaturesList();
  67. // Setup a disconnect on unload as a way to facilitate API consumers. It
  68. // sounds like they would want that. A problem for them though may be if
  69. // they wanted to utilize the connected connection in an unload handler
  70. // of their own. However, it should be fairly easy for them to do that
  71. // by registering their unload handler before us.
  72. $(window).on('beforeunload unload', this.disconnect.bind(this));
  73. }
  74. /**
  75. * Initializes the list of feature advertised through the disco-info
  76. * mechanism.
  77. */
  78. initFeaturesList() {
  79. // http://xmpp.org/extensions/xep-0167.html#support
  80. // http://xmpp.org/extensions/xep-0176.html#support
  81. this.caps.addFeature('urn:xmpp:jingle:1');
  82. this.caps.addFeature('urn:xmpp:jingle:apps:rtp:1');
  83. this.caps.addFeature('urn:xmpp:jingle:transports:ice-udp:1');
  84. this.caps.addFeature('urn:xmpp:jingle:apps:dtls:0');
  85. this.caps.addFeature('urn:xmpp:jingle:transports:dtls-sctp:1');
  86. this.caps.addFeature('urn:xmpp:jingle:apps:rtp:audio');
  87. this.caps.addFeature('urn:xmpp:jingle:apps:rtp:video');
  88. if (!this.options.disableRtx && browser.supportsRtx()) {
  89. this.caps.addFeature('urn:ietf:rfc:4588');
  90. }
  91. // this is dealt with by SDP O/A so we don't need to announce this
  92. // XEP-0293
  93. // this.caps.addFeature('urn:xmpp:jingle:apps:rtp:rtcp-fb:0');
  94. // XEP-0294
  95. // this.caps.addFeature('urn:xmpp:jingle:apps:rtp:rtp-hdrext:0');
  96. this.caps.addFeature('urn:ietf:rfc:5761'); // rtcp-mux
  97. this.caps.addFeature('urn:ietf:rfc:5888'); // a=group, e.g. bundle
  98. // this.caps.addFeature('urn:ietf:rfc:5576'); // a=ssrc
  99. // Enable Lipsync ?
  100. if (browser.isChrome() && this.options.enableLipSync !== false) {
  101. logger.info('Lip-sync enabled !');
  102. this.caps.addFeature('http://jitsi.org/meet/lipsync');
  103. }
  104. if (this.connection.rayo) {
  105. this.caps.addFeature('urn:xmpp:rayo:client:1');
  106. }
  107. }
  108. /**
  109. *
  110. */
  111. getConnection() {
  112. return this.connection;
  113. }
  114. /**
  115. * Receive connection status changes and handles them.
  116. *
  117. * @param {Object} credentials
  118. * @param {string} credentials.jid - The user's XMPP ID passed to the
  119. * connect method. For example, 'user@xmpp.com'.
  120. * @param {string} credentials.password - The password passed to the connect
  121. * method.
  122. * @param {string} status - One of Strophe's connection status strings.
  123. * @param {string} [msg] - The connection error message provided by Strophe.
  124. */
  125. connectionHandler(credentials = {}, status, msg) {
  126. const now = window.performance.now();
  127. const statusStr = Strophe.getStatusString(status).toLowerCase();
  128. this.connectionTimes[statusStr] = now;
  129. logger.log(
  130. `(TIME) Strophe ${statusStr}${msg ? `[${msg}]` : ''}:\t`,
  131. now);
  132. if (status === Strophe.Status.CONNECTED
  133. || status === Strophe.Status.ATTACHED) {
  134. if (this.options.useStunTurn
  135. || (this.options.p2p && this.options.p2p.useStunTurn)) {
  136. this.connection.jingle.getStunAndTurnCredentials();
  137. }
  138. logger.info(`My Jabber ID: ${this.connection.jid}`);
  139. // Schedule ping ?
  140. const pingJid = this.connection.domain;
  141. this.caps.getFeaturesAndIdentities(pingJid)
  142. .then(({ features, identities }) => {
  143. if (features.has(Strophe.NS.PING)) {
  144. this.connection.ping.startInterval(pingJid);
  145. } else {
  146. logger.warn(`Ping NOT supported by ${pingJid}`);
  147. }
  148. // check for speakerstats
  149. identities.forEach(identity => {
  150. if (identity.type === 'speakerstats') {
  151. this.speakerStatsComponentAddress = identity.name;
  152. this.connection.addHandler(
  153. this._onPrivateMessage.bind(this), null,
  154. 'message', null, null);
  155. }
  156. });
  157. })
  158. .catch(error => {
  159. const errmsg = 'Feature discovery error';
  160. GlobalOnErrorHandler.callErrorHandler(
  161. new Error(`${errmsg}: ${error}`));
  162. logger.error(errmsg, error);
  163. });
  164. if (credentials.password) {
  165. this.authenticatedUser = true;
  166. }
  167. if (this.connection && this.connection.connected
  168. && Strophe.getResourceFromJid(this.connection.jid)) {
  169. // .connected is true while connecting?
  170. // this.connection.send($pres());
  171. this.eventEmitter.emit(
  172. JitsiConnectionEvents.CONNECTION_ESTABLISHED,
  173. Strophe.getResourceFromJid(this.connection.jid));
  174. }
  175. } else if (status === Strophe.Status.CONNFAIL) {
  176. if (msg === 'x-strophe-bad-non-anon-jid') {
  177. this.anonymousConnectionFailed = true;
  178. } else {
  179. this.connectionFailed = true;
  180. }
  181. this.lastErrorMsg = msg;
  182. if (msg === 'giving-up') {
  183. this.eventEmitter.emit(
  184. JitsiConnectionEvents.CONNECTION_FAILED,
  185. JitsiConnectionErrors.OTHER_ERROR, msg);
  186. }
  187. } else if (status === Strophe.Status.DISCONNECTED) {
  188. // Stop ping interval
  189. this.connection.ping.stopInterval();
  190. const wasIntentionalDisconnect = this.disconnectInProgress;
  191. const errMsg = msg || this.lastErrorMsg;
  192. this.disconnectInProgress = false;
  193. if (this.anonymousConnectionFailed) {
  194. // prompt user for username and password
  195. this.eventEmitter.emit(
  196. JitsiConnectionEvents.CONNECTION_FAILED,
  197. JitsiConnectionErrors.PASSWORD_REQUIRED);
  198. } else if (this.connectionFailed) {
  199. this.eventEmitter.emit(
  200. JitsiConnectionEvents.CONNECTION_FAILED,
  201. JitsiConnectionErrors.OTHER_ERROR,
  202. errMsg,
  203. undefined, /* credentials */
  204. this._getConnectionFailedReasonDetails());
  205. } else if (wasIntentionalDisconnect) {
  206. this.eventEmitter.emit(
  207. JitsiConnectionEvents.CONNECTION_DISCONNECTED, errMsg);
  208. } else {
  209. // XXX if Strophe drops the connection while not being asked to,
  210. // it means that most likely some serious error has occurred.
  211. // One currently known case is when a BOSH request fails for
  212. // more than 4 times. The connection is dropped without
  213. // supplying a reason(error message/event) through the API.
  214. logger.error('XMPP connection dropped!');
  215. // XXX if the last request error is within 5xx range it means it
  216. // was a server failure
  217. const lastErrorStatus = Strophe.getLastErrorStatus();
  218. if (lastErrorStatus >= 500 && lastErrorStatus < 600) {
  219. this.eventEmitter.emit(
  220. JitsiConnectionEvents.CONNECTION_FAILED,
  221. JitsiConnectionErrors.SERVER_ERROR,
  222. errMsg || 'server-error');
  223. } else {
  224. this.eventEmitter.emit(
  225. JitsiConnectionEvents.CONNECTION_FAILED,
  226. JitsiConnectionErrors.CONNECTION_DROPPED_ERROR,
  227. errMsg || 'connection-dropped-error');
  228. }
  229. }
  230. } else if (status === Strophe.Status.AUTHFAIL) {
  231. // wrong password or username, prompt user
  232. this.eventEmitter.emit(
  233. JitsiConnectionEvents.CONNECTION_FAILED,
  234. JitsiConnectionErrors.PASSWORD_REQUIRED,
  235. msg,
  236. credentials);
  237. }
  238. }
  239. /**
  240. *
  241. * @param jid
  242. * @param password
  243. */
  244. _connect(jid, password) {
  245. // connection.connect() starts the connection process.
  246. //
  247. // As the connection process proceeds, the user supplied callback will
  248. // be triggered multiple times with status updates. The callback should
  249. // take two arguments - the status code and the error condition.
  250. //
  251. // The status code will be one of the values in the Strophe.Status
  252. // constants. The error condition will be one of the conditions defined
  253. // in RFC 3920 or the condition ‘strophe-parsererror’.
  254. //
  255. // The Parameters wait, hold and route are optional and only relevant
  256. // for BOSH connections. Please see XEP 124 for a more detailed
  257. // explanation of the optional parameters.
  258. //
  259. // Connection status constants for use by the connection handler
  260. // callback.
  261. //
  262. // Status.ERROR - An error has occurred (websockets specific)
  263. // Status.CONNECTING - The connection is currently being made
  264. // Status.CONNFAIL - The connection attempt failed
  265. // Status.AUTHENTICATING - The connection is authenticating
  266. // Status.AUTHFAIL - The authentication attempt failed
  267. // Status.CONNECTED - The connection has succeeded
  268. // Status.DISCONNECTED - The connection has been terminated
  269. // Status.DISCONNECTING - The connection is currently being terminated
  270. // Status.ATTACHED - The connection has been attached
  271. this.anonymousConnectionFailed = false;
  272. this.connectionFailed = false;
  273. this.lastErrorMsg = undefined;
  274. this.connection.connect(
  275. jid,
  276. password,
  277. this.connectionHandler.bind(this, {
  278. jid,
  279. password
  280. }));
  281. }
  282. /**
  283. * Attach to existing connection. Can be used for optimizations. For
  284. * example: if the connection is created on the server we can attach to it
  285. * and start using it.
  286. *
  287. * @param options {object} connecting options - rid, sid, jid and password.
  288. */
  289. attach(options) {
  290. const now = this.connectionTimes.attaching = window.performance.now();
  291. logger.log(`(TIME) Strophe Attaching\t:${now}`);
  292. this.connection.attach(options.jid, options.sid,
  293. parseInt(options.rid, 10) + 1,
  294. this.connectionHandler.bind(this, {
  295. jid: options.jid,
  296. password: options.password
  297. }));
  298. }
  299. /**
  300. *
  301. * @param jid
  302. * @param password
  303. */
  304. connect(jid, password) {
  305. if (!jid) {
  306. const { anonymousdomain, domain } = this.options.hosts;
  307. let configDomain = anonymousdomain || domain;
  308. // Force authenticated domain if room is appended with '?login=true'
  309. // or if we're joining with the token
  310. // FIXME Do not rely on window.location because (1) React Native
  311. // does not have a window.location by default and (2) here we cannot
  312. // know for sure that query/search has not be stripped from
  313. // window.location by the time the following executes.
  314. const { location } = window;
  315. if (anonymousdomain) {
  316. const search = location && location.search;
  317. if ((search && search.indexOf('login=true') !== -1)
  318. || this.token) {
  319. configDomain = domain;
  320. }
  321. }
  322. // eslint-disable-next-line no-param-reassign
  323. jid = configDomain || (location && location.hostname);
  324. }
  325. return this._connect(jid, password);
  326. }
  327. /**
  328. *
  329. * @param roomName
  330. * @param options
  331. */
  332. createRoom(roomName, options) {
  333. // By default MUC nickname is the resource part of the JID
  334. let mucNickname = Strophe.getNodeFromJid(this.connection.jid);
  335. let roomjid = `${roomName}@${this.options.hosts.muc}/`;
  336. const cfgNickname
  337. = options.useNicks && options.nick ? options.nick : null;
  338. if (cfgNickname) {
  339. // Use nick if it's defined
  340. mucNickname = options.nick;
  341. } else if (!this.authenticatedUser) {
  342. // node of the anonymous JID is very long - here we trim it a bit
  343. mucNickname = mucNickname.substr(0, 8);
  344. }
  345. // Constant JIDs need some random part to be appended in order to be
  346. // able to join the MUC more than once.
  347. if (this.authenticatedUser || cfgNickname !== null) {
  348. mucNickname += `-${RandomUtil.randomHexString(6)}`;
  349. }
  350. roomjid += mucNickname;
  351. return this.connection.emuc.createRoom(roomjid, null, options);
  352. }
  353. /**
  354. * Returns the logs from strophe.jingle.
  355. * @returns {Object}
  356. */
  357. getJingleLog() {
  358. const jingle = this.connection.jingle;
  359. return jingle ? jingle.getLog() : {};
  360. }
  361. /**
  362. * Returns the logs from strophe.
  363. */
  364. getXmppLog() {
  365. return (this.connection.logger || {}).log || null;
  366. }
  367. /**
  368. *
  369. */
  370. dial(...args) {
  371. this.connection.rayo.dial(...args);
  372. }
  373. /**
  374. *
  375. * @param jid
  376. * @param mute
  377. */
  378. setMute(jid, mute) {
  379. this.connection.moderate.setMute(jid, mute);
  380. }
  381. /**
  382. *
  383. * @param jid
  384. */
  385. eject(jid) {
  386. this.connection.moderate.eject(jid);
  387. }
  388. /**
  389. *
  390. */
  391. getSessions() {
  392. return this.connection.jingle.sessions;
  393. }
  394. /**
  395. * Disconnects this from the XMPP server (if this is connected).
  396. *
  397. * @param ev optionally, the event which triggered the necessity to
  398. * disconnect from the XMPP server (e.g. beforeunload, unload).
  399. */
  400. disconnect(ev) {
  401. if (this.disconnectInProgress || !this.connection) {
  402. this.eventEmitter.emit(JitsiConnectionEvents.WRONG_STATE);
  403. return;
  404. }
  405. this.disconnectInProgress = true;
  406. // XXX Strophe is asynchronously sending by default. Unfortunately, that
  407. // means that there may not be enough time to send an unavailable
  408. // presence or disconnect at all. Switching Strophe to synchronous
  409. // sending is not much of an option because it may lead to a noticeable
  410. // delay in navigating away from the current location. As a compromise,
  411. // we will try to increase the chances of sending an unavailable
  412. // presence and/or disconecting within the short time span that we have
  413. // upon unloading by invoking flush() on the connection. We flush() once
  414. // before disconnect() in order to attemtp to have its unavailable
  415. // presence at the top of the send queue. We flush() once more after
  416. // disconnect() in order to attempt to have its unavailable presence
  417. // sent as soon as possible.
  418. this.connection.flush();
  419. if (ev !== null && typeof ev !== 'undefined') {
  420. const evType = ev.type;
  421. if (evType === 'beforeunload' || evType === 'unload') {
  422. // XXX Whatever we said above, synchronous sending is the best
  423. // (known) way to properly disconnect from the XMPP server.
  424. // Consequently, it may be fine to have the source code and
  425. // comment it in or out depending on whether we want to run with
  426. // it for some time.
  427. this.connection.options.sync = true;
  428. }
  429. }
  430. this.connection.disconnect();
  431. if (this.connection.options.sync !== true) {
  432. this.connection.flush();
  433. }
  434. }
  435. /**
  436. *
  437. */
  438. _initStrophePlugins() {
  439. const iceConfig = {
  440. jvb: { iceServers: [ ] },
  441. p2p: { iceServers: [ ] }
  442. };
  443. // FIXME: remove once we have a default config template. -saghul
  444. const defaultStunServers = [
  445. { urls: 'stun:stun.l.google.com:19302' },
  446. { urls: 'stun:stun1.l.google.com:19302' },
  447. { urls: 'stun:stun2.l.google.com:19302' }
  448. ];
  449. const p2pStunServers = (this.options.p2p
  450. && this.options.p2p.stunServers) || defaultStunServers;
  451. if (Array.isArray(p2pStunServers)) {
  452. logger.info('P2P STUN servers: ', p2pStunServers);
  453. iceConfig.p2p.iceServers = p2pStunServers;
  454. }
  455. if (this.options.p2p && this.options.p2p.iceTransportPolicy) {
  456. logger.info('P2P ICE transport policy: ',
  457. this.options.p2p.iceTransportPolicy);
  458. iceConfig.p2p.iceTransportPolicy
  459. = this.options.p2p.iceTransportPolicy;
  460. }
  461. initEmuc(this);
  462. initJingle(this, this.eventEmitter, iceConfig);
  463. initStropheUtil();
  464. initPing(this);
  465. initRayo();
  466. initStropheLogger();
  467. }
  468. /**
  469. * Returns details about connection failure. Shard change or is it after
  470. * suspend.
  471. * @returns {object} contains details about a connection failure.
  472. * @private
  473. */
  474. _getConnectionFailedReasonDetails() {
  475. const details = {};
  476. // check for moving between shard if information is available
  477. if (this.options.deploymentInfo
  478. && this.options.deploymentInfo.shard
  479. && this.connection._proto
  480. && this.connection._proto.lastResponseHeaders) {
  481. // split headers by line
  482. const headersArr = this.connection._proto.lastResponseHeaders
  483. .trim().split(/[\r\n]+/);
  484. const headers = {};
  485. headersArr.forEach(line => {
  486. const parts = line.split(': ');
  487. const header = parts.shift();
  488. const value = parts.join(': ');
  489. headers[header] = value;
  490. });
  491. /* eslint-disable camelcase */
  492. details.shard_changed
  493. = this.options.deploymentInfo.shard
  494. !== headers['x-jitsi-shard'];
  495. /* eslint-enable camelcase */
  496. }
  497. /* eslint-disable camelcase */
  498. // check for possible suspend
  499. details.suspend_time = this.connection.ping.getPingSuspendTime();
  500. /* eslint-enable camelcase */
  501. return details;
  502. }
  503. /**
  504. * Notifies speaker stats component if available that we are the new
  505. * dominant speaker in the conference.
  506. * @param {String} roomJid - The room jid where the speaker event occurred.
  507. */
  508. sendDominantSpeakerEvent(roomJid) {
  509. // no speaker stats component advertised
  510. if (!this.speakerStatsComponentAddress || !roomJid) {
  511. return;
  512. }
  513. const msg = $msg({ to: this.speakerStatsComponentAddress });
  514. msg.c('speakerstats', {
  515. xmlns: 'http://jitsi.org/jitmeet',
  516. room: `${roomJid}` })
  517. .up();
  518. this.connection.send(msg);
  519. }
  520. /**
  521. * Check if the given argument is a valid JSON ENDPOINT_MESSAGE string by
  522. * parsing it and checking if it has a field called 'type'.
  523. *
  524. * @param {string} jsonString check if this string is a valid json string
  525. * and contains the special structure.
  526. * @returns {boolean, object} if given object is a valid JSON string, return
  527. * the json object. Otherwise, returns false.
  528. */
  529. tryParseJSONAndVerify(jsonString) {
  530. try {
  531. const json = JSON.parse(jsonString);
  532. // Handle non-exception-throwing cases:
  533. // Neither JSON.parse(false) or JSON.parse(1234) throw errors,
  534. // hence the type-checking,
  535. // but... JSON.parse(null) returns null, and
  536. // typeof null === "object",
  537. // so we must check for that, too.
  538. // Thankfully, null is falsey, so this suffices:
  539. if (json && typeof json === 'object') {
  540. const type = json[JITSI_MEET_MUC_TYPE];
  541. if (typeof type !== 'undefined') {
  542. return json;
  543. }
  544. logger.debug('parsing valid json but does not have correct '
  545. + 'structure', 'topic: ', type);
  546. }
  547. } catch (e) {
  548. return false;
  549. }
  550. return false;
  551. }
  552. /**
  553. * A private message is received, message that is not addressed to the muc.
  554. * We expect private message coming from speaker stats component if it is
  555. * enabled and running.
  556. *
  557. * @param {string} msg - The message.
  558. */
  559. _onPrivateMessage(msg) {
  560. const from = msg.getAttribute('from');
  561. if (!this.speakerStatsComponentAddress
  562. || from !== this.speakerStatsComponentAddress) {
  563. return;
  564. }
  565. const jsonMessage = $(msg).find('>json-message')
  566. .text();
  567. const parsedJson = this.tryParseJSONAndVerify(jsonMessage);
  568. if (parsedJson
  569. && parsedJson[JITSI_MEET_MUC_TYPE] === 'speakerstats'
  570. && parsedJson.users) {
  571. this.eventEmitter.emit(
  572. XMPPEvents.SPEAKER_STATS_RECEIVED, parsedJson.users);
  573. }
  574. return true;
  575. }
  576. }