From 25d37302a8bfda954c7ede1e9d355db587c82228 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 20 Feb 2021 20:20:05 +0900 Subject: チャンネルで入力中ユーザーを表示するように、Chat UIでタイムラインでは投稿フォームを上に表示するように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/stream.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/services/stream.ts') diff --git a/src/services/stream.ts b/src/services/stream.ts index ec43c6ff2c..d833d700fe 100644 --- a/src/services/stream.ts +++ b/src/services/stream.ts @@ -6,6 +6,7 @@ import { ReversiGame } from '../models/entities/games/reversi/game'; import { UserGroup } from '../models/entities/user-group'; import config from '../config'; import { Antenna } from '../models/entities/antenna'; +import { Channel } from '../models/entities/channel'; class Publisher { private publish = (channel: string, type: string | null, value?: any): void => { @@ -38,6 +39,10 @@ class Publisher { }); } + public publishChannelStream = (channelId: Channel['id'], type: string, value?: any): void => { + this.publish(`channelStream:${channelId}`, type, typeof value === 'undefined' ? null : value); + } + public publishUserListStream = (listId: UserList['id'], type: string, value?: any): void => { this.publish(`userListStream:${listId}`, type, typeof value === 'undefined' ? null : value); } @@ -84,6 +89,7 @@ export const publishMainStream = publisher.publishMainStream; export const publishDriveStream = publisher.publishDriveStream; export const publishNoteStream = publisher.publishNoteStream; export const publishNotesStream = publisher.publishNotesStream; +export const publishChannelStream = publisher.publishChannelStream; export const publishUserListStream = publisher.publishUserListStream; export const publishAntennaStream = publisher.publishAntennaStream; export const publishMessagingStream = publisher.publishMessagingStream; -- cgit v1.2.3-freya