AP向けのアンケートのfallbackリンクなどを削除 (#6466)
This commit is contained in:
		
							parent
							
								
									93aba74463
								
							
						
					
					
						commit
						1726ff3977
					
				
					 1 changed files with 1 additions and 18 deletions
				
			
		| 
						 | 
					@ -85,32 +85,16 @@ export default async function renderNote(note: Note, dive = true, isTalk = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const files = await getPromisedFiles(note.fileIds);
 | 
						const files = await getPromisedFiles(note.fileIds);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	let text = note.text;
 | 
						const text = note.text;
 | 
				
			||||||
	let poll: Poll | undefined;
 | 
						let poll: Poll | undefined;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (note.hasPoll) {
 | 
						if (note.hasPoll) {
 | 
				
			||||||
		poll = await Polls.findOne({ noteId: note.id });
 | 
							poll = await Polls.findOne({ noteId: note.id });
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (poll) {
 | 
					 | 
				
			||||||
		if (text == null) text = '';
 | 
					 | 
				
			||||||
		const url = `${config.url}/notes/${note.id}`;
 | 
					 | 
				
			||||||
		// TODO: i18n
 | 
					 | 
				
			||||||
		text += `\n[リモートで結果を表示](${url})`;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	let apText = text;
 | 
						let apText = text;
 | 
				
			||||||
	if (apText == null) apText = '';
 | 
						if (apText == null) apText = '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Provides choices as text for AP
 | 
					 | 
				
			||||||
	if (poll) {
 | 
					 | 
				
			||||||
		const cs = poll.choices.map((c, i) => `${i}: ${c}`);
 | 
					 | 
				
			||||||
		apText += '\n----------------------------------------\n';
 | 
					 | 
				
			||||||
		apText += cs.join('\n');
 | 
					 | 
				
			||||||
		apText += '\n----------------------------------------\n';
 | 
					 | 
				
			||||||
		apText += '番号を返信して投票';
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (quote) {
 | 
						if (quote) {
 | 
				
			||||||
		apText += `\n\nRE: ${quote}`;
 | 
							apText += `\n\nRE: ${quote}`;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -135,7 +119,6 @@ export default async function renderNote(note: Note, dive = true, isTalk = false
 | 
				
			||||||
		content: toHtml(Object.assign({}, note, {
 | 
							content: toHtml(Object.assign({}, note, {
 | 
				
			||||||
			text: text
 | 
								text: text
 | 
				
			||||||
		})),
 | 
							})),
 | 
				
			||||||
		_misskey_fallback_content: content,
 | 
					 | 
				
			||||||
		[poll.expiresAt && poll.expiresAt < new Date() ? 'closed' : 'endTime']: poll.expiresAt,
 | 
							[poll.expiresAt && poll.expiresAt < new Date() ? 'closed' : 'endTime']: poll.expiresAt,
 | 
				
			||||||
		[poll.multiple ? 'anyOf' : 'oneOf']: poll.choices.map((text, i) => ({
 | 
							[poll.multiple ? 'anyOf' : 'oneOf']: poll.choices.map((text, i) => ({
 | 
				
			||||||
			type: 'Note',
 | 
								type: 'Note',
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue