From c614e6f5d73b3b4314c7f6abf52260e58cc176ad Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 17 Nov 2017 01:24:44 +0900 Subject: #925, #926, and refactoring --- .../app/common/scripts/streaming/messaging-stream.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/web/app/common/scripts/streaming/messaging-stream.ts (limited to 'src/web/app/common/scripts/streaming/messaging-stream.ts') diff --git a/src/web/app/common/scripts/streaming/messaging-stream.ts b/src/web/app/common/scripts/streaming/messaging-stream.ts new file mode 100644 index 0000000000..68dfc5ec09 --- /dev/null +++ b/src/web/app/common/scripts/streaming/messaging-stream.ts @@ -0,0 +1,19 @@ +import Stream from './stream'; + +/** + * Messaging stream connection + */ +export default class Connection extends Stream { + constructor(me, otherparty) { + super('messaging', { + i: me.token, + otherparty + }); + + (this as any).on('_connected_', () => { + this.send({ + i: me.token + }); + }); + } +} -- cgit v1.2.3-freya