Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get author name in the backend #193

Closed
joweste opened this issue Oct 4, 2020 · 2 comments
Closed

Get author name in the backend #193

joweste opened this issue Oct 4, 2020 · 2 comments

Comments

@joweste
Copy link

joweste commented Oct 4, 2020

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);
 }
@stale
Copy link

stale bot commented Oct 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added stale and removed stale labels Oct 11, 2020
@mattmezza
Copy link
Owner

You should be able to accomplish what you want by following the demo app structure in the demo folder.
We are also working on a multi-chat version that also solves the 'me' issue (see #194).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants