mizzkey/src/web/app/common/scripts/streaming/messaging-stream.ts

20 lines
302 B
TypeScript
Raw Normal View History

2017-06-08 18:03:54 +02:00
import Stream from './stream';
2017-02-18 08:51:11 +01:00
2017-06-08 18:03:54 +02:00
/**
* Messaging stream connection
*/
2017-11-16 17:24:44 +01:00
export default class Connection extends Stream {
2017-06-08 18:03:54 +02:00
constructor(me, otherparty) {
super('messaging', {
i: me.token,
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({
i: me.token
});
});
2017-02-18 08:51:11 +01:00
}
}