Impl delete chatroom members

This commit is contained in:
Changhua 2024-06-27 21:08:37 +08:00
parent 820abd826b
commit 1dc476fb5b
2 changed files with 16 additions and 34 deletions

View File

@ -47,22 +47,17 @@ int AddChatroomMember(string roomid, string wxids)
return status; return status;
} }
#if 0
int DelChatroomMember(string roomid, string wxids) int DelChatroomMember(string roomid, string wxids)
{ {
int status = -1;
if (roomid.empty() || wxids.empty()) { if (roomid.empty() || wxids.empty()) {
LOG_ERROR("Empty roomid or wxids."); LOG_ERROR("Empty roomid or wxids.");
return -1; return status;
} }
int rv = 0; funcGetChatRoomMgr_t GetChatRoomMgr = (funcGetChatRoomMgr_t)(g_WeChatWinDllAddr + g_WxCalls.drm.call1);
DWORD drmCall1 = g_WeChatWinDllAddr + g_WxCalls.drm.call1; funcDelMemberFromChatRoom_t DelMembers = (funcDelMemberFromChatRoom_t)(g_WeChatWinDllAddr + g_WxCalls.drm.call2);
DWORD drmCall2 = g_WeChatWinDllAddr + g_WxCalls.drm.call2;
DWORD drmCall3 = g_WeChatWinDllAddr + g_WxCalls.drm.call3;
DWORD temp = 0;
wstring wsRoomid = String2Wstring(roomid);
WxString wxRoomid(wsRoomid);
vector<wstring> vMembers; vector<wstring> vMembers;
vector<WxString> vWxMembers; vector<WxString> vWxMembers;
@ -71,32 +66,19 @@ int DelChatroomMember(string roomid, string wxids)
wstring wstr; wstring wstr;
getline(wss, wstr, L','); getline(wss, wstr, L',');
vMembers.push_back(wstr); vMembers.push_back(wstr);
WxString txtMember(vMembers.back()); WxString wxMember(vMembers.back());
vWxMembers.push_back(txtMember); vWxMembers.push_back(wxMember);
} }
LOG_DEBUG("Deleting {} members[{}] from {}", vWxMembers.size(), wxids.c_str(), roomid.c_str()); WxString *pWxRoomid = NewWxStringFromStr(roomid);
__asm { QWORD pMembers = (QWORD) & ((RawVector_t *)&vWxMembers)->start;
pushad;
pushfd; QWORD mgr = GetChatRoomMgr();
call drmCall1; status = (int)DelMembers(mgr, pMembers, (QWORD)pWxRoomid);
sub esp, 0x14; return status;
mov esi, eax;
mov ecx, esp;
lea edi, wxRoomid;
push edi;
call drmCall2;
mov ecx, esi;
lea eax, vWxMembers;
push eax;
call drmCall3;
mov rv, eax;
popfd;
popad;
}
return rv;
} }
#if 0
int InviteChatroomMember(string roomid, string wxids) int InviteChatroomMember(string roomid, string wxids)
{ {
wstring wsRoomid = String2Wstring((roomid)); wstring wsRoomid = String2Wstring((roomid));

View File

@ -794,7 +794,6 @@ bool func_add_room_members(char *roomid, char *wxids, uint8_t *out, size_t *len)
return true; return true;
} }
#if 0
bool func_del_room_members(char *roomid, char *wxids, uint8_t *out, size_t *len) bool func_del_room_members(char *roomid, char *wxids, uint8_t *out, size_t *len)
{ {
Response rsp = Response_init_default; Response rsp = Response_init_default;
@ -819,6 +818,7 @@ bool func_del_room_members(char *roomid, char *wxids, uint8_t *out, size_t *len)
return true; return true;
} }
#if 0
bool func_invite_room_members(char *roomid, char *wxids, uint8_t *out, size_t *len) bool func_invite_room_members(char *roomid, char *wxids, uint8_t *out, size_t *len)
{ {
Response rsp = Response_init_default; Response rsp = Response_init_default;
@ -980,11 +980,11 @@ static bool dispatcher(uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len
ret = func_add_room_members(req.msg.m.roomid, req.msg.m.wxids, out, out_len); ret = func_add_room_members(req.msg.m.roomid, req.msg.m.wxids, out, out_len);
break; break;
} }
#if 0
case Functions_FUNC_DEL_ROOM_MEMBERS: { case Functions_FUNC_DEL_ROOM_MEMBERS: {
ret = func_del_room_members(req.msg.m.roomid, req.msg.m.wxids, out, out_len); ret = func_del_room_members(req.msg.m.roomid, req.msg.m.wxids, out, out_len);
break; break;
} }
#if 0
case Functions_FUNC_INV_ROOM_MEMBERS: { case Functions_FUNC_INV_ROOM_MEMBERS: {
ret = func_invite_room_members(req.msg.m.roomid, req.msg.m.wxids, out, out_len); ret = func_invite_room_members(req.msg.m.roomid, req.msg.m.wxids, out, out_len);
break; break;