# HG changeset patch # User Emmanuel Gil Peyrot # Date 1287506707 -7200 # Node ID 95fc43d1bd54bef55f17fd81f0ccb1ef356a2ebe # Parent 60c80751cfa51dbd8c743a915b833afd0b142417 Don’t regenerate a subid if there is already one. diff --git a/nodes.js b/nodes.js --- a/nodes.js +++ b/nodes.js @@ -88,8 +88,12 @@ exports.Node.prototype = { return errors.success; } - if (!subid) - subid = makeRandomId(); + if (!subid) { + if (this.subscribers[jid]) + subid = this.subscribers[jid].subid; + else + subid = makeRandomId(); + } this.subscribers[jid] = { type: type,