versacall-core-library-react 2.0.77-dev → 2.0.78-dev
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.
|
@@ -233,8 +233,6 @@ function onPublish(flags, body) {
|
|
|
233
233
|
const topicLen = body[0] << 8 | body[1];
|
|
234
234
|
if (2 + topicLen > body.length) return;
|
|
235
235
|
const topic = textDecoder.decode(body.slice(2, 2 + topicLen));
|
|
236
|
-
|
|
237
|
-
// QoS > 0 means a 2-byte packet-id follows the topic
|
|
238
236
|
const qos = flags >> 1 & 0x03;
|
|
239
237
|
const payloadStart = 2 + topicLen + (qos > 0 ? 2 : 0);
|
|
240
238
|
const payloadStr = textDecoder.decode(body.slice(payloadStart));
|
|
@@ -244,9 +242,14 @@ function onPublish(flags, body) {
|
|
|
244
242
|
} catch (_) {
|
|
245
243
|
data = payloadStr;
|
|
246
244
|
}
|
|
245
|
+
|
|
246
|
+
// Look up channelName from activeSubscriptions — emitter-io only
|
|
247
|
+
// exposes the channelName (not the full key/name/ MQTT topic)
|
|
248
|
+
const sub = activeSubscriptions.get(topic);
|
|
249
|
+
const channelName = sub ? sub.channelName : topic.replace(/\/$/, '').split('/').slice(1).join('/');
|
|
247
250
|
broadcast({
|
|
248
251
|
type: 'MESSAGE',
|
|
249
|
-
channel:
|
|
252
|
+
channel: channelName,
|
|
250
253
|
data
|
|
251
254
|
});
|
|
252
255
|
}
|
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"versacall": {
|
|
3
3
|
"title": "Versacall Core Library React",
|
|
4
4
|
"applicationType": "react-library",
|
|
5
|
-
"build":
|
|
5
|
+
"build": 78
|
|
6
6
|
},
|
|
7
7
|
"name": "versacall-core-library-react",
|
|
8
|
-
"version": "2.0.
|
|
8
|
+
"version": "2.0.78-dev",
|
|
9
9
|
"description": "Versacall Core Library",
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"module": "dist/index.js",
|