diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_filter.h b/Telegram/SourceFiles/history/admin_log/history_admin_log_filter.h index 7876c3204..e515bbc15 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_filter.h +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_filter.h @@ -8,10 +8,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #pragma once #include "ui/layers/box_content.h" -#include "history/admin_log/history_admin_log_section.h" +#include "history/admin_log/history_admin_log_filter_value.h" namespace AdminLog { +struct FilterValue; + class FilterBox : public Ui::BoxContent { public: FilterBox( diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_filter_value.h b/Telegram/SourceFiles/history/admin_log/history_admin_log_filter_value.h new file mode 100644 index 000000000..89d55c37f --- /dev/null +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_filter_value.h @@ -0,0 +1,54 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#pragma once + +namespace AdminLog { + +struct FilterValue final { + enum class Flag : uint32 { + Join = (1U << 0), + Leave = (1U << 1), + Invite = (1U << 2), + Ban = (1U << 3), + Unban = (1U << 4), + Kick = (1U << 5), + Unkick = (1U << 6), + Promote = (1U << 7), + Demote = (1U << 8), + Info = (1U << 9), + Settings = (1U << 10), + Pinned = (1U << 11), + Edit = (1U << 12), + Delete = (1U << 13), + GroupCall = (1U << 14), + Invites = (1U << 15), + Topics = (1U << 16), + + MAX_FIELD = (1U << 16), + }; + using Flags = base::flags; + friend inline constexpr bool is_flag_type(Flag) { return true; }; + + // Empty "flags" means all events. + Flags flags = 0; + std::vector> admins; + bool allUsers = true; + +}; + +inline bool operator==(const FilterValue &a, const FilterValue &b) { + return (a.flags == b.flags) + && (a.admins == b.admins) + && (a.allUsers == b.allUsers); +} + +inline bool operator!=(const FilterValue &a, const FilterValue &b) { + return !(a == b); +} + +} // namespace AdminLog diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.h b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.h index 5f55e5d40..ed13def82 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.h +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.h @@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/view/history_view_element.h" #include "history/admin_log/history_admin_log_item.h" -#include "history/admin_log/history_admin_log_section.h" +#include "history/admin_log/history_admin_log_filter_value.h" #include "menu/menu_antispam_validator.h" #include "ui/rp_widget.h" #include "ui/effects/animations.h" @@ -34,6 +34,7 @@ enum class PointState : char; namespace Ui { class PopupMenu; class ChatStyle; +class ChatTheme; struct PeerUserpicView; } // namespace Ui diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_section.h b/Telegram/SourceFiles/history/admin_log/history_admin_log_section.h index 43c27d043..8a547ee81 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_section.h +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_section.h @@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "window/section_widget.h" #include "window/section_memento.h" #include "history/admin_log/history_admin_log_item.h" +#include "history/admin_log/history_admin_log_filter_value.h" #include "mtproto/sender.h" namespace Ui { @@ -28,45 +29,6 @@ class FixedBar; class InnerWidget; class SectionMemento; -struct FilterValue { - enum class Flag : uint32 { - Join = (1U << 0), - Leave = (1U << 1), - Invite = (1U << 2), - Ban = (1U << 3), - Unban = (1U << 4), - Kick = (1U << 5), - Unkick = (1U << 6), - Promote = (1U << 7), - Demote = (1U << 8), - Info = (1U << 9), - Settings = (1U << 10), - Pinned = (1U << 11), - Edit = (1U << 12), - Delete = (1U << 13), - GroupCall = (1U << 14), - Invites = (1U << 15), - Topics = (1U << 16), - - MAX_FIELD = (1U << 16), - }; - using Flags = base::flags; - friend inline constexpr bool is_flag_type(Flag) { return true; }; - - // Empty "flags" means all events. - Flags flags = 0; - std::vector> admins; - bool allUsers = true; -}; - -inline bool operator==(const FilterValue &a, const FilterValue &b) { - return (a.flags == b.flags && a.admins == b.admins && a.allUsers == b.allUsers); -} - -inline bool operator!=(const FilterValue &a, const FilterValue &b) { - return !(a == b); -} - class Widget final : public Window::SectionWidget { public: Widget( diff --git a/Telegram/cmake/td_ui.cmake b/Telegram/cmake/td_ui.cmake index 8ec670702..d1db73c56 100644 --- a/Telegram/cmake/td_ui.cmake +++ b/Telegram/cmake/td_ui.cmake @@ -124,6 +124,7 @@ PRIVATE editor/scene/scene_item_line.cpp editor/scene/scene_item_line.h + history/admin_log/history_admin_log_filter_value.h history/history_view_top_toast.cpp history/history_view_top_toast.h history/view/controls/history_view_characters_limit.cpp