enhance(backend): notes/global-timeline復活
This commit is contained in:
		| @@ -67,8 +67,37 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- | ||||
| 				throw new ApiError(meta.errors.gtlDisabled); | ||||
| 			} | ||||
|  | ||||
| 			// TODO? | ||||
| 			return []; | ||||
| 			//#region Construct query | ||||
| 			const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), | ||||
| 				ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) | ||||
| 				.andWhere('note.visibility = \'public\'') | ||||
| 				.andWhere('note.channelId IS NULL') | ||||
| 				.innerJoinAndSelect('note.user', 'user') | ||||
| 				.leftJoinAndSelect('note.reply', 'reply') | ||||
| 				.leftJoinAndSelect('note.renote', 'renote') | ||||
| 				.leftJoinAndSelect('reply.user', 'replyUser') | ||||
| 				.leftJoinAndSelect('renote.user', 'renoteUser'); | ||||
|  | ||||
| 			if (me) { | ||||
| 				this.queryService.generateMutedUserQuery(query, me); | ||||
| 				this.queryService.generateBlockedUserQuery(query, me); | ||||
| 				this.queryService.generateMutedUserRenotesQueryForNotes(query, me); | ||||
| 			} | ||||
|  | ||||
| 			if (ps.withFiles) { | ||||
| 				query.andWhere('note.fileIds != \'{}\''); | ||||
| 			} | ||||
| 			//#endregion | ||||
|  | ||||
| 			const timeline = await query.limit(ps.limit).getMany(); | ||||
|  | ||||
| 			process.nextTick(() => { | ||||
| 				if (me) { | ||||
| 					this.activeUsersChart.read(me); | ||||
| 				} | ||||
| 			}); | ||||
|  | ||||
| 			return await this.noteEntityService.packMany(timeline, me); | ||||
| 		}); | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 syuilo
					syuilo