Conversation
- Introduced configuration options for enabling E2EE and specifying the storage path for encryption keys. - Implemented E2EEManager to handle encryption and decryption of messages using the vodozemac library. - Added CryptoStore for persistent storage of encryption keys and sessions. - Enhanced OlmMachine to manage Olm/Megolm encryption operations. - Updated MatrixPlatformAdapter to initialize E2EE components if enabled. - Modified event processing to decrypt incoming encrypted messages when E2EE is enabled. - Added HTTP client methods for uploading and querying encryption keys.
…ecification documentation - Updated the import statement in verification.py to use EstablishedSas from vodozemac. - Enhanced event_processor.py to handle 'm.forwarded_room_key' events, allowing for the processing of forwarded Megolm keys. - Introduced a comprehensive Matrix client specification document, detailing the Client-Server API based on Matrix Specification v1.17.
…r Handling - Introduced constants for various string literals and magic numbers across E2EE, Key Backup, and related modules to enhance maintainability and readability. - Updated the E2EEManager to utilize constants for message types and algorithms, improving clarity and reducing hardcoded values. - Enhanced error handling in the Key Backup module, ensuring more robust recovery key processing and validation. - Improved logging messages for better debugging and traceability. - Refactored the MatrixEventProcessor and MatrixReceiver to use constants for message processing limits and types. - General code cleanup and formatting adjustments for consistency across the codebase.
…ry logic to prioritize cached keys.
修复 Matrix 媒体下载认证问题: - 在 download_file 方法中添加 Authorization 头 - 使用 Bearer token 进行身份验证 - 解决 403 访问被拒绝的问题 - 现在贴纸和图片可以正常下载 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
添加媒体下载调试日志: - 记录是否使用认证进行下载 - 帮助诊断跨域媒体访问问题 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
增强 Matrix 媒体下载功能: - 添加直接从源服务器下载的策略 - 支持跨域媒体访问(mozilla.org -> neko.aaca.eu.org) - 保持 homeserver 代理下载作为首选 - 提供多种下载策略以提高成功率 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
修复 Matrix 媒体下载中的直接服务器URL构建: - 修复直接从源服务器下载的URL构建逻辑 - 确保非认证请求使用完整的HTTPS URL - 提高跨域媒体访问的成功率 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
为 Matrix 媒体下载添加全面的日志记录: - 记录每个下载尝试的策略(代理或直接) - 帮助诊断跨域媒体访问问题 - 显示详细的下载过程 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…o tracking Co-authored-by: stevessr <89645372+stevessr@users.noreply.github.com>
Co-authored-by: stevessr <89645372+stevessr@users.noreply.github.com>
Co-authored-by: stevessr <89645372+stevessr@users.noreply.github.com>
Co-authored-by: stevessr <89645372+stevessr@users.noreply.github.com>
Co-authored-by: stevessr <89645372+stevessr@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add complete handling for all E2EE events
Implement complete E2EE event handling and auto-reply-to tracking for Matrix adapter
Dec 23, 2025
Owner
|
@copilot 在再次自我审查,确认已经完整实现了matrix的e2ee的所有功能,包括密钥交换,设备交叉验证,密钥交换的控制(可信设备,交叉验证设备,所有设备),需要允许从其他设备验证以交换密钥,同时,修改存储恢复密钥的键值为脱水恢复密钥(用户只能,也只应该能提供这个用于恢复),同时,持久化备份密钥 |
…E features Co-authored-by: stevessr <89645372+stevessr@users.noreply.github.com>
Author
已完成审查和文档更新(提交 3a71374): ✅ E2EE完整实现确认:
✅ 配置键名更新:
✅ 备份密钥持久化:
实现位置:
|
Co-authored-by: stevessr <89645372+stevessr@users.noreply.github.com>
Copilot
AI
changed the title
Implement complete E2EE event handling and auto-reply-to tracking for Matrix adapter
Implement complete E2EE event handling, auto-reply-to tracking, and dehydrated device key support for Matrix adapter
Dec 23, 2025
93f1224 to
a8f0b29
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per Matrix spec, complete E2EE support requires handling all encryption-related events from sync responses. Additionally, implement auto-reply-to tracking to prevent message escape by ensuring bot responses stay anchored to user messages.
E2EE Event Handling
Added sync response processing for:
Added to-device event handlers:
Auto Reply-to Tracking
Tracks last received user message per room. When bot sends without explicit reply_to, auto-replies to tracked message to maintain conversation thread.
Key insight: Track user messages, not bot's own - prevents infinite loops while ensuring replies stay anchored to conversation context.
Dehydrated Device Key Support
Updated documentation and configuration to prioritize dehydrated device keys (脱水恢复密钥) as the recommended recovery method:
matrix_e2ee_recovery_keynow explicitly supports dehydrated device keys exported from FluffyChat/Elementm.dehydrated_deviceeventsextracted_backup_key.binand auto-loaded on restartUsers should only provide dehydrated device keys for recovery - this is the safest and most recommended approach.
Complete E2EE Implementation Confirmed
Added comprehensive documentation (
docs/matrix_e2ee_implementation.md) confirming full implementation:Key Exchange (密钥交换):
Device Cross-Verification (设备交叉验证):
Key Exchange Control (密钥交换控制):
Key Backup & Recovery:
Changes
sync_manager.py: Added device_lists/key_counts callbacksadapter.py: Added_last_received_message_idstracking, updated logs for dehydrated device key supporte2ee_manager.py: Handlers for device_lists, key_counts with auto-replenishment, enhanced documentationevent_processor.py: Handlers for m.secret.*, m.dummy eventsevent.py: Return event_id from send operationsconstants.py: Added E2EE constants, ONE_TIME_KEYS_REPLENISH_THRESHOLDconfig.py: Clarified dehydrated device key support and prioritydefault.py: Updated UI hints for recovery key configurationkey_backup.py: Enhanced documentation for dehydrated device key extractiontests/test_matrix_e2ee_events.py: Unit tests for new functionalitydocs/matrix_e2ee_implementation.md: Comprehensive E2EE implementation guideOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.