fedimbed: quote tweet recursion lmao
This commit is contained in:
		
							parent
							
								
									f8fabe6c13
								
							
						
					
					
						commit
						18f408ca6b
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -929,7 +929,7 @@ function getStatsMasto(post) {
 | 
				
			||||||
  return stats.join("\u3000");
 | 
					  return stats.join("\u3000");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async function processUrl(msg, url, spoiler = false, command = false) {
 | 
					async function processUrl(msg, url, spoiler = false, command = false, inQuote = false) {
 | 
				
			||||||
  let canFedi = await hasFlag(msg.guildID, "fedimbed");
 | 
					  let canFedi = await hasFlag(msg.guildID, "fedimbed");
 | 
				
			||||||
  let canBsky = await hasFlag(msg.guildID, "bskyEmbeds");
 | 
					  let canBsky = await hasFlag(msg.guildID, "bskyEmbeds");
 | 
				
			||||||
  let canTwitter = await hasFlag(msg.guildID, "twitterEmbeds");
 | 
					  let canTwitter = await hasFlag(msg.guildID, "twitterEmbeds");
 | 
				
			||||||
| 
						 | 
					@ -1289,11 +1289,11 @@ async function processUrl(msg, url, spoiler = false, command = false) {
 | 
				
			||||||
  let quoteRes;
 | 
					  let quoteRes;
 | 
				
			||||||
  if (platformName == "Nitter") {
 | 
					  if (platformName == "Nitter") {
 | 
				
			||||||
    const quote = content.match(/<blockquote><b>↘ <a href="([^"]+?)">/);
 | 
					    const quote = content.match(/<blockquote><b>↘ <a href="([^"]+?)">/);
 | 
				
			||||||
    if (quote?.[1]) {
 | 
					    if (quote?.[1] && !inQuote) {
 | 
				
			||||||
      const quoteUrl = quote[1];
 | 
					      const quoteUrl = quote[1];
 | 
				
			||||||
      content = content.replace(/<blockquote><b>↘ <a href="[^"]+?">.+?<\/blockquote>/, "");
 | 
					      content = content.replace(/<blockquote><b>↘ <a href="[^"]+?">.+?<\/blockquote>/, "");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      quoteRes = await processUrl(msg, quoteUrl, spoiler, command);
 | 
					      quoteRes = await processUrl(msg, quoteUrl, spoiler, command, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    content = content
 | 
					    content = content
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue