feature/IO-3000-messaging-sockets-migrations2 -
- sync send - fix status events Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -36,7 +36,9 @@ exports.status = async (req, res) => {
|
||||
});
|
||||
|
||||
ioRedis.to(conversationRoom).emit("message-changed", {
|
||||
message
|
||||
...message,
|
||||
status: SmsStatus,
|
||||
type: "status-changed"
|
||||
});
|
||||
} else {
|
||||
logger.log("sms-status-update-warning", "WARN", "api", null, {
|
||||
@@ -80,21 +82,11 @@ exports.markConversationRead = async (req, res) => {
|
||||
|
||||
const broadcastRoom = getBodyshopRoom(bodyshopid);
|
||||
|
||||
const conversationRoom = getBodyshopConversationRoom({
|
||||
bodyshopId: bodyshopid,
|
||||
conversationId: conversationid
|
||||
});
|
||||
|
||||
ioRedis.to(broadcastRoom).emit("conversation-changed", {
|
||||
type: "conversation-marked-read",
|
||||
conversationId: conversationid
|
||||
});
|
||||
|
||||
ioRedis.to(conversationRoom).emit("message-changed", {
|
||||
type: "all-messages-marked-read",
|
||||
conversationId: conversationid
|
||||
});
|
||||
|
||||
res.status(200).json({ success: true, message: "Conversation marked as read." });
|
||||
} catch (error) {
|
||||
logger.log("conversation-mark-read-error", "ERROR", "api", null, {
|
||||
|
||||
Reference in New Issue
Block a user