Fix duplicated message

This commit is contained in:
Changhua 2023-03-06 19:41:01 +08:00
parent c8e6558cb6
commit 2e9cf595ee

View File

@ -66,7 +66,7 @@ bool func_is_login(uint8_t *out, size_t *len)
bool func_get_self_wxid(uint8_t *out, size_t *len)
{
string wxid = GetSelfWxid();
string wxid = GetSelfWxid();
Response rsp = Response_init_default;
rsp.func = Functions_FUNC_GET_SELF_WXID;
rsp.which_msg = Response_str_tag;
@ -306,6 +306,7 @@ static void PushMessage()
rsp.msg.wxmsg.content = (char *)wxmsg.content.c_str();
gMsgQueue.pop();
LOG_DEBUG("Recv msg: {}", wxmsg.content);
pb_ostream_t stream = pb_ostream_from_buffer(buffer, G_BUF_SIZE);
if (!pb_encode(&stream, Response_fields, &rsp)) {
LOG_ERROR("Encoding failed: {}", PB_GET_ERROR(&stream));
continue;