mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
Update zulip message on reprocess
This commit is contained in:
@@ -53,7 +53,11 @@ from reflector.processors.types import (
|
|||||||
from reflector.processors.types import Transcript as TranscriptProcessorType
|
from reflector.processors.types import Transcript as TranscriptProcessorType
|
||||||
from reflector.settings import settings
|
from reflector.settings import settings
|
||||||
from reflector.ws_manager import WebsocketManager, get_ws_manager
|
from reflector.ws_manager import WebsocketManager, get_ws_manager
|
||||||
from reflector.zulip import get_zulip_message, send_message_to_zulip
|
from reflector.zulip import (
|
||||||
|
get_zulip_message,
|
||||||
|
send_message_to_zulip,
|
||||||
|
update_zulip_message,
|
||||||
|
)
|
||||||
from structlog import BoundLogger as Logger
|
from structlog import BoundLogger as Logger
|
||||||
|
|
||||||
|
|
||||||
@@ -573,7 +577,17 @@ async def pipeline_post_to_zulip(transcript: Transcript, logger: Logger):
|
|||||||
|
|
||||||
if room.zulip_auto_post:
|
if room.zulip_auto_post:
|
||||||
message = get_zulip_message(transcript=transcript, include_topics=True)
|
message = get_zulip_message(transcript=transcript, include_topics=True)
|
||||||
response = send_message_to_zulip(room.zulip_stream, room.zulip_topic, message)
|
if transcript.zulip_message_id:
|
||||||
|
update_zulip_message(
|
||||||
|
transcript.zulip_message_id,
|
||||||
|
room.zulip_stream,
|
||||||
|
room.zulip_topic,
|
||||||
|
message,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
response = send_message_to_zulip(
|
||||||
|
room.zulip_stream, room.zulip_topic, message
|
||||||
|
)
|
||||||
await transcripts_controller.update(
|
await transcripts_controller.update(
|
||||||
transcript, {"zulip_message_id": response["id"]}
|
transcript, {"zulip_message_id": response["id"]}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user