2018-10-07 04:06:17 +02:00
|
|
|
import autobind from 'autobind-decorator';
|
2021-08-19 11:33:41 +02:00
|
|
|
import Channel from '../channel.js';
|
2018-10-07 04:06:17 +02:00
|
|
|
|
|
|
|
export default class extends Channel {
|
2018-10-11 16:01:57 +02:00
|
|
|
public readonly chName = 'messagingIndex';
|
2018-10-11 16:07:20 +02:00
|
|
|
public static shouldShare = true;
|
2018-11-10 18:22:34 +01:00
|
|
|
public static requireCredential = true;
|
2018-10-11 16:01:57 +02:00
|
|
|
|
2018-10-07 04:06:17 +02:00
|
|
|
@autobind
|
|
|
|
public async init(params: any) {
|
|
|
|
// Subscribe messaging index stream
|
2019-04-12 18:43:22 +02:00
|
|
|
this.subscriber.on(`messagingIndexStream:${this.user!.id}`, data => {
|
2018-10-07 04:06:17 +02:00
|
|
|
this.send(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|