feature/IO-3000-Migrate-MSG-to-Sockets - Major Progress
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -12,6 +12,7 @@ const InstanceManager = require("../utils/instanceMgr").default;
|
||||
|
||||
exports.receive = async (req, res) => {
|
||||
//Perform request validation
|
||||
const { ioRedis } = req;
|
||||
|
||||
logger.log("sms-inbound", "DEBUG", "api", null, {
|
||||
msid: req.body.SmsMessageSid,
|
||||
@@ -108,6 +109,11 @@ exports.receive = async (req, res) => {
|
||||
newMessage,
|
||||
fcmresp
|
||||
});
|
||||
|
||||
// Broadcast new message to the conversation room
|
||||
const room = `conversation-${newMessage.conversationid}`;
|
||||
ioRedis.to(room).emit("new-message", newMessage);
|
||||
|
||||
res.status(200).send("");
|
||||
} catch (e2) {
|
||||
logger.log("sms-inbound-error", "ERROR", "api", null, {
|
||||
|
||||
Reference in New Issue
Block a user