2017-06-09 01:03:54 +09:00
|
|
|
import Stream from './stream';
|
2017-02-18 16:51:11 +09:00
|
|
|
|
2017-06-09 01:03:54 +09:00
|
|
|
/**
|
|
|
|
* Messaging stream connection
|
|
|
|
*/
|
2017-11-17 01:24:44 +09:00
|
|
|
export default class Connection extends Stream {
|
2017-06-09 01:03:54 +09:00
|
|
|
constructor(me, otherparty) {
|
|
|
|
super('messaging', {
|
|
|
|
i: me.token,
|
|
|
|
otherparty
|
|
|
|
});
|
2017-02-18 16:51:11 +09:00
|
|
|
|
2017-11-13 18:05:35 +09:00
|
|
|
(this as any).on('_connected_', () => {
|
2017-06-09 01:03:54 +09:00
|
|
|
this.send({
|
|
|
|
i: me.token
|
|
|
|
});
|
|
|
|
});
|
2017-02-18 16:51:11 +09:00
|
|
|
}
|
|
|
|
}
|