Commit c02834a2 by Chavee Issariyapat

support tap private message

parent fffd1094
......@@ -88,12 +88,18 @@ const Coordinator = function(param={}) {
that.mqttclient.publish(outtopic, outmsg);
break;
default:
if (topic.startsWith('@local/msgout/')) {
let part = topic.substr(14);
outtopic = `@tap/msg/topic/${deviceid}:${devicetoken}/${part}`;
outmsg = payload.toString();
that.mqttclient.publish(outtopic, outmsg);
}
if (topic.startsWith('@local/msgout/')) {
let part = topic.substr(14);
outtopic = `@tap/msg/topic/${deviceid}:${devicetoken}/${part}`;
outmsg = payload.toString();
that.mqttclient.publish(outtopic, outmsg);
}
else if(topic.startsWith('@local/prvout/')) {
let part = topic.substr(14);
outtopic = `@tap/private/topic/${deviceid}:${devicetoken}/${part}`;
outmsg = payload.toString();
that.mqttclient.publish(outtopic, outmsg);
}
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment