Skip to content

feat: resolve group message senders to room-specific nicknames - #16

Merged
r266-tech merged 1 commit into
r266-tech:mainfrom
eyaeya:agent/group-sender-nicknames
Jul 26, 2026
Merged

feat: resolve group message senders to room-specific nicknames#16
r266-tech merged 1 commit into
r266-tech:mainfrom
eyaeya:agent/group-sender-nicknames

Conversation

@eyaeya

@eyaeya eyaeya commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Resolve group-message senders against room-specific RoomData nicknames while preserving stable sender IDs and contact-level display names.
  • Add a strictly bounded, same-room quoted-message fallback for cases where contact.db is unavailable or unreadable, or the member is absent from current RoomData.
  • Apply the identity contract consistently to messages/timeline/history, context, search, and media metadata.

Output contract

For group messages:

  • sender_wxid remains the stable identity.
  • sender_group_nickname is emitted only when a room-scoped nickname is resolved reliably.
  • sender_contact_display preserves a distinct contact-level display name when available.
  • sender prefers group nickname, then contact display, then raw sender ID.

Private messages retain their existing behavior. Unresolved optional fields are omitted.

Implementation notes

  • Decode only the required subset of the chat_room.ext_buffer RoomData protobuf.
  • Treat current RoomData membership as authoritative even when its display name is empty, preventing an old quote from resurrecting a cleared group nickname.
  • Use the newest bounded historical quote scan before falling back to identity evidence already present in the requested rows.
  • Require the carrying room to match refermsg.fromusr, reject room IDs as member IDs, and filter fallback results to requested members.
  • Bound RoomData sizes, member counts, room counts, message sizes, per-shard scans, and request-wide scan volume.
  • Perform group-nickname search enrichment after filtering and pagination.
  • Degrade to the existing contact/raw-ID display if any optional lookup or parse fails.

Validation

  • go test -count=1 ./...
  • go test -race -count=1 ./cmd/wechat-cli
  • go vet ./...
  • git diff --check
  • Windows amd64, CGO_ENABLED=0 cross-compilation of ./cmd/wechat-cli
  • macOS arm64 with WeChat 4.1.12 in strict read-only mode, using two private local fixtures

All committed tests use synthetic room, member, nickname, and message values.

Closes #15

@eyaeya
eyaeya marked this pull request as ready for review July 26, 2026 04:16
@r266-tech
r266-tech merged commit 2d91d7f into r266-tech:main Jul 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Group messages: resolve senders to room-specific group nicknames

2 participants