-
Notifications
You must be signed in to change notification settings - Fork 450
Closed
Description
Hi, I need to show the message author when I receive the message in the front end app.
I am using node with socket io on backend.
When I send a message as abaixo, the component change always the author name to "me".
So, in the node backend, I have no author name that sent the message. I get only "me".
How could I get the original author of the message on backend?
Do I have to use an additional property in the json message?
Maybe I am wrong, but it is very odd I have to do it.
For sample if I do a broadcast on server to all connected users using socket io, I have only "me" as author.
All users will receive "me".
const msg={
author: "John",
type: "text",
id: Math.round(Date.now() / 10),
data: { text: text, meta: moment().format("h:mm a") },
});
}
},
onMessageWasSent(message) {
this.$socket.client.emit("user_message", msg);
}
Metadata
Metadata
Assignees
Labels
No labels