Option to mark all chat reactions as read
This commit is contained in:
parent
033f96b366
commit
0cc6f959fc
4 changed files with 13 additions and 0 deletions
|
@ -51,6 +51,8 @@ PhotoTextsListItem {
|
|||
visible: unread_count > 0
|
||||
onClicked: {
|
||||
tdLibWrapper.viewMessage(chat_id, display.last_message.id, true);
|
||||
tdLibWrapper.readAllChatMentions(chat_id);
|
||||
tdLibWrapper.readAllChatReactions(chat_id);
|
||||
tdLibWrapper.toggleChatIsMarkedAsUnread(chat_id, false);
|
||||
}
|
||||
text: qsTr("Mark all messages as read")
|
||||
|
|
|
@ -716,6 +716,7 @@ Page {
|
|||
}
|
||||
if (chatInformation.unread_count === 0) {
|
||||
tdLibWrapper.readAllChatMentions(chatInformation.id);
|
||||
tdLibWrapper.readAllChatReactions(chatInformation.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1113,6 +1113,15 @@ void TDLibWrapper::readAllChatMentions(qlonglong chatId)
|
|||
this->sendRequest(requestObject);
|
||||
}
|
||||
|
||||
void TDLibWrapper::readAllChatReactions(qlonglong chatId)
|
||||
{
|
||||
LOG("Read all chat reactions" << chatId);
|
||||
QVariantMap requestObject;
|
||||
requestObject.insert(_TYPE, "readAllChatReactions");
|
||||
requestObject.insert(CHAT_ID, chatId);
|
||||
this->sendRequest(requestObject);
|
||||
}
|
||||
|
||||
void TDLibWrapper::toggleChatIsMarkedAsUnread(qlonglong chatId, bool isMarkedAsUnread)
|
||||
{
|
||||
LOG("Toggle chat is marked as unread" << chatId << isMarkedAsUnread);
|
||||
|
|
|
@ -217,6 +217,7 @@ public:
|
|||
Q_INVOKABLE void searchChatMessages(qlonglong chatId, const QString &query, qlonglong fromMessageId = 0);
|
||||
Q_INVOKABLE void searchPublicChats(const QString &query);
|
||||
Q_INVOKABLE void readAllChatMentions(qlonglong chatId);
|
||||
Q_INVOKABLE void readAllChatReactions(qlonglong chatId);
|
||||
Q_INVOKABLE void toggleChatIsMarkedAsUnread(qlonglong chatId, bool isMarkedAsUnread);
|
||||
Q_INVOKABLE void toggleChatIsPinned(qlonglong chatId, bool isPinned);
|
||||
Q_INVOKABLE void setChatDraftMessage(qlonglong chatId, qlonglong threadId, qlonglong replyToMessageId, const QString &draft);
|
||||
|
|
Loading…
Reference in a new issue