Force read all mentions in a chat when nothing is unread
This commit is contained in:
parent
ef1f824cd8
commit
e6fd5885aa
3 changed files with 15 additions and 0 deletions
|
@ -562,6 +562,9 @@ Page {
|
|||
}
|
||||
lastQueuedIndex = -1
|
||||
}
|
||||
if (chatInformation.unread_count === 0) {
|
||||
tdLibWrapper.readAllChatMentions(chatInformation.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -825,6 +828,8 @@ Page {
|
|||
if (bottomIndex > -1) {
|
||||
viewMessageTimer.queueViewMessage(bottomIndex)
|
||||
}
|
||||
} else {
|
||||
tdLibWrapper.readAllChatMentions(chatInformation.id);
|
||||
}
|
||||
manuallyScrolledToBottom = chatView.atYEnd
|
||||
}
|
||||
|
|
|
@ -937,6 +937,15 @@ void TDLibWrapper::importContacts(const QVariantList &contacts)
|
|||
this->sendRequest(requestObject);
|
||||
}
|
||||
|
||||
void TDLibWrapper::readAllChatMentions(qlonglong chatId)
|
||||
{
|
||||
LOG("Read all chat mentions" << chatId);
|
||||
QVariantMap requestObject;
|
||||
requestObject.insert(_TYPE, "readAllChatMentions");
|
||||
requestObject.insert("chat_id", chatId);
|
||||
this->sendRequest(requestObject);
|
||||
}
|
||||
|
||||
void TDLibWrapper::searchEmoji(const QString &queryString)
|
||||
{
|
||||
LOG("Searching emoji" << queryString);
|
||||
|
|
|
@ -179,6 +179,7 @@ public:
|
|||
Q_INVOKABLE void getSecretChat(qlonglong secretChatId);
|
||||
Q_INVOKABLE void closeSecretChat(qlonglong secretChatId);
|
||||
Q_INVOKABLE void importContacts(const QVariantList &contacts);
|
||||
Q_INVOKABLE void readAllChatMentions(qlonglong chatId);
|
||||
|
||||
// Others (candidates for extraction ;))
|
||||
Q_INVOKABLE void searchEmoji(const QString &queryString);
|
||||
|
|
Loading…
Reference in a new issue