Description
wx members and wx history/wx search output in group chat context sometimes display an incorrect group_nickname — specifically, the inviter's username instead of the actual group nickname.
Root Cause
When parsing chat_room.ext_buffer (protobuf), the code treats field 4 of each member record as group_nickname. Based on cross-referencing with contact table data, the actual semantics are:
| Field |
Meaning |
| field 1 |
wxid |
| field 2 |
group nickname (actual) |
| field 3 |
flag/role |
| field 4 |
inviter username |
Reproduction
Contact table (anonymized):
User A: username=wxid_xxx, nick_name=A, alias=A_custom_id
User B: username=custom_id_b, nick_name=B, alias=B_alias
User A was invited by User B into a group chat.
wx members output for User A:
{
"contact_display": "A",
"display": "custom_id_b",
"group_nickname": "custom_id_b",
"username": "wxid_xxx"
}
display and group_nickname incorrectly show User B's username (the inviter) instead of User A's actual group nickname.
Expected Behavior
{
"contact_display": "A",
"display": "A",
"group_nickname": "",
"username": "wxid_xxx"
}
Suggested Fix
In the ext_buffer protobuf parser:
group_nickname should read from field 2, not field 4
- Field 4 can be exposed as a new
inviter_username field, or ignored
- The
display name resolution should use: field 2 (group_nickname) → contact.remark → contact.nick_name → username
Impact
Any group member whose inviter has a non-empty username will display the inviter's username as their group_nickname and display name. This affects:
wx members output
wx history / wx search sender field in group context
- Any downstream analysis relying on sender identity
Environment
- wx-cli version: 0.2.0
- Platform: macOS Apple Silicon
- WeChat version: 4.x
Description
wx membersandwx history/wx searchoutput in group chat context sometimes display an incorrectgroup_nickname— specifically, the inviter's username instead of the actual group nickname.Root Cause
When parsing
chat_room.ext_buffer(protobuf), the code treats field 4 of each member record asgroup_nickname. Based on cross-referencing withcontacttable data, the actual semantics are:Reproduction
Contact table (anonymized):
User A was invited by User B into a group chat.
wx membersoutput for User A:{ "contact_display": "A", "display": "custom_id_b", "group_nickname": "custom_id_b", "username": "wxid_xxx" }displayandgroup_nicknameincorrectly show User B's username (the inviter) instead of User A's actual group nickname.Expected Behavior
{ "contact_display": "A", "display": "A", "group_nickname": "", "username": "wxid_xxx" }Suggested Fix
In the ext_buffer protobuf parser:
group_nicknameshould read from field 2, not field 4inviter_usernamefield, or ignoreddisplayname resolution should use:field 2 (group_nickname)→contact.remark→contact.nick_name→usernameImpact
Any group member whose inviter has a non-empty username will display the inviter's username as their
group_nicknameanddisplayname. This affects:wx membersoutputwx history/wx searchsender field in group contextEnvironment