misskey/src/web/app/common/scripts/messaging-stream.ts
2017-11-13 18:05:35 +09:00

24 lines
330 B
TypeScript

'use strict';
import Stream from './stream';
/**
* Messaging stream connection
*/
class Connection extends Stream {
constructor(me, otherparty) {
super('messaging', {
i: me.token,
otherparty
});
(this as any).on('_connected_', () => {
this.send({
i: me.token
});
});
}
}
export default Connection;