2017-06-08 10:03:54 -06:00
|
|
|
import Stream from './stream';
|
2018-04-29 06:37:51 -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', {
|
2018-04-07 12:58:11 -06:00
|
|
|
i: me.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({
|
2018-04-07 12:58:11 -06:00
|
|
|
i: me.token
|
2017-06-08 10:03:54 -06:00
|
|
|
});
|
|
|
|
});
|
2017-02-18 00:51:11 -07:00
|
|
|
}
|
|
|
|
}
|