Skip to content

Commit

Permalink
Stamp origin-id in messages, same as with id attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
legastero committed Jul 21, 2019
1 parent e548a11 commit bb8189a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,10 @@ export default class Client extends EventEmitter {
}

public sendMessage(data: Message) {
const id = data.id || this.nextId();
const msg = {
id: this.nextId(),
id,
originId: id,
...data
};
this.emit('message:sent', msg, false);
Expand Down

0 comments on commit bb8189a

Please sign in to comment.