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 type { User } from "@/models/entities/user.js";
|
||||||
import {
|
import {
|
||||||
NoteUnreads,
|
NoteUnreads,
|
||||||
Users,
|
|
||||||
Followings,
|
|
||||||
ChannelFollowings,
|
ChannelFollowings,
|
||||||
} from "@/models/index.js";
|
} from "@/models/index.js";
|
||||||
import { Not, IsNull, In } from "typeorm";
|
import { Not, IsNull, In } from "typeorm";
|
||||||
import type { Channel } from "@/models/entities/channel.js";
|
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 { readNotificationByQuery } from "@/server/api/common/read-notification.js";
|
||||||
import type { Packed } from "@/misc/schema.js";
|
import type { Packed } from "@/misc/schema.js";
|
||||||
|
|
||||||
|
@ -25,18 +21,6 @@ export default async function (
|
||||||
followingChannels: Set<Channel["id"]>;
|
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
|
const followingChannels = info?.followingChannels
|
||||||
? info.followingChannels
|
? info.followingChannels
|
||||||
: new Set<string>(
|
: new Set<string>(
|
||||||
|
@ -50,11 +34,9 @@ export default async function (
|
||||||
).map((x) => x.followeeId),
|
).map((x) => x.followeeId),
|
||||||
);
|
);
|
||||||
|
|
||||||
// const myAntennas = (await getAntennas()).filter((a) => a.userId === userId);
|
|
||||||
const readMentions: (Note | Packed<"Note">)[] = [];
|
const readMentions: (Note | Packed<"Note">)[] = [];
|
||||||
const readSpecifiedNotes: (Note | Packed<"Note">)[] = [];
|
const readSpecifiedNotes: (Note | Packed<"Note">)[] = [];
|
||||||
const readChannelNotes: (Note | Packed<"Note">)[] = [];
|
const readChannelNotes: (Note | Packed<"Note">)[] = [];
|
||||||
// const readAntennaNotes: (Note | Packed<"Note">)[] = [];
|
|
||||||
|
|
||||||
for (const note of notes) {
|
for (const note of notes) {
|
||||||
if (note.mentions?.includes(userId)) {
|
if (note.mentions?.includes(userId)) {
|
||||||
|
@ -66,23 +48,6 @@ export default async function (
|
||||||
if (note.channelId && followingChannels.has(note.channelId)) {
|
if (note.channelId && followingChannels.has(note.channelId)) {
|
||||||
readChannelNotes.push(note);
|
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 (
|
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