Mercurial > psgxs
comparison nodes.js @ 16:95fc43d1bd54
Don’t regenerate a subid if there is already one.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 19 Oct 2010 18:45:07 +0200 |
parents | 9a6b8b3357c6 |
children | 6697f394301f |
comparison
equal
deleted
inserted
replaced
15:60c80751cfa5 | 16:95fc43d1bd54 |
---|---|
86 delete this.subscribers[jid]; | 86 delete this.subscribers[jid]; |
87 this.metadata['pubsub#num_subscribers']--; | 87 this.metadata['pubsub#num_subscribers']--; |
88 return errors.success; | 88 return errors.success; |
89 } | 89 } |
90 | 90 |
91 if (!subid) | 91 if (!subid) { |
92 subid = makeRandomId(); | 92 if (this.subscribers[jid]) |
93 subid = this.subscribers[jid].subid; | |
94 else | |
95 subid = makeRandomId(); | |
96 } | |
93 | 97 |
94 this.subscribers[jid] = { | 98 this.subscribers[jid] = { |
95 type: type, | 99 type: type, |
96 subid: subid, | 100 subid: subid, |
97 options: new Configuration(service_configuration.subscribe_options, params), | 101 options: new Configuration(service_configuration.subscribe_options, params), |