整理した
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
import * as websocket from 'websocket';
|
||||
import * as redis from 'redis';
|
||||
import { ParsedUrlQuery } from 'querystring';
|
||||
|
||||
export default function(request: websocket.request, connection: websocket.connection, subscriber: redis.RedisClient): void {
|
||||
const channel = request.resourceURL.query.channel;
|
||||
const q = request.resourceURL.query as ParsedUrlQuery;
|
||||
const channel = q.channel;
|
||||
|
||||
// Subscribe channel stream
|
||||
subscriber.subscribe(`misskey:channel-stream:${channel}`);
|
||||
|
@ -2,9 +2,9 @@ import * as websocket from 'websocket';
|
||||
import * as redis from 'redis';
|
||||
import * as debug from 'debug';
|
||||
|
||||
import User from '../models/user';
|
||||
import Mute from '../models/mute';
|
||||
import { pack as packPost } from '../models/post';
|
||||
import User from '../../../models/user';
|
||||
import Mute from '../../../models/mute';
|
||||
import { pack as packPost } from '../../../models/post';
|
||||
import readNotification from '../common/read-notification';
|
||||
|
||||
const log = debug('misskey');
|
||||
|
@ -1,9 +1,11 @@
|
||||
import * as websocket from 'websocket';
|
||||
import * as redis from 'redis';
|
||||
import read from '../common/read-messaging-message';
|
||||
import { ParsedUrlQuery } from 'querystring';
|
||||
|
||||
export default function(request: websocket.request, connection: websocket.connection, subscriber: redis.RedisClient, user: any): void {
|
||||
const otherparty = request.resourceURL.query.otherparty;
|
||||
const q = request.resourceURL.query as ParsedUrlQuery;
|
||||
const otherparty = q.otherparty as string;
|
||||
|
||||
// Subscribe messaging stream
|
||||
subscriber.subscribe(`misskey:messaging-stream:${user._id}-${otherparty}`);
|
||||
|
@ -1,13 +1,15 @@
|
||||
import * as websocket from 'websocket';
|
||||
import * as redis from 'redis';
|
||||
import * as CRC32 from 'crc-32';
|
||||
import OthelloGame, { pack } from '../models/othello-game';
|
||||
import OthelloGame, { pack } from '../../../models/othello-game';
|
||||
import { publishOthelloGameStream } from '../event';
|
||||
import Othello from '../../common/othello/core';
|
||||
import * as maps from '../../common/othello/maps';
|
||||
import Othello from '../../../common/othello/core';
|
||||
import * as maps from '../../../common/othello/maps';
|
||||
import { ParsedUrlQuery } from 'querystring';
|
||||
|
||||
export default function(request: websocket.request, connection: websocket.connection, subscriber: redis.RedisClient, user?: any): void {
|
||||
const gameId = request.resourceURL.query.game;
|
||||
const q = request.resourceURL.query as ParsedUrlQuery;
|
||||
const gameId = q.game;
|
||||
|
||||
// Subscribe game stream
|
||||
subscriber.subscribe(`misskey:othello-game-stream:${gameId}`);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as mongo from 'mongodb';
|
||||
import * as websocket from 'websocket';
|
||||
import * as redis from 'redis';
|
||||
import Matching, { pack } from '../models/othello-matching';
|
||||
import Matching, { pack } from '../../../models/othello-matching';
|
||||
import publishUserStream from '../event';
|
||||
|
||||
export default function(request: websocket.request, connection: websocket.connection, subscriber: redis.RedisClient, user: any): void {
|
||||
|
Reference in New Issue
Block a user