Skip to content

Commit 828c349

Browse files
committed
Add thread support to GoogleChatHandler for message replies
1 parent 015838e commit 828c349

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: src/GoogleChatHandler.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,12 @@ protected function formatMessage(LogRecord $record): string
9494
protected function sendWithRetry(array $payload, int $attempt = 1)
9595
{
9696
$url = $this->webhookUrl;
97-
if (str_contains($url, '?')) {
98-
$url .= '&messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD';
99-
} else {
100-
$url .= '?messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD';
97+
if (!empty($payload['thread'])) {
98+
if (str_contains($url, '?')) {
99+
$url .= '&messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD';
100+
} else {
101+
$url .= '?messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD';
102+
}
101103
}
102104

103105
try {

0 commit comments

Comments
 (0)