mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-02 23:55:12 +00:00
Fix assertion violation in marking history as read.
This commit is contained in:
@@ -6001,6 +6001,11 @@ void ApiWrap::sendReadRequest(not_null<PeerData*> peer, MsgId upTo) {
|
|||||||
_readRequests.remove(peer);
|
_readRequests.remove(peer);
|
||||||
if (const auto next = _readRequestsPending.take(peer)) {
|
if (const auto next = _readRequestsPending.take(peer)) {
|
||||||
sendReadRequest(peer, *next);
|
sendReadRequest(peer, *next);
|
||||||
|
} else if (const auto history
|
||||||
|
= _session->data().historyLoaded(peer)) {
|
||||||
|
if (!history->unreadCountKnown()) {
|
||||||
|
requestDialogEntry(history);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (const auto channel = peer->asChannel()) {
|
if (const auto channel = peer->asChannel()) {
|
||||||
|
@@ -1553,7 +1553,9 @@ void History::readClientSideMessages() {
|
|||||||
|
|
||||||
MsgId History::readInbox() {
|
MsgId History::readInbox() {
|
||||||
const auto upTo = msgIdForRead();
|
const auto upTo = msgIdForRead();
|
||||||
setUnreadCount(0);
|
if (unreadCountKnown()) {
|
||||||
|
setUnreadCount(0);
|
||||||
|
}
|
||||||
readClientSideMessages();
|
readClientSideMessages();
|
||||||
if (upTo) {
|
if (upTo) {
|
||||||
inboxRead(upTo);
|
inboxRead(upTo);
|
||||||
@@ -3022,7 +3024,9 @@ void History::clear(ClearType type) {
|
|||||||
} else {
|
} else {
|
||||||
_notifications.clear();
|
_notifications.clear();
|
||||||
owner().notifyHistoryCleared(this);
|
owner().notifyHistoryCleared(this);
|
||||||
setUnreadCount(0);
|
if (unreadCountKnown()) {
|
||||||
|
setUnreadCount(0);
|
||||||
|
}
|
||||||
if (type == ClearType::DeleteChat) {
|
if (type == ClearType::DeleteChat) {
|
||||||
setLastMessage(nullptr);
|
setLastMessage(nullptr);
|
||||||
} else if (_lastMessage && *_lastMessage) {
|
} else if (_lastMessage && *_lastMessage) {
|
||||||
|
Reference in New Issue
Block a user