PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.4.0
Fluent Support – Helpdesk & Customer Support Ticket System v2.4.0
2.4.0 2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 All 68 releases
← All changes | app/Services/Integrations/FluentBot/FluentBotHelper.php +22 -0 2.3.22.4.0 View file →
@@ -263,8 +263,30 @@
263 263
264 264 return $body;
265 265 }
266 266
267 + /**
268 + * Reconnect to an in-flight turn and stream its buffered SSE straight to the
269 + * browser. Writes directly to the output stream, so it returns nothing on
270 + * success; a credentials failure is emitted as an SSE `error` frame because the
271 + * caller has already sent SSE headers by this point.
272 + */
273 + public function resumeChatStream($chatId, $productId = null)
274 + {
275 + $credentials = $this->resolveApiCredentials($productId);
276 +
277 + if (is_wp_error($credentials)) {
278 + echo "event: error\n";
279 + echo "data: " . wp_json_encode(['error' => $credentials->get_error_message()]) . "\n\n";
280 + flush();
281 + return;
282 + }
283 +
284 + $url = $this->apiBaseUrl() . '/bots/' . $credentials['botId'] . '/chats/' . $chatId . '/stream';
285 +
286 + (new FluentBotAPI($url, $credentials['apiKey']))->makeResumeStreamRequest();
287 + }
288 +
267 289 public function createFeedback($messageId, $reaction, $comment, $productId = null, $chatId = null)
268 290 {
269 291 $credentials = $this->resolveApiCredentials($productId);
270 292