Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

fix(zulip): 用 _recipient_map 补全缺失的路由元数据,修复附件发送报错 Message must have recipients

WeDone4bab3a348317
diff --git a/deeptutor/tutorbot/channels/zulip.py b/deeptutor/tutorbot/channels/zulip.py
index f81a3a0f7..bed775ca0 100644
--- a/deeptutor/tutorbot/channels/zulip.py
+++ b/deeptutor/tutorbot/channels/zulip.py
@@ -157,6 +157,11 @@ class ZulipChannel(BaseChannel):
logger.warning("Zulip client not running")
return
+ if not msg.metadata.get("msg_type"):
+ stored = self._recipient_map.get(msg.chat_id)
+ if stored:
+ msg.metadata = {**stored, **msg.metadata}
+
if not msg.metadata.get("_progress", False):
self._stop_typing(msg.chat_id)