Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

meta field access otb on pn msg in chat engine #277

Closed
wants to merge 1 commit into from
Closed

Conversation

ajb413
Copy link
Contributor

@ajb413 ajb413 commented Jan 17, 2018

Allow a developer to add properties to the meta object on a pubnub request. this can be used for auth tokens.

@@ -57,9 +57,13 @@ class Event {

m.event = this.event;

let meta = m.data.meta;
delete m.data.meta;
Copy link
Contributor

@ianjennings ianjennings Jan 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not modify payload.data or use it for configuration as this is "userland" and they will expect this object to be identical. ChatEngine should not care what payload.data is ever.

For example, a negative case would be where the user suppliespayload.data.meta for their own application, and the data will be removed and reassigned without their knowledge.

My first instinct is to supply this information within chat.emit and pass the information into event.publish.
https://github.com/pubnub/chat-engine/blob/meta/src/components/chat.js#L285

this.chatEngine.pubnub.publish({
message: m,
channel: this.channel
channel: this.channel,
meta: meta
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be meta without meta: meta

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

Successfully merging this pull request may close these issues.

3 participants