diff --git a/qml/components/MessageListViewItem.qml b/qml/components/MessageListViewItem.qml index 38cdc11..189f429 100644 --- a/qml/components/MessageListViewItem.qml +++ b/qml/components/MessageListViewItem.qml @@ -133,8 +133,10 @@ ListItem { if (messageListItem.messageReactions) { messageListItem.messageReactions = null; } else if (messageListItem.chatReactions) { + Debug.log("Using chat reactions") messageListItem.messageReactions = chatReactions } else { + Debug.log("Obtaining message reactions") tdLibWrapper.getMessageAvailableReactions(messageListItem.chatId, messageListItem.messageId); } } diff --git a/src/tdlibreceiver.cpp b/src/tdlibreceiver.cpp index f14eeeb..8f65952 100644 --- a/src/tdlibreceiver.cpp +++ b/src/tdlibreceiver.cpp @@ -127,6 +127,7 @@ TDLibReceiver::TDLibReceiver(void *tdLibClient, QObject *parent) : QThread(paren handlers.insert("updateSupergroup", &TDLibReceiver::processUpdateSuperGroup); handlers.insert("updateChatOnlineMemberCount", &TDLibReceiver::processChatOnlineMemberCountUpdated); handlers.insert("messages", &TDLibReceiver::processMessages); + handlers.insert("foundChatMessages", &TDLibReceiver::processFoundChatMessages); handlers.insert("sponsoredMessage", &TDLibReceiver::processSponsoredMessage); // TdLib <= 1.8.7 handlers.insert("sponsoredMessages", &TDLibReceiver::processSponsoredMessages); // TdLib >= 1.8.8 handlers.insert("updateNewMessage", &TDLibReceiver::processUpdateNewMessage); @@ -390,6 +391,13 @@ void TDLibReceiver::processMessages(const QVariantMap &receivedInformation) emit messagesReceived(cleanupList(receivedInformation.value(MESSAGES).toList()), total_count); } +void TDLibReceiver::processFoundChatMessages(const QVariantMap &receivedInformation) +{ + const int total_count = receivedInformation.value(TOTAL_COUNT).toInt(); + LOG("Received found chat messages, amount: " << total_count); + emit messagesReceived(cleanupList(receivedInformation.value(MESSAGES).toList()), total_count); +} + void TDLibReceiver::processSponsoredMessage(const QVariantMap &receivedInformation) { // TdLib <= 1.8.7 diff --git a/src/tdlibreceiver.h b/src/tdlibreceiver.h index cf6558c..bfb380e 100644 --- a/src/tdlibreceiver.h +++ b/src/tdlibreceiver.h @@ -139,6 +139,7 @@ private: void processUpdateSuperGroup(const QVariantMap &receivedInformation); void processChatOnlineMemberCountUpdated(const QVariantMap &receivedInformation); void processMessages(const QVariantMap &receivedInformation); + void processFoundChatMessages(const QVariantMap &receivedInformation); void processSponsoredMessage(const QVariantMap &receivedInformation); void processSponsoredMessages(const QVariantMap &receivedInformation); void processUpdateNewMessage(const QVariantMap &receivedInformation);