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

Improve topic creation, fix glitches.

This commit is contained in:
John Preston
2022-10-21 13:42:21 +04:00
parent fd2edb51e9
commit ce17904dcc
6 changed files with 21 additions and 13 deletions

View File

@@ -946,11 +946,11 @@ void Histories::checkTopicCreated(FullMsgId rootId, MsgId realRoot) {
_createdTopicIds.emplace(rootId, realRoot);
if (const auto forum = _owner->peer(rootId.peer)->forum()) {
const auto history = _owner->history(rootId.peer);
if (const auto forum = history->peer->forum()) {
forum->created(rootId.msg, realRoot);
}
const auto history = _owner->history(rootId.peer);
for (auto &entry : scheduled) {
_creatingTopicRequests.erase(entry.requestId);
sendPreparedMessage(
@@ -962,6 +962,7 @@ void Histories::checkTopicCreated(FullMsgId rootId, MsgId realRoot) {
std::move(entry.done),
std::move(entry.fail));
}
const auto topic = history->peer->forumTopicFor(realRoot);
for (const auto &item : history->clientSideMessages()) {
const auto replace = [&](MsgId nowId) {
return (nowId == rootId.msg) ? realRoot : nowId;