mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-26 07:55:14 +00:00
Fix bug
This commit is contained in:
parent
f5fd523ca7
commit
c41ccf7821
5 changed files with 6 additions and 4 deletions
|
@ -12,7 +12,7 @@ export default async function(
|
||||||
user: IUser
|
user: IUser
|
||||||
) {
|
) {
|
||||||
// Subscribe stream
|
// Subscribe stream
|
||||||
subscriber.subscribe(`misskey:hybrid-timeline:${user._id}`);
|
subscriber.subscribe('misskey:hybrid-timeline', `misskey:hybrid-timeline:${user._id}`);
|
||||||
|
|
||||||
const mute = await Mute.find({ muterId: user._id });
|
const mute = await Mute.find({ muterId: user._id });
|
||||||
const mutedUserIds = mute.map(m => m.muteeId.toString());
|
const mutedUserIds = mute.map(m => m.muteeId.toString());
|
||||||
|
|
|
@ -12,7 +12,7 @@ export default async function(
|
||||||
user: IUser
|
user: IUser
|
||||||
) {
|
) {
|
||||||
// Subscribe stream
|
// Subscribe stream
|
||||||
subscriber.subscribe(`misskey:local-timeline`);
|
subscriber.subscribe('misskey:local-timeline');
|
||||||
|
|
||||||
const mute = await Mute.find({ muterId: user._id });
|
const mute = await Mute.find({ muterId: user._id });
|
||||||
const mutedUserIds = mute.map(m => m.muteeId.toString());
|
const mutedUserIds = mute.map(m => m.muteeId.toString());
|
||||||
|
|
|
@ -5,6 +5,7 @@ import config from '../../config';
|
||||||
|
|
||||||
import homeStream from './stream/home';
|
import homeStream from './stream/home';
|
||||||
import localTimelineStream from './stream/local-timeline';
|
import localTimelineStream from './stream/local-timeline';
|
||||||
|
import hybridTimelineStream from './stream/hybrid-timeline';
|
||||||
import globalTimelineStream from './stream/global-timeline';
|
import globalTimelineStream from './stream/global-timeline';
|
||||||
import userListStream from './stream/user-list';
|
import userListStream from './stream/user-list';
|
||||||
import driveStream from './stream/drive';
|
import driveStream from './stream/drive';
|
||||||
|
@ -64,6 +65,7 @@ module.exports = (server: http.Server) => {
|
||||||
const channel: any =
|
const channel: any =
|
||||||
request.resourceURL.pathname === '/' ? homeStream :
|
request.resourceURL.pathname === '/' ? homeStream :
|
||||||
request.resourceURL.pathname === '/local-timeline' ? localTimelineStream :
|
request.resourceURL.pathname === '/local-timeline' ? localTimelineStream :
|
||||||
|
request.resourceURL.pathname === '/hybrid-timeline' ? hybridTimelineStream :
|
||||||
request.resourceURL.pathname === '/global-timeline' ? globalTimelineStream :
|
request.resourceURL.pathname === '/global-timeline' ? globalTimelineStream :
|
||||||
request.resourceURL.pathname === '/user-list' ? userListStream :
|
request.resourceURL.pathname === '/user-list' ? userListStream :
|
||||||
request.resourceURL.pathname === '/drive' ? driveStream :
|
request.resourceURL.pathname === '/drive' ? driveStream :
|
||||||
|
|
|
@ -269,7 +269,7 @@ export default async (user: IUser, data: {
|
||||||
// Publish note to local and hybrid timeline stream
|
// Publish note to local and hybrid timeline stream
|
||||||
if (note.visibility != 'home') {
|
if (note.visibility != 'home') {
|
||||||
publishLocalTimelineStream(noteObj);
|
publishLocalTimelineStream(noteObj);
|
||||||
publishHybridTimelineStream(noteObj);
|
publishHybridTimelineStream(null, noteObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ class MisskeyEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public publishHybridTimelineStream(userId: ID, note: any): void {
|
public publishHybridTimelineStream(userId: ID, note: any): void {
|
||||||
this.redisClient.publish(`misskey:hybrid-timeline:${userId}`, JSON.stringify(note));
|
this.redisClient.publish(userId ? `misskey:hybrid-timeline:${userId}` : 'misskey:hybrid-timeline', JSON.stringify(note));
|
||||||
}
|
}
|
||||||
|
|
||||||
public publishGlobalTimelineStream(note: any): void {
|
public publishGlobalTimelineStream(note: any): void {
|
||||||
|
|
Loading…
Reference in a new issue