Skip to content

Commit

Permalink
admin streamingを廃止
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Dec 27, 2023
1 parent cf22bdd commit afbca6a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 43 deletions.
22 changes: 0 additions & 22 deletions src/server/api/endpoints/users/report-abuse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import ID, { transform } from '../../../../misc/cafy-id';
import define from '../../define';
import User from '../../../../models/user';
import AbuseUserReport from '../../../../models/abuse-user-report';
import { publishAdminStream } from '../../../../services/stream';
import { ApiError } from '../../error';
import { getUser } from '../../common/getters';

Expand Down Expand Up @@ -86,25 +85,4 @@ export default define(meta, async (ps, me) => {
noteIds: ps.noteIds,
comment: ps.comment
});

// Publish event to moderators
setTimeout(async () => {
const moderators = await User.find({
$or: [{
isAdmin: true
}, {
isModerator: true
}]
});

for (const moderator of moderators) {
publishAdminStream(moderator._id, 'newAbuseUserReport', {
id: report._id,
userId: report.userId,
reporterId: report.reporterId,
noteIds: report.noteIds,
comment: report.comment
});
}
}, 1);
});
15 changes: 0 additions & 15 deletions src/server/api/stream/channels/admin.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/server/api/stream/channels/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import messaging from './messaging';
import messagingIndex from './messaging-index';
import drive from './drive';
import hashtag from './hashtag';
import admin from './admin';
import gamesReversi from './games/reversi';
import gamesReversiGame from './games/reversi-game';

Expand All @@ -35,7 +34,6 @@ export default {
messagingIndex,
drive,
hashtag,
admin,
gamesReversi,
gamesReversiGame
};
4 changes: 0 additions & 4 deletions src/services/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ export function publishHotStream(note: PackedNote): void {
publish(`hotStream`, null, note);
}

export function publishAdminStream(userId: ID, type: string, value?: unknown): void {
publish(`adminStream:${userId}`, type, typeof value === 'undefined' ? null : value);
}

export function publishServerEvent(userId: ID | null, type: string, value?: unknown): void {
const name = userId ? `serverEvent:${userId}` : `serverEvent`;
publish(name, type, typeof value === 'undefined' ? null : value);
Expand Down

0 comments on commit afbca6a

Please sign in to comment.