共有可能チャンネルに接続しようとしていて、かつそのチャンネルに既に接続していたら無意味なので無視するように

This commit is contained in:
syuilo
2018-10-11 23:01:57 +09:00
parent ad67886f96
commit e85f9f4aa5
17 changed files with 59 additions and 11 deletions

View File

@@ -2,6 +2,9 @@ import autobind from 'autobind-decorator';
import Channel from '../channel';
export default class extends Channel {
public readonly chName = 'drive';
public readonly shouldShare = true;
@autobind
public async init(params: any) {
// Subscribe drive stream

View File

@@ -8,6 +8,9 @@ import * as maps from '../../../../../games/reversi/maps';
import Channel from '../../channel';
export default class extends Channel {
public readonly chName = 'gamesReversiGame';
public readonly shouldShare = false;
private gameId: mongo.ObjectID;
@autobind

View File

@@ -5,6 +5,9 @@ import { publishMainStream } from '../../../../../stream';
import Channel from '../../channel';
export default class extends Channel {
public readonly chName = 'gamesReversi';
public readonly shouldShare = true;
@autobind
public async init(params: any) {
// Subscribe reversi stream

View File

@@ -5,6 +5,9 @@ import shouldMuteThisNote from '../../../../misc/should-mute-this-note';
import Channel from '../channel';
export default class extends Channel {
public readonly chName = 'globalTimeline';
public readonly shouldShare = true;
private mutedUserIds: string[] = [];
@autobind

View File

@@ -5,6 +5,9 @@ import shouldMuteThisNote from '../../../../misc/should-mute-this-note';
import Channel from '../channel';
export default class extends Channel {
public readonly chName = 'hashtag';
public readonly shouldShare = false;
@autobind
public async init(params: any) {
const mute = this.user ? await Mute.find({ muterId: this.user._id }) : null;

View File

@@ -5,6 +5,9 @@ import shouldMuteThisNote from '../../../../misc/should-mute-this-note';
import Channel from '../channel';
export default class extends Channel {
public readonly chName = 'homeTimeline';
public readonly shouldShare = true;
private mutedUserIds: string[] = [];
@autobind

View File

@@ -5,6 +5,9 @@ import shouldMuteThisNote from '../../../../misc/should-mute-this-note';
import Channel from '../channel';
export default class extends Channel {
public readonly chName = 'hybridTimeline';
public readonly shouldShare = true;
private mutedUserIds: string[] = [];
@autobind

View File

@@ -5,6 +5,9 @@ import shouldMuteThisNote from '../../../../misc/should-mute-this-note';
import Channel from '../channel';
export default class extends Channel {
public readonly chName = 'localTimeline';
public readonly shouldShare = true;
private mutedUserIds: string[] = [];
@autobind

View File

@@ -3,6 +3,9 @@ import Mute from '../../../../models/mute';
import Channel from '../channel';
export default class extends Channel {
public readonly chName = 'main';
public readonly shouldShare = true;
@autobind
public async init(params: any) {
const mute = await Mute.find({ muterId: this.user._id });

View File

@@ -2,6 +2,9 @@ import autobind from 'autobind-decorator';
import Channel from '../channel';
export default class extends Channel {
public readonly chName = 'messagingIndex';
public readonly shouldShare = true;
@autobind
public async init(params: any) {
// Subscribe messaging index stream

View File

@@ -3,6 +3,9 @@ import read from '../../common/read-messaging-message';
import Channel from '../channel';
export default class extends Channel {
public readonly chName = 'messaging';
public readonly shouldShare = false;
private otherpartyId: string;
@autobind

View File

@@ -5,6 +5,9 @@ import Channel from '../channel';
const ev = new Xev();
export default class extends Channel {
public readonly chName = 'notesStats';
public readonly shouldShare = true;
@autobind
public async init(params: any) {
ev.addListener('notesStats', this.onStats);

View File

@@ -5,6 +5,9 @@ import Channel from '../channel';
const ev = new Xev();
export default class extends Channel {
public readonly chName = 'serverStats';
public readonly shouldShare = true;
@autobind
public async init(params: any) {
ev.addListener('serverStats', this.onStats);

View File

@@ -2,6 +2,9 @@ import autobind from 'autobind-decorator';
import Channel from '../channel';
export default class extends Channel {
public readonly chName = 'userList';
public readonly shouldShare = false;
@autobind
public async init(params: any) {
const listId = params.listId as string;