From e121000efa5c0e0c69681dd75c3e8a7771a37ee5 Mon Sep 17 00:00:00 2001 From: Changhua Date: Wed, 12 Feb 2025 01:32:26 +0800 Subject: [PATCH] refactor(account): update rpc_get_user_info with new fill_response template --- WeChatFerry/spy/account_manager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/WeChatFerry/spy/account_manager.cpp b/WeChatFerry/spy/account_manager.cpp index 93b0b11..c0d3dc0 100644 --- a/WeChatFerry/spy/account_manager.cpp +++ b/WeChatFerry/spy/account_manager.cpp @@ -77,12 +77,12 @@ bool rpc_get_self_wxid(uint8_t *out, size_t *len) bool rpc_get_user_info(uint8_t *out, size_t *len) { - return fill_response(out, len, [](Response &rsp) { - static UserInfo_t ui = get_user_info(); - rsp.msg.ui.wxid = (char *)ui.wxid.c_str(); - rsp.msg.ui.name = (char *)ui.name.c_str(); - rsp.msg.ui.mobile = (char *)ui.mobile.c_str(); - rsp.msg.ui.home = (char *)ui.home.c_str(); + UserInfo_t ui = get_user_info(); + return fill_response(out, len, ui, [](Response &rsp, UserInfo_t &ui) { + rsp.msg.ui.wxid = (char *)ui.wxid.c_str(); + rsp.msg.ui.name = (char *)ui.name.c_str(); + rsp.msg.ui.mobile = (char *)ui.mobile.c_str(); + rsp.msg.ui.home = (char *)ui.home.c_str(); }); }