# HG changeset patch # User Matthew Wild # Date 1265230804 0 # Node ID 20a58dcf2323364093cf243cad4435f34f69b16b # Parent 67b1d93509d33bbe4872b58d66dbfa4cddd913f1 Add getUniqueId() method diff -r 67b1d93509d3 -r 20a58dcf2323 xmpp.js --- a/xmpp.js Wed Feb 03 19:29:21 2010 +0000 +++ b/xmpp.js Wed Feb 03 21:00:04 2010 +0000 @@ -118,6 +118,8 @@ closed: recontext(this, this._stream_closed) }); + this._uniqueId = 0; + return this; }; @@ -145,6 +147,12 @@ this.socket.send(data.toString()); }, + + getUniqueId: function (suffix) + { + return ++this._uniqueId + (suffix?(":"+suffix):""); + }, + // Update the status of the connection, call connect_callback _setStatus: function (status, condition) {