From 932c6454190cccc4a3dd26b42e439f26104df1dc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 30 Nov 2023 12:01:09 +0300 Subject: code cleaning --- protocols/Telegram/src/server.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'protocols/Telegram/src') diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp index 0a7703fdfb..acf31c7e96 100644 --- a/protocols/Telegram/src/server.cpp +++ b/protocols/Telegram/src/server.cpp @@ -224,19 +224,20 @@ void CTelegramProto::ProcessResponse(td::ClientManager::Response response) case TD::updateMessageSendSucceeded::ID: { - auto *pMessage = (TD::updateMessageSendSucceeded *)response.object.get(); + auto *pUpdate = (TD::updateMessageSendSucceeded *)response.object.get(); + auto *pMessage = pUpdate->message_.get(); - auto szOldId = msg2id(pMessage->message_->chat_id_, pMessage->old_message_id_); - if (pMessage->old_message_id_) + auto szOldId = msg2id(pMessage->chat_id_, pUpdate->old_message_id_); + if (pUpdate->old_message_id_) if (auto hDbEvent = db_event_getById(m_szModuleName, szOldId)) - db_event_updateId(hDbEvent, msg2id(pMessage->message_.get())); + db_event_updateId(hDbEvent, msg2id(pMessage)); - ProcessMessage(pMessage->message_.get()); + ProcessMessage(pMessage); TG_OWN_MESSAGE tmp(0, 0, szOldId); if (auto *pOwnMsg = m_arOwnMsg.find(&tmp)) { if (pOwnMsg->hAck) - ProtoBroadcastAck(pOwnMsg->hContact ? pOwnMsg->hContact : m_iSavedMessages, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, pOwnMsg->hAck, (LPARAM)pOwnMsg->szMsgId.c_str()); + ProtoBroadcastAck(pOwnMsg->hContact ? pOwnMsg->hContact : m_iSavedMessages, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, pOwnMsg->hAck, (LPARAM)msg2id(pMessage).c_str()); m_arOwnMsg.remove(pOwnMsg); } -- cgit v1.2.3