chore: remove unused lines
This commit is contained in:
parent
7e703e1bb0
commit
168001271f
1 changed files with 0 additions and 65 deletions
|
@ -3,14 +3,10 @@ import type { Note } from "@/models/entities/note.js";
|
|||
import type { User } from "@/models/entities/user.js";
|
||||
import {
|
||||
NoteUnreads,
|
||||
Users,
|
||||
Followings,
|
||||
ChannelFollowings,
|
||||
} from "@/models/index.js";
|
||||
import { Not, IsNull, In } from "typeorm";
|
||||
import type { Channel } from "@/models/entities/channel.js";
|
||||
import { checkHitAntenna } from "@/misc/check-hit-antenna.js";
|
||||
import { getAntennas } from "@/misc/antenna-cache.js";
|
||||
import { readNotificationByQuery } from "@/server/api/common/read-notification.js";
|
||||
import type { Packed } from "@/misc/schema.js";
|
||||
|
||||
|
@ -25,18 +21,6 @@ export default async function (
|
|||
followingChannels: Set<Channel["id"]>;
|
||||
},
|
||||
) {
|
||||
const following = info?.following
|
||||
? info.following
|
||||
: new Set<string>(
|
||||
(
|
||||
await Followings.find({
|
||||
where: {
|
||||
followerId: userId,
|
||||
},
|
||||
select: ["followeeId"],
|
||||
})
|
||||
).map((x) => x.followeeId),
|
||||
);
|
||||
const followingChannels = info?.followingChannels
|
||||
? info.followingChannels
|
||||
: new Set<string>(
|
||||
|
@ -50,11 +34,9 @@ export default async function (
|
|||
).map((x) => x.followeeId),
|
||||
);
|
||||
|
||||
// const myAntennas = (await getAntennas()).filter((a) => a.userId === userId);
|
||||
const readMentions: (Note | Packed<"Note">)[] = [];
|
||||
const readSpecifiedNotes: (Note | Packed<"Note">)[] = [];
|
||||
const readChannelNotes: (Note | Packed<"Note">)[] = [];
|
||||
// const readAntennaNotes: (Note | Packed<"Note">)[] = [];
|
||||
|
||||
for (const note of notes) {
|
||||
if (note.mentions?.includes(userId)) {
|
||||
|
@ -66,23 +48,6 @@ export default async function (
|
|||
if (note.channelId && followingChannels.has(note.channelId)) {
|
||||
readChannelNotes.push(note);
|
||||
}
|
||||
|
||||
// if (note.user != null) {
|
||||
// // たぶんnullになることは無いはずだけど一応
|
||||
// for (const antenna of myAntennas) {
|
||||
// if (
|
||||
// await checkHitAntenna(
|
||||
// antenna,
|
||||
// note,
|
||||
// note.user,
|
||||
// undefined,
|
||||
// Array.from(following),
|
||||
// )
|
||||
// ) {
|
||||
// readAntennaNotes.push(note);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
if (
|
||||
|
@ -139,34 +104,4 @@ export default async function (
|
|||
]),
|
||||
});
|
||||
}
|
||||
|
||||
// if (readAntennaNotes.length > 0) {
|
||||
// await AntennaNotes.update(
|
||||
// {
|
||||
// antennaId: In(myAntennas.map((a) => a.id)),
|
||||
// noteId: In(readAntennaNotes.map((n) => n.id)),
|
||||
// },
|
||||
// {
|
||||
// read: true,
|
||||
// },
|
||||
// );
|
||||
|
||||
// // TODO: まとめてクエリしたい
|
||||
// for (const antenna of myAntennas) {
|
||||
// const count = await AntennaNotes.countBy({
|
||||
// antennaId: antenna.id,
|
||||
// read: false,
|
||||
// });
|
||||
|
||||
// if (count === 0) {
|
||||
// publishMainStream(userId, "readAntenna", antenna);
|
||||
// }
|
||||
// }
|
||||
|
||||
// Users.getHasUnreadAntenna(userId).then((unread) => {
|
||||
// if (!unread) {
|
||||
// publishMainStream(userId, "readAllAntennas");
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue