|
8 | 8 | getParentMessage, |
9 | 9 | isSlackTokenError, |
10 | 10 | markWorkspaceDisconnected, |
| 11 | + cleanQuoteText, |
11 | 12 | } from "@/lib/slack"; |
12 | 13 | import { detectQuote } from "@/lib/ai/quote-detector"; |
13 | 14 | import { enqueueImageGeneration } from "@/lib/queue/queue"; |
@@ -425,7 +426,7 @@ async function processMessage(event: SlackEvent, teamId: string) { |
425 | 426 | slackUserId, |
426 | 427 | slackUserName: userName, |
427 | 428 | slackUserAvatarUrl: userAvatarUrl, |
428 | | - quoteText: detection.extractedQuote || text, |
| 429 | + quoteText: cleanQuoteText(detection.extractedQuote || text), |
429 | 430 | attributedTo: detection.attributedTo, |
430 | 431 | styleId, |
431 | 432 | aiConfidence: detection.confidence, |
@@ -460,7 +461,7 @@ async function processMessage(event: SlackEvent, teamId: string) { |
460 | 461 | imageGenerationId: imageGeneration.id, |
461 | 462 | messageTs, |
462 | 463 | slackChannelId, |
463 | | - quoteText: detection.extractedQuote || text, |
| 464 | + quoteText: cleanQuoteText(detection.extractedQuote || text), |
464 | 465 | styleId, |
465 | 466 | customStyleDescription, |
466 | 467 | encryptedBotToken: workspace.slackBotToken, |
@@ -610,6 +611,8 @@ async function processMentionInThread(event: SlackEvent, teamId: string) { |
610 | 611 | return; |
611 | 612 | } |
612 | 613 |
|
| 614 | + parentText = cleanQuoteText(parentText); |
| 615 | + |
613 | 616 | // Look up existing Quote + ImageGenerations for this parent message |
614 | 617 | const existingQuote = await prisma.quote.findUnique({ |
615 | 618 | where: { |
|
0 commit comments