summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts/messaging-stream.ts
blob: 63830f7b17e87911577c758cd17383f708ecfab0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;