iceshrimp/src/web/app/common/scripts/messaging-stream.js

24 lines
321 B
JavaScript
Raw Normal View History

2017-06-09 01:03:54 +09:00
'use strict';
2017-02-18 16:51:11 +09:00
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
*/
class Connection extends Stream {
constructor(me, otherparty) {
super('messaging', {
i: me.token,
otherparty
});
2017-02-18 16:51:11 +09:00
2017-06-09 01:03:54 +09:00
this.on('_connected_', () => {
this.send({
i: me.token
});
});
2017-02-18 16:51:11 +09:00
}
}
2017-03-18 20:05:11 +09:00
export default Connection;