jormungandr-bite/src/client/app/common/scripts/streaming/messaging.ts

21 lines
360 B
TypeScript
Raw Normal View History

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