Skip to content

Commit

Permalink
Admin系Streamingを廃止
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Jan 6, 2024
1 parent 4e33da7 commit 7569547
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 91 deletions.
15 changes: 0 additions & 15 deletions src/client/app/admin/views/dashboard.ap-log.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,10 @@ export default Vue.extend({
data() {
return {
logs: [],
connection: null,
faBolt, faExchangeAlt
};
},
mounted() {
this.connection = this.$root.stream.useSharedConnection('apLog');
this.connection.on('log', this.onLog);
this.connection.on('logs', this.onLogs);
this.connection.send('requestLog', {
id: Math.random().toString().substr(2, 8),
length: 50
});
},
beforeDestroy() {
this.connection.dispose();
},
methods: {
onLog(log) {
log.id = Math.random();
Expand Down
21 changes: 0 additions & 21 deletions src/server/api/endpoints/users/report-abuse.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import $ from 'cafy';
import { ID } from '../../../../misc/cafy-id';
import define from '../../define';
import { publishAdminStream } from '../../../../services/stream';
import { ApiError } from '../../error';
import { getUser } from '../../common/getters';
import { AbuseUserReports, Users } from '../../../../models';
Expand Down Expand Up @@ -76,24 +75,4 @@ export default define(meta, async (ps, me) => {
reporterId: me.id,
comment: ps.comment
});

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

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

This file was deleted.

25 changes: 0 additions & 25 deletions src/server/api/stream/channels/ap-log.ts

This file was deleted.

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

Expand All @@ -30,8 +28,6 @@ export default {
messagingIndex,
drive,
hashtag,
apLog,
admin,
gamesReversi,
gamesReversiGame
};
10 changes: 0 additions & 10 deletions src/services/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ class Publisher {
this.publish('notesStream', null, note);
}

public publishApLogStream = (log: any): void => {
this.publish('apLog', null, log);
}

public publishAdminStream = (userId: User['id'], type: string, value?: any): void => {
this.publish(`adminStream:${userId}`, type, typeof value === 'undefined' ? null : value);
}

public publishServerEvent = (userId: User['id'] | null, type: string, value?: any): void => {
const name = userId ? `serverEvent:${userId}` : `serverEvent`;
this.publish(name, type, typeof value === 'undefined' ? null : value);
Expand All @@ -89,6 +81,4 @@ export const publishGroupMessagingStream = publisher.publishGroupMessagingStream
export const publishMessagingIndexStream = publisher.publishMessagingIndexStream;
export const publishReversiStream = publisher.publishReversiStream;
export const publishReversiGameStream = publisher.publishReversiGameStream;
export const publishApLogStream = publisher.publishApLogStream;
export const publishAdminStream = publisher.publishAdminStream;
export const publishServerEvent = publisher.publishServerEvent;

0 comments on commit 7569547

Please sign in to comment.