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

Update API scheme on layer 148.

Extract message history corner buttons code.
This commit is contained in:
John Preston
2022-10-08 15:14:38 +04:00
parent 2c0b5b3210
commit 6a7f030ee7
24 changed files with 751 additions and 444 deletions

View File

@@ -22,7 +22,7 @@ namespace Data {
class Session;
class Folder final : public Dialogs::Entry, public base::has_weak_ptr {
class Folder final : public Dialogs::Entry {
public:
static constexpr auto kId = 1;

View File

@@ -239,6 +239,12 @@ void Forum::clearAllUnreadMentions() {
}
}
void Forum::clearAllUnreadReactions() {
for (const auto &[rootId, topic] : _topics) {
topic->unreadReactions().clear();
}
}
ForumTopic *Forum::topicFor(not_null<const HistoryItem*> item) {
const auto maybe = topicFor(item->replyToTop());
return maybe ? maybe : topicFor(item->topicRootId());

View File

@@ -60,6 +60,7 @@ public:
void created(MsgId rootId, MsgId realId);
void clearAllUnreadMentions();
void clearAllUnreadReactions();
private:
struct TopicRequest {

View File

@@ -10,8 +10,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_sparse_ids.h"
#include "storage/storage_sparse_ids_list.h"
#include "storage/storage_shared_media.h"
#include "base/value_ordering.h"
#include "base/timer.h"
#include "base/qt/qt_compare.h"
namespace Main {
class Session;
@@ -58,13 +58,9 @@ public:
QString query;
// from_id, min_date, max_date
friend inline auto value_ordering_helper(const Query &value) {
return std::tie(
value.peerId,
value.migratedPeerId,
value.type,
value.query);
}
friend inline std::strong_ordering operator<=>(
const Query &a,
const Query &b) noexcept = default;
};
struct SavedState {

View File

@@ -7,7 +7,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "base/value_ordering.h"
#include "ui/text/text.h" // For QFIXED_MAX
#include "data/data_peer_id.h"
#include "data/data_msg_id.h"
@@ -84,9 +83,9 @@ struct MessageGroupId {
return value;
}
friend inline std::pair<uint64, uint64> value_ordering_helper(MessageGroupId value) {
return std::make_pair(value.value, value.peer.value);
}
friend inline constexpr auto operator<=>(
MessageGroupId,
MessageGroupId) noexcept = default;
};