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

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

@ -6,7 +6,6 @@ import Xev from 'xev';
import MainStreamConnection from './stream';
import { ParsedUrlQuery } from 'querystring';
import authenticate from './authenticate';
import channels from './stream/channels';
import { EventEmitter } from 'events';
import config from '../../config';
@ -66,13 +65,13 @@ module.exports = (server: http.Server) => {
};
main.connectChannel(Math.random().toString(), null,
request.resourceURL.pathname === '/' ? channels.homeTimeline :
request.resourceURL.pathname === '/local-timeline' ? channels.localTimeline :
request.resourceURL.pathname === '/hybrid-timeline' ? channels.hybridTimeline :
request.resourceURL.pathname === '/global-timeline' ? channels.globalTimeline : null);
request.resourceURL.pathname === '/' ? 'homeTimeline' :
request.resourceURL.pathname === '/local-timeline' ? 'localTimeline' :
request.resourceURL.pathname === '/hybrid-timeline' ? 'hybridTimeline' :
request.resourceURL.pathname === '/global-timeline' ? 'globalTimeline' : null);
if (request.resourceURL.pathname === '/') {
main.connectChannel(Math.random().toString(), null, channels.main);
main.connectChannel(Math.random().toString(), null, 'main');
}
}