该提交新增了完整的BlueBubbles渠道插件,支持通过BlueBubbles Server集成iMessage功能,包含以下核心能力: 1. 支持私聊和群聊会话管理,自动区分会话类型 2. 完整的消息收发支持,包括文本、图片、语音、文件、视频消息 3. 支持消息反应、已读回执、消息编辑与撤回 4. 内置去重、防抖处理机制 5. 支持Webhook和WebSocket两种事件接收方式 6. 完善的权限与安全校验机制 7. 历史消息同步与抓包功能 8. TTS语音合成与发送支持 9. 群组管理能力,包括重命名、修改头像、增减成员等
65 lines
2.4 KiB
Python
65 lines
2.4 KiB
Python
EFFECT_MAP: dict[str, str] = {
|
|
"slam": "com.apple.MobileSMS.expressivesend.impact",
|
|
"loud": "com.apple.MobileSMS.expressivesend.loud",
|
|
"gentle": "com.apple.MobileSMS.expressivesend.gentle",
|
|
"invisible-ink": "com.apple.MobileSMS.expressivesend.invisibleink",
|
|
"invisible ink": "com.apple.MobileSMS.expressivesend.invisibleink",
|
|
"invisibleink": "com.apple.MobileSMS.expressivesend.invisibleink",
|
|
"invisible": "com.apple.MobileSMS.expressivesend.invisibleink",
|
|
"echo": "com.apple.messages.effect.CKEchoEffect",
|
|
"spotlight": "com.apple.messages.effect.CKSpotlightEffect",
|
|
"balloons": "com.apple.messages.effect.CKHappyBirthdayEffect",
|
|
"confetti": "com.apple.messages.effect.CKConfettiEffect",
|
|
"love": "com.apple.messages.effect.CKHeartEffect",
|
|
"heart": "com.apple.messages.effect.CKHeartEffect",
|
|
"hearts": "com.apple.messages.effect.CKHeartEffect",
|
|
"lasers": "com.apple.messages.effect.CKLasersEffect",
|
|
"fireworks": "com.apple.messages.effect.CKFireworksEffect",
|
|
"celebration": "com.apple.messages.effect.CKSparklesEffect",
|
|
}
|
|
|
|
BUBBLE_EFFECTS = frozenset(
|
|
{
|
|
"com.apple.MobileSMS.expressivesend.impact",
|
|
"com.apple.MobileSMS.expressivesend.loud",
|
|
"com.apple.MobileSMS.expressivesend.gentle",
|
|
"com.apple.MobileSMS.expressivesend.invisibleink",
|
|
}
|
|
)
|
|
|
|
SCREEN_EFFECTS = frozenset(
|
|
{
|
|
"com.apple.messages.effect.CKEchoEffect",
|
|
"com.apple.messages.effect.CKSpotlightEffect",
|
|
"com.apple.messages.effect.CKHappyBirthdayEffect",
|
|
"com.apple.messages.effect.CKConfettiEffect",
|
|
"com.apple.messages.effect.CKHeartEffect",
|
|
"com.apple.messages.effect.CKLasersEffect",
|
|
"com.apple.messages.effect.CKFireworksEffect",
|
|
"com.apple.messages.effect.CKSparklesEffect",
|
|
}
|
|
)
|
|
|
|
|
|
def resolve_effect_id(raw: str) -> str:
|
|
key = raw.strip().lower()
|
|
if key in EFFECT_MAP:
|
|
return EFFECT_MAP[key]
|
|
normalized = key.replace(" ", "").replace("_", "").replace("-", "")
|
|
for k, v in EFFECT_MAP.items():
|
|
if k.replace(" ", "").replace("_", "").replace("-", "") == normalized:
|
|
return v
|
|
return raw
|
|
|
|
|
|
def is_bubble_effect(effect_id: str) -> bool:
|
|
return effect_id in BUBBLE_EFFECTS
|
|
|
|
|
|
def is_screen_effect(effect_id: str) -> bool:
|
|
return effect_id in SCREEN_EFFECTS
|
|
|
|
|
|
def is_valid_effect(effect_id: str) -> bool:
|
|
return effect_id in BUBBLE_EFFECTS or effect_id in SCREEN_EFFECTS
|