2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Request last topic message if it becomes unknown.

This commit is contained in:
John Preston
2022-10-06 20:06:24 +04:00
parent 032e6c57e9
commit f258b054e8
11 changed files with 91 additions and 39 deletions

View File

@@ -351,8 +351,8 @@ void ForumTopic::validateDefaultIcon() const {
}
void ForumTopic::requestChatListMessage() {
if (!chatListMessageKnown()) {
// #TODO forum
if (!chatListMessageKnown() && !forum()->creating(_rootId)) {
forum()->requestTopic(_rootId);
}
}
@@ -361,7 +361,7 @@ TimeId ForumTopic::adjustedChatListTimeId() const {
return TimeId(1);
}
const auto result = chatListTimeId();
#if 0 // #TODO forum
#if 0 // #TODO forum draft
if (const auto draft = cloudDraft()) {
if (!Data::draftIsNull(draft) && !session().supportMode()) {
return std::max(result, draft->date);
@@ -458,6 +458,7 @@ void ForumTopic::applyItemRemoved(MsgId id) {
if (const auto chatListItem = _chatListMessage.value_or(nullptr)) {
if (chatListItem->id == id) {
_chatListMessage = std::nullopt;
requestChatListMessage();
}
}
}