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

Chat message hooks - external-user-id shows user name rather than ID (and is missing in 3.0) #42

Open
MWWorks opened this issue Jan 30, 2024 · 1 comment
Assignees

Comments

@MWWorks
Copy link

MWWorks commented Jan 30, 2024

In messageMapping.js:

chatTemplate(messageObj)
...
          "sender":{
            "internal-user-id": body.msg.sender.id,
            "external-user-id": body.msg.sender.name,
            "timezone-offset": body.msg.fromTimezoneOffset,
            "time": body.msg.timestamp
          }

external-user-id actually returns the external user name - also this seems missing completely in v3's event.js. The external user ID makes this more useful on the receiving server end.

This seems transitional between 2.6 and 3 so I'm not sure if I should add a PR - but I have fixed mine with:

chatTemplate(messageObj)
...
          "sender":{
            "internal-user-id": body.msg.sender.id,
            "external-user-id": UserMapping.getExternalUserID(body.msg.sender.id), //mw fix this to id instead of name above
            "user-name": body.msg.sender.name, //and provide name separately
            "timezone-offset": body.msg.fromTimezoneOffset,
            "time": body.msg.timestamp
          }

@prlanzarin
Copy link
Member

Thanks for the report, will review in v2 and v3.

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

No branches or pull requests

2 participants