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