Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛BUG] 私聊场景缺少接收者ID #51

Open
RedRiverCN opened this issue Jul 24, 2023 · 0 comments
Open

[🐛BUG] 私聊场景缺少接收者ID #51

RedRiverCN opened this issue Jul 24, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@RedRiverCN
Copy link

描述这个 bug
void DispatchMsg(DWORD reg)
{
WxMsg_t wxMsg;

wxMsg.id      = GET_QWORD(reg + g_WxCalls.recvMsg.msgId);
wxMsg.type    = GET_DWORD(reg + g_WxCalls.recvMsg.type);
wxMsg.is_self = GET_DWORD(reg + g_WxCalls.recvMsg.isSelf);
wxMsg.ts      = GET_DWORD(reg + g_WxCalls.recvMsg.ts);
wxMsg.content = GetStringByWstrAddr(reg + g_WxCalls.recvMsg.content);
wxMsg.sign    = GetStringByStrAddr(reg + g_WxCalls.recvMsg.sign);
wxMsg.xml     = GetStringByStrAddr(reg + g_WxCalls.recvMsg.msgXml);

string roomid = GetStringByWstrAddr(reg + g_WxCalls.recvMsg.roomId);
if (roomid.find("@chatroom") != string::npos) { // 群 ID 的格式为 xxxxxxxxxxx@chatroom
    wxMsg.is_group = true;
    wxMsg.roomid   = roomid;
    if (wxMsg.is_self) {
        wxMsg.sender = GetSelfWxid();
    } else {
        wxMsg.sender = GetStringByStrAddr(reg + g_WxCalls.recvMsg.wxid);
    }
} else {
    wxMsg.is_group = false;
     ** 在此处是私聊场景 **
    if (wxMsg.is_self) {
         ** 假设我是A,与B私聊,发送者是我A,则本条消息丢失了接收者B的信息,只知道是我A发出的,而不知道是我发给谁的 **
         ** 因为B的信息存储在0x48偏移也就是roomid中,也就是缺少了这句wxMsg.roomid   = roomid; **
         ** 也可以考虑新增一个字段来表示接收者 wxMsg.receiver= roomid; **
        wxMsg.sender = GetSelfWxid();  
    } else {
        wxMsg.sender = roomid;
    }
}

...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants