symposium 0.11.3 → 0.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Agent.js +7 -8
- package/package.json +1 -1
package/Agent.js
CHANGED
|
@@ -58,7 +58,7 @@ export default class Agent {
|
|
|
58
58
|
async doInitThread(thread) {
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
async getThread(id, i) {
|
|
61
|
+
async getThread(id, i = 'default') {
|
|
62
62
|
let thread = this.threads.get(id);
|
|
63
63
|
if (thread) {
|
|
64
64
|
if (thread.interface !== i)
|
|
@@ -161,15 +161,14 @@ export default class Agent {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
async output(thread, msg) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
await callback(msg);
|
|
169
|
-
}
|
|
164
|
+
if (this.callbacks.hasOwnProperty(thread.interface + '-' + thread.id) && this.callbacks[thread.interface + '-' + thread.id].length) {
|
|
165
|
+
const callback = this.callbacks[thread.interface + '-' + thread.id].shift();
|
|
166
|
+
await callback(msg);
|
|
167
|
+
}
|
|
170
168
|
|
|
169
|
+
const i = this.options.interfaces.find(i => i.name === thread.interface);
|
|
170
|
+
if (i)
|
|
171
171
|
return i.output(thread, msg);
|
|
172
|
-
}
|
|
173
172
|
}
|
|
174
173
|
|
|
175
174
|
parseFunctions(message) {
|