新增 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
21 lines
614 B
Python
21 lines
614 B
Python
from __future__ import annotations
|
|
|
|
|
|
class ZaloUserSessionAdapter:
|
|
@staticmethod
|
|
def normalize_target(raw: str) -> str:
|
|
raw = raw.strip()
|
|
if raw.startswith("zalouser:"):
|
|
return raw[len("zalouser:") :]
|
|
if raw.startswith("zlu:"):
|
|
return raw[len("zlu:") :]
|
|
if raw.startswith("group:"):
|
|
return raw
|
|
if raw.startswith("g:"):
|
|
return f"group:{raw[2:]}"
|
|
if raw.startswith("user:") or raw.startswith("dm:"):
|
|
return raw
|
|
if raw.startswith("u:"):
|
|
return f"user:{raw[2:]}"
|
|
return raw
|