新增 Zalo OA、Zoom Chat、Zulip 三个渠道扩展。 Zalo OA 渠道扩展主要模块:sidecar_client, config, gateway, outbound, streaming, pairing, security, auth, dedupe, directory, monitor, status, session, reactions, tools Zoom Chat 渠道扩展主要模块:config, gateway, webhook, outbound, streaming, pairing, security, crypto, dedupe, actions, media, mentions, monitor, status, session, reactions, threading Zulip 渠道扩展主要模块:client, config, gateway, outbound, streaming, pairing, security, monitor, status
29 lines
930 B
Python
29 lines
930 B
Python
import logging
|
|
|
|
from yuxi.channel.protocols import ReplyTransport
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class ZoomThreading:
|
|
def extract_thread_id(self, msg: dict) -> str | None:
|
|
raw = msg.get("raw_payload", {})
|
|
inner = raw.get("payload", {}).get("object", {})
|
|
thread_root = inner.get("thread_root_message_id")
|
|
if thread_root:
|
|
return thread_root
|
|
|
|
reply_to = msg.get("reply_to_id") or msg.get("message_thread_id")
|
|
if reply_to:
|
|
return reply_to
|
|
|
|
msg_id = msg.get("msg_id")
|
|
return msg_id if msg_id else None
|
|
|
|
def resolve_reply_transport(self, msg: dict, thread_id: str | None) -> ReplyTransport:
|
|
if thread_id:
|
|
return ReplyTransport(mode="thread", thread_id=thread_id)
|
|
|
|
msg_id = msg.get("msg_id", "")
|
|
return ReplyTransport(mode="thread", thread_id=msg_id) if msg_id else ReplyTransport(mode="inline")
|