diff options
Diffstat (limited to 'src/web/app/common/scripts/messaging-stream.ts')
| -rw-r--r-- | src/web/app/common/scripts/messaging-stream.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/web/app/common/scripts/messaging-stream.ts b/src/web/app/common/scripts/messaging-stream.ts new file mode 100644 index 0000000000..63830f7b17 --- /dev/null +++ b/src/web/app/common/scripts/messaging-stream.ts @@ -0,0 +1,23 @@ +'use strict'; + +import Stream from './stream'; + +/** + * Messaging stream connection + */ +class Connection extends Stream { + constructor(me, otherparty) { + super('messaging', { + i: me.token, + otherparty + }); + + (this as any).on('_connected_', () => { + this.send({ + i: me.token + }); + }); + } +} + +export default Connection; |