jormungandr-bite/src/web/app/common/scripts/messaging-stream.ts

22 lines
315 B
TypeScript
Raw Normal View History

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