summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts/streaming/messaging.ts
blob: c1b5875cfbe5f256fd94135bd0162d3f47961e40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import Stream from './stream';
import MiOS from '../../mios';

/**
 * Messaging stream connection
 */
export class MessagingStream extends Stream {
	constructor(os: MiOS, me, otherparty) {
		super(os, 'messaging', {
			i: me.token,
			otherparty
		});

		(this as any).on('_connected_', () => {
			this.send({
				i: me.token
			});
		});
	}
}