Commit 98f80b8a by imwangxiaozhou Committed by 胡悦

feat(wecom): 优化企业微信消息的分发筛选条件

调整了企业微信客户群编排服务和同步服务中的消息处理逻辑,将原有的仅匹配text和file类型的筛选及分发触发条件,改为排除标记为other的无效消息类型,扩大系统支持的消息类型范围。
1 parent ac012c9d
......@@ -670,7 +670,7 @@ class WeComCustomerGroupOrchestrationService:
.filter(
WeComMessage.bot_send == False,
WeComMessage.dispatch_status == "pending",
WeComMessage.msg_type.in_(("text", "file")),
WeComMessage.msg_type != "other",
)
.order_by(WeComMessage.msg_time.asc(), WeComMessage.id.asc())
)
......
......@@ -274,7 +274,7 @@ class WeComSyncService:
.filter(
WeComMessage.bot_send == False,
WeComMessage.dispatch_status == "pending",
WeComMessage.msg_type.in_(("text", "file")),
WeComMessage.msg_type != "other",
)
.order_by(WeComMessage.msg_time.asc(), WeComMessage.id.asc())
)
......@@ -406,7 +406,7 @@ class WeComSyncService:
record.session_title = data.get("session_title")
record.bot_send = self._infer_message_bot_send(data)
record.payload = dict(data)
if not record.bot_send and record.dispatch_status is None and record.msg_type in ("text", "file"):
if not record.bot_send and record.dispatch_status is None and record.msg_type != "other":
record.dispatch_status = "pending"
record.dispatch_error = None
self.db.flush()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!