Sharkey/src/client/app/common/scripts/streaming/messaging.ts

21 lines
347 B
TypeScript
Raw Normal View History

2017-06-08 18:03:54 +02:00
import Stream from './stream';
2018-04-29 14:37:51 +02:00
import MiOS from '../../../mios';
2017-02-18 08:51:11 +01:00
2017-06-08 18:03:54 +02:00
/**
* Messaging stream connection
*/
2018-03-07 09:48:32 +01:00
export class MessagingStream extends Stream {
2018-03-15 11:53:46 +01:00
constructor(os: MiOS, me, otherparty) {
super(os, 'messaging', {
2018-04-07 20:58:11 +02:00
i: me.token,
2017-06-08 18:03:54 +02:00
otherparty
});
2017-02-18 08:51:11 +01:00
2017-11-13 10:05:35 +01:00
(this as any).on('_connected_', () => {
2017-06-08 18:03:54 +02:00
this.send({
2018-04-07 20:58:11 +02:00
i: me.token
2017-06-08 18:03:54 +02:00
});
});
2017-02-18 08:51:11 +01:00
}
}