diff --git a/.github/workflows/capacitor-android-ci.yml b/.github/workflows/capacitor-android-ci.yml index 3bd3e65f..0e238dc7 100644 --- a/.github/workflows/capacitor-android-ci.yml +++ b/.github/workflows/capacitor-android-ci.yml @@ -43,6 +43,8 @@ jobs: java-version: "21" - name: Setup Android SDK uses: android-actions/setup-android@v3 + with: + packages: platform-tools - name: Install Android SDK 36 run: sdkmanager "platforms;android-36" "build-tools;36.0.0" - name: Validate Gradle wrappers diff --git a/CHANGELOG.md b/CHANGELOG.md index fdaa3ec1..3c67d56c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ EdgeChat 从 `2.1.2` 起正式采用语义化版本。更早的版本号依据已经完成的主要里程碑补记,用于说明项目演进,不对应历史 Git 标签。 +## 2.7.1 - 2026-09-15 + +- 修复 Capacitor Android CI 初始化阶段请求已下架 Android SDK `tools` 包的问题,显式仅安装仍可用的 `platform-tools` 后再安装既有 SDK 36;不改动 Android 源码或功能。 + +## 2.7.0 - 2026-09-15 + +- Telegram 桥接由仅支持公开群组扩展为支持公开与私有群组,管理员可在同一后台列表中查看群名、区分群类型并统一配置映射。 +- 私有群的 Telegram 入站、出站、附件、回复、实时广播与未读投影复用现有群聊链路;一对一私信继续保持不可映射。 +- 同步更新生产与 demo 契约、三语言界面和部署文档;不新增数据库迁移、云资源或 Android 原生改动。 + ## 2.6.2 - 2026-09-15 - 新增繁体中文界面,右上角语言入口改为简体中文、繁体中文与 English 三项菜单,并按当前语言异步加载独立语言包。 diff --git a/README.en.md b/README.en.md index 5b3119a8..c0c73c47 100644 --- a/README.en.md +++ b/README.en.md @@ -90,7 +90,7 @@ The project itself is free and open source. Cloud service costs depend on your C **You do not have to move everyone into the same application.** -Administrators can bind EdgeChat groups to Telegram groups and relay messages in both directions through a Telegram Bot: messages sent on the web can be synchronized to Telegram, and messages in the Telegram group return to EdgeChat. +Administrators can view both public and private EdgeChat groups in the admin console and bind any group to a Telegram group. A Telegram Bot relays messages in both directions: messages sent on the web can be synchronized to Telegram, and messages in the Telegram group return to EdgeChat. One-to-one direct messages are never bridged. This suits teams and communities that already have Telegram groups but also need an independent web chat entry point. @@ -129,7 +129,7 @@ This suits teams and communities that already have Telegram groups but also need ### 🔌 Connections and Extensions -- Two-way Telegram group message bridging, including voice message synchronization. +- Administrator-configured two-way Telegram bridging for public and private groups, including voice message synchronization. - WebMCP site tools: in compatible client environments, provides login, conversation queries, message reading, sending, and related capabilities. ## Privacy and Encryption diff --git a/README.ja.md b/README.ja.md index e8eb789c..5038c24d 100644 --- a/README.ja.md +++ b/README.ja.md @@ -90,7 +90,7 @@ EdgeChat は、**自分のチャットスペースを持ちたいが、そのた **全員を同じアプリに移行させる必要はありません。** -管理者は EdgeChat のグループと Telegram のグループを紐付け、Telegram Bot を介してメッセージを双方向に転送できます。Web 上で送信したメッセージは Telegram に同期され、Telegram グループのメッセージも EdgeChat に戻ってきます。 +管理者は管理画面で EdgeChat の公開・非公開グループを確認し、任意のグループを Telegram グループに紐付けられます。Telegram Bot を介してメッセージが双方向に転送され、Web 上で送信したメッセージは Telegram に同期され、Telegram グループのメッセージも EdgeChat に戻ってきます。一対一のダイレクトメッセージはブリッジされません。 Telegram グループがすでにあり、同時に独立した Web チャット入口も必要とするチームやコミュニティに適しています。 @@ -129,7 +129,7 @@ Telegram グループがすでにあり、同時に独立した Web チャット ### 🔌 接続と拡張 -- Telegram グループとの双方向メッセージブリッジ。音声メッセージの同期にも対応。 +- 管理者が設定する公開・非公開グループと Telegram の双方向メッセージブリッジ。音声メッセージの同期にも対応。 - WebMCP サイトツール:対応クライアント環境で、ログイン、会話の検索、メッセージの読み取り・送信などを提供。 ## プライバシーと暗号化 diff --git a/README.md b/README.md index 130e3ed5..5f1c4b7c 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ EdgeChat 面向这样一种需求:**想拥有一个自己的聊天空间,又 **不用把所有人都搬进同一个应用。** -管理员可以将 EdgeChat 群组与 Telegram 群组绑定,通过 Telegram Bot 双向转发消息:在网页里发出的消息可以同步到 Telegram,Telegram 群里的消息也会回到 EdgeChat。 +管理员可以在后台查看 EdgeChat 的公开与私有群组,并将任一群组与 Telegram 群组绑定。Telegram Bot 会双向转发消息:在网页里发出的消息可以同步到 Telegram,Telegram 群里的消息也会回到 EdgeChat;一对一私信不会进入桥接。 适合已经有 Telegram 群、同时又需要一个独立网页聊天入口的团队和社区。 @@ -129,7 +129,7 @@ EdgeChat 面向这样一种需求:**想拥有一个自己的聊天空间,又 ### 🔌 连接与扩展 -- Telegram 群组双向消息桥接,支持语音消息同步。 +- 公开与私有群组均可由管理员配置 Telegram 双向消息桥接,并支持语音消息同步。 - WebMCP 站点工具:在兼容的客户端环境中,提供登录、查询会话、读取与发送消息等能力。 ## 隐私与加密 diff --git a/frontend/src/demo/api.js b/frontend/src/demo/api.js index d1f532aa..811952a8 100644 --- a/frontend/src/demo/api.js +++ b/frontend/src/demo/api.js @@ -13,6 +13,7 @@ import { } from './state.js'; import { demoMaintenanceReport } from './maintenance.ts'; +import { isGroupChannelKind } from '../../../shared/group-channel.ts'; import { parseLocalUserId, validateBio } from '../../../shared/user-profile.ts'; const DEMO_DELAY_MS = 90; @@ -75,8 +76,8 @@ function telegramPayload() { return cloneDemo({ config: demoState.telegram.config, channels: demoState.channels - .filter((channel) => channel.kind === 'public') - .map(({ id, name }) => ({ id, name })), + .filter((channel) => isGroupChannelKind(channel.kind)) + .map(({ id, name, kind }) => ({ id, name, kind })), mappings: demoState.telegram.mappings }); } @@ -498,11 +499,14 @@ export async function requestDemo(path, options = {}) { } if (method === 'POST' && pathname === '/admin/telegram/mappings') { const channel = findDemoChannel(body.channelId); - if (!channel) fail('请选择公开群组'); + if (!channel || !isGroupChannelKind(channel.kind) || !/^-\d+$/.test(String(body.telegramChatId || ''))) { + fail('请选择群组并填写有效的 Telegram 群 ID'); + } demoState.telegram.mappings.push({ id: demoState.nextMappingId++, channelId: channel.id, channelName: channel.name, + channelKind: channel.kind, telegramChatTitle: 'Telegram 演示群', telegramChatId: String(body.telegramChatId || ''), enabled: true diff --git a/frontend/src/demo/fixtures.js b/frontend/src/demo/fixtures.js index 8bf72542..206b8965 100644 --- a/frontend/src/demo/fixtures.js +++ b/frontend/src/demo/fixtures.js @@ -420,6 +420,7 @@ export function createDemoFixtures() { id: 1, channelId: 3, channelName: 'Telegram 联动', + channelKind: 'public', telegramChatTitle: 'EdgeChat 演示群', telegramChatId: '-1002345678901', enabled: true diff --git a/frontend/src/demo/realtime.js b/frontend/src/demo/realtime.js index 63856386..dbbde160 100644 --- a/frontend/src/demo/realtime.js +++ b/frontend/src/demo/realtime.js @@ -5,6 +5,7 @@ import { getDemoDirectMessageBlockStatus, roomKey } from './state.js'; +import { isGroupChannelKind } from '../../../shared/group-channel.ts'; const roomSockets = new Map(); const inboxSockets = new Set(); @@ -73,7 +74,7 @@ function telegramSender() { } function hasEnabledTelegramMapping(kind, roomId) { - return kind === 'public' && demoState.telegram.mappings.some( + return isGroupChannelKind(kind) && demoState.telegram.mappings.some( (mapping) => Number(mapping.channelId) === Number(roomId) && mapping.enabled ); } diff --git a/frontend/src/locales/en-US.js b/frontend/src/locales/en-US.js index 91995b34..766e0bcf 100644 --- a/frontend/src/locales/en-US.js +++ b/frontend/src/locales/en-US.js @@ -282,7 +282,7 @@ export default { 'admin.nav.createUser': 'Create user', 'admin.nav.registrationLinks': 'Registration links', 'admin.nav.telegram': 'Telegram integration', - 'admin.nav.telegramDescription': 'Manage the bot and public group mappings', + 'admin.nav.telegramDescription': 'Manage the bot and group mappings', 'admin.nav.site': 'Site settings', 'admin.nav.siteDescription': 'Manage site appearance and version status', 'admin.nav.siteAppearance': 'Site appearance', @@ -395,7 +395,7 @@ export default { 'invites.copy': 'Copy', 'invites.revoke': 'Disable link', 'telegram.title': 'Telegram integration', - 'telegram.description': 'Connect a Telegram bot and link public groups to Telegram chats.', + 'telegram.description': 'Connect a Telegram bot and link public or private groups to Telegram chats.', 'telegram.botConnected': 'Bot connected. Webhook updated.', 'telegram.mappingSaved': 'Group mapping saved.', 'telegram.confirmDeleteMapping': 'Delete the Telegram mapping for {name}?', @@ -410,7 +410,7 @@ export default { 'telegram.connectBot': 'Connect bot', 'telegram.groupMappings': 'Group mappings', 'telegram.mappingCount': '{count} Telegram groups linked', - 'telegram.edgechatPublicGroup': 'EdgeChat public group', + 'telegram.edgechatGroup': 'EdgeChat group', 'telegram.selectGroup': 'Select group', 'telegram.chatId': 'Telegram group ID', 'telegram.saveMapping': 'Save mapping', diff --git a/frontend/src/locales/server-errors/en-US.js b/frontend/src/locales/server-errors/en-US.js index aae43296..d675a440 100644 --- a/frontend/src/locales/server-errors/en-US.js +++ b/frontend/src/locales/server-errors/en-US.js @@ -65,7 +65,7 @@ const fixedErrorTranslations = new Map([ ['Webhook 验证失败', 'Webhook verification failed'], ['Telegram Bot Token 不能为空', 'Telegram Bot Token cannot be empty'], ['Telegram 配置保存失败', 'Failed to save Telegram configuration'], - ['请选择公开群组并填写有效的 Telegram 群 ID', 'Select a public group and enter a valid Telegram group ID'], + ['请选择群组并填写有效的 Telegram 群 ID', 'Select a group and enter a valid Telegram group ID'], ['请先连接 Telegram Bot', 'Connect the Telegram Bot first'], ['目标必须是 Telegram 群组或超级群组', 'The target must be a Telegram group or supergroup'], ['这个 EdgeChat 群组或 Telegram 群已经绑定', 'This EdgeChat group or Telegram group is already linked'], @@ -79,7 +79,7 @@ const fixedErrorTranslations = new Map([ ['请输入群组名称', 'Please enter a group name'], ['请输入新密码', 'Please enter a new password'], ['请输入 Bot Token', 'Please enter a Bot token'], - ['请选择公开群组', 'Please select a public group'] + ['请选择群组', 'Please select a group'] ]); const dynamicErrorTranslations = [ diff --git a/frontend/src/locales/server-errors/zh-TW.js b/frontend/src/locales/server-errors/zh-TW.js index b4b9e3d7..9d2d024a 100644 --- a/frontend/src/locales/server-errors/zh-TW.js +++ b/frontend/src/locales/server-errors/zh-TW.js @@ -65,7 +65,7 @@ const fixedErrorTranslations = new Map([ ["Webhook 验证失败", "Webhook 驗證失敗"], ["Telegram Bot Token 不能为空", "Telegram Bot Token 不能為空"], ["Telegram 配置保存失败", "Telegram 配置保存失敗"], - ["请选择公开群组并填写有效的 Telegram 群 ID", "請選擇公開群組並填寫有效的 Telegram 群 ID"], + ["请选择群组并填写有效的 Telegram 群 ID", "請選擇群組並填寫有效的 Telegram 群 ID"], ["请先连接 Telegram Bot", "請先連接 Telegram Bot"], ["目标必须是 Telegram 群组或超级群组", "目標必須是 Telegram 群組或超級群組"], ["这个 EdgeChat 群组或 Telegram 群已经绑定", "這個 EdgeChat 群組或 Telegram 群已經綁定"], @@ -79,7 +79,7 @@ const fixedErrorTranslations = new Map([ ["请输入群组名称", "請輸入群組名稱"], ["请输入新密码", "請輸入新密碼"], ["请输入 Bot Token", "請輸入 Bot Token"], - ["请选择公开群组", "請選擇公開群組"] + ["请选择群组", "請選擇群組"] ]); const dynamicErrorTranslations = [ diff --git a/frontend/src/locales/zh-CN.js b/frontend/src/locales/zh-CN.js index 9e86a7dd..f016e5f0 100644 --- a/frontend/src/locales/zh-CN.js +++ b/frontend/src/locales/zh-CN.js @@ -282,7 +282,7 @@ export default { 'admin.nav.createUser': '创建用户', 'admin.nav.registrationLinks': '注册链接', 'admin.nav.telegram': 'Telegram 互通', - 'admin.nav.telegramDescription': '管理 Bot 与公开群组映射', + 'admin.nav.telegramDescription': '管理 Bot 与群组映射', 'admin.nav.site': '网站设置', 'admin.nav.siteDescription': '维护站点外观与版本状态', 'admin.nav.siteAppearance': '站点外观', @@ -395,7 +395,7 @@ export default { 'invites.copy': '复制', 'invites.revoke': '停用链接', 'telegram.title': 'Telegram 互通', - 'telegram.description': '连接一个 Telegram Bot,并将公开群组绑定到 Telegram 群聊。', + 'telegram.description': '连接一个 Telegram Bot,并将公开或私有群组绑定到 Telegram 群聊。', 'telegram.botConnected': 'Bot 已连接,Webhook 已更新。', 'telegram.mappingSaved': '群组映射已保存。', 'telegram.confirmDeleteMapping': '确认删除 {name} 的 Telegram 映射吗?', @@ -410,7 +410,7 @@ export default { 'telegram.connectBot': '连接 Bot', 'telegram.groupMappings': '群组映射', 'telegram.mappingCount': '{count} 个 Telegram 群已绑定', - 'telegram.edgechatPublicGroup': 'EdgeChat 公开群组', + 'telegram.edgechatGroup': 'EdgeChat 群组', 'telegram.selectGroup': '选择群组', 'telegram.chatId': 'Telegram 群 ID', 'telegram.saveMapping': '保存映射', diff --git a/frontend/src/locales/zh-TW.js b/frontend/src/locales/zh-TW.js index 1773b50b..bef08610 100644 --- a/frontend/src/locales/zh-TW.js +++ b/frontend/src/locales/zh-TW.js @@ -349,7 +349,7 @@ export default { "admin.nav.createUser": "創建用戶", "admin.nav.registrationLinks": "註冊鏈接", "admin.nav.telegram": "Telegram 互通", - "admin.nav.telegramDescription": "管理 Bot 與公開群組映射", + "admin.nav.telegramDescription": "管理 Bot 與群組映射", "admin.nav.site": "網站設置", "admin.nav.siteDescription": "維護站點外觀與版本狀態", "admin.nav.siteAppearance": "站點外觀", @@ -462,7 +462,7 @@ export default { "invites.copy": "複製", "invites.revoke": "停用鏈接", "telegram.title": "Telegram 互通", - "telegram.description": "連接一個 Telegram Bot,並將公開群組綁定到 Telegram 群聊。", + "telegram.description": "連接一個 Telegram Bot,並將公開或私有群組綁定到 Telegram 群聊。", "telegram.botConnected": "Bot 已連接,Webhook 已更新。", "telegram.mappingSaved": "群組映射已保存。", "telegram.confirmDeleteMapping": "確認刪除 {name} 的 Telegram 映射嗎?", @@ -477,7 +477,7 @@ export default { "telegram.connectBot": "連接 Bot", "telegram.groupMappings": "群組映射", "telegram.mappingCount": "{count} 個 Telegram 群已綁定", - "telegram.edgechatPublicGroup": "EdgeChat 公開群組", + "telegram.edgechatGroup": "EdgeChat 群組", "telegram.selectGroup": "選擇群組", "telegram.chatId": "Telegram 群 ID", "telegram.saveMapping": "保存映射", diff --git a/frontend/src/pages/AdminTelegramPage.vue b/frontend/src/pages/AdminTelegramPage.vue index 99e78d0d..43096b14 100644 --- a/frontend/src/pages/AdminTelegramPage.vue +++ b/frontend/src/pages/AdminTelegramPage.vue @@ -138,11 +138,11 @@ onMounted(loadState);