From 3c5bf563a67d850f154353fb0df9104818ae5b2b Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Sun, 27 Mar 2022 21:39:47 +0300 Subject: [PATCH] Pass ids to TDLibWrapper::viewMessage as integers Because they are integers --- src/chatmodel.cpp | 2 +- src/tdlibwrapper.cpp | 2 +- src/tdlibwrapper.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chatmodel.cpp b/src/chatmodel.cpp index f549507..a89c5d0 100644 --- a/src/chatmodel.cpp +++ b/src/chatmodel.cpp @@ -558,7 +558,7 @@ void ChatModel::handleMessageSendSucceeded(qlonglong messageId, qlonglong oldMes const QModelIndex messageIndex(index(pos)); emit dataChanged(messageIndex, messageIndex, changedRoles); emit lastReadSentMessageUpdated(calculateLastReadSentMessageId()); - tdLibWrapper->viewMessage(QString::number(this->chatId), QString::number(messageId), false); + tdLibWrapper->viewMessage(this->chatId, messageId, false); } } diff --git a/src/tdlibwrapper.cpp b/src/tdlibwrapper.cpp index 8182971..0c83b61 100644 --- a/src/tdlibwrapper.cpp +++ b/src/tdlibwrapper.cpp @@ -333,7 +333,7 @@ void TDLibWrapper::getChatHistory(qlonglong chatId, qlonglong fromMessageId, int this->sendRequest(requestObject); } -void TDLibWrapper::viewMessage(const QString &chatId, const QString &messageId, bool force) +void TDLibWrapper::viewMessage(qlonglong chatId, qlonglong messageId, bool force) { LOG("Mark message as viewed" << chatId << messageId); QVariantMap requestObject; diff --git a/src/tdlibwrapper.h b/src/tdlibwrapper.h index fbe5e92..80b2199 100644 --- a/src/tdlibwrapper.h +++ b/src/tdlibwrapper.h @@ -158,7 +158,7 @@ public: Q_INVOKABLE void leaveChat(const QString &chatId); Q_INVOKABLE void deleteChat(qlonglong chatId); Q_INVOKABLE void getChatHistory(qlonglong chatId, qlonglong fromMessageId = 0, int offset = -1, int limit = 50, bool onlyLocal = false); - Q_INVOKABLE void viewMessage(const QString &chatId, const QString &messageId, bool force); + Q_INVOKABLE void viewMessage(qlonglong chatId, qlonglong messageId, bool force); Q_INVOKABLE void viewSponsoredMessage(qlonglong chatId, qlonglong messageId); Q_INVOKABLE void pinMessage(const QString &chatId, const QString &messageId, bool disableNotification = false); Q_INVOKABLE void unpinMessage(const QString &chatId, const QString &messageId);