diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-10-07 11:06:17 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-07 11:06:17 +0900 |
| commit | d0570d7fe3a3bf3c6b0312dece74bacc04c3534a (patch) | |
| tree | 698218279a38f9c78b0350e81b8ac77ae52e4a0d /src/stream.ts | |
| parent | Fix お知らせが確認中...のままになる(Announcement Fetching...) (... (diff) | |
| download | sharkey-d0570d7fe3a3bf3c6b0312dece74bacc04c3534a.tar.gz sharkey-d0570d7fe3a3bf3c6b0312dece74bacc04c3534a.tar.bz2 sharkey-d0570d7fe3a3bf3c6b0312dece74bacc04c3534a.zip | |
V10 (#2826)
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* Update CHANGELOG.md
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* Update CHANGELOG.md
* Update CHANGELOG.md
* wip
* Update CHANGELOG.md
* wip
* wip
* wip
* wip
Diffstat (limited to 'src/stream.ts')
| -rw-r--r-- | src/stream.ts | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/src/stream.ts b/src/stream.ts index 8a8d8b4cf0..4cd8fc8b2c 100644 --- a/src/stream.ts +++ b/src/stream.ts @@ -31,52 +31,59 @@ class Publisher { this.ev.emit(channel, message); } - public publishUserStream = (userId: ID, type: string, value?: any): void => { - this.publish(`user-stream:${userId}`, type, typeof value === 'undefined' ? null : value); + public publishMainStream = (userId: ID, type: string, value?: any): void => { + this.publish(`mainStream:${userId}`, type, typeof value === 'undefined' ? null : value); } public publishDriveStream = (userId: ID, type: string, value?: any): void => { - this.publish(`drive-stream:${userId}`, type, typeof value === 'undefined' ? null : value); + this.publish(`driveStream:${userId}`, type, typeof value === 'undefined' ? null : value); } - public publishNoteStream = (noteId: ID, type: string): void => { - this.publish(`note-stream:${noteId}`, null, noteId); + public publishNoteStream = (noteId: ID, type: string, value: any): void => { + this.publish(`noteStream:${noteId}`, type, { + id: noteId, + body: value + }); } public publishUserListStream = (listId: ID, type: string, value?: any): void => { - this.publish(`user-list-stream:${listId}`, type, typeof value === 'undefined' ? null : value); + this.publish(`userListStream:${listId}`, type, typeof value === 'undefined' ? null : value); } public publishMessagingStream = (userId: ID, otherpartyId: ID, type: string, value?: any): void => { - this.publish(`messaging-stream:${userId}-${otherpartyId}`, type, typeof value === 'undefined' ? null : value); + this.publish(`messagingStream:${userId}-${otherpartyId}`, type, typeof value === 'undefined' ? null : value); } public publishMessagingIndexStream = (userId: ID, type: string, value?: any): void => { - this.publish(`messaging-index-stream:${userId}`, type, typeof value === 'undefined' ? null : value); + this.publish(`messagingIndexStream:${userId}`, type, typeof value === 'undefined' ? null : value); } public publishReversiStream = (userId: ID, type: string, value?: any): void => { - this.publish(`reversi-stream:${userId}`, type, typeof value === 'undefined' ? null : value); + this.publish(`reversiStream:${userId}`, type, typeof value === 'undefined' ? null : value); } public publishReversiGameStream = (gameId: ID, type: string, value?: any): void => { - this.publish(`reversi-game-stream:${gameId}`, type, typeof value === 'undefined' ? null : value); + this.publish(`reversiGameStream:${gameId}`, type, typeof value === 'undefined' ? null : value); + } + + public publishHomeTimelineStream = (userId: ID, note: any): void => { + this.publish(`homeTimeline:${userId}`, null, note); } public publishLocalTimelineStream = async (note: any): Promise<void> => { const meta = await this.getMeta(); if (meta.disableLocalTimeline) return; - this.publish('local-timeline', null, note); + this.publish('localTimeline', null, note); } public publishHybridTimelineStream = async (userId: ID, note: any): Promise<void> => { const meta = await this.getMeta(); if (meta.disableLocalTimeline) return; - this.publish(userId ? `hybrid-timeline:${userId}` : 'hybrid-timeline', null, note); + this.publish(userId ? `hybridTimeline:${userId}` : 'hybridTimeline', null, note); } public publishGlobalTimelineStream = (note: any): void => { - this.publish('global-timeline', null, note); + this.publish('globalTimeline', null, note); } public publishHashtagStream = (note: any): void => { @@ -88,7 +95,7 @@ const publisher = new Publisher(); export default publisher; -export const publishUserStream = publisher.publishUserStream; +export const publishMainStream = publisher.publishMainStream; export const publishDriveStream = publisher.publishDriveStream; export const publishNoteStream = publisher.publishNoteStream; export const publishUserListStream = publisher.publishUserListStream; @@ -96,6 +103,7 @@ export const publishMessagingStream = publisher.publishMessagingStream; export const publishMessagingIndexStream = publisher.publishMessagingIndexStream; export const publishReversiStream = publisher.publishReversiStream; export const publishReversiGameStream = publisher.publishReversiGameStream; +export const publishHomeTimelineStream = publisher.publishHomeTimelineStream; export const publishLocalTimelineStream = publisher.publishLocalTimelineStream; export const publishHybridTimelineStream = publisher.publishHybridTimelineStream; export const publishGlobalTimelineStream = publisher.publishGlobalTimelineStream; |