mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Moved out AdminLog::FilterValue to separate file.
This commit is contained in:
parent
6b83c52c7c
commit
10ebd7e6ef
5 changed files with 61 additions and 41 deletions
|
@ -8,10 +8,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ui/layers/box_content.h"
|
#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 {
|
namespace AdminLog {
|
||||||
|
|
||||||
|
struct FilterValue;
|
||||||
|
|
||||||
class FilterBox : public Ui::BoxContent {
|
class FilterBox : public Ui::BoxContent {
|
||||||
public:
|
public:
|
||||||
FilterBox(
|
FilterBox(
|
||||||
|
|
|
@ -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<Flag>;
|
||||||
|
friend inline constexpr bool is_flag_type(Flag) { return true; };
|
||||||
|
|
||||||
|
// Empty "flags" means all events.
|
||||||
|
Flags flags = 0;
|
||||||
|
std::vector<not_null<UserData*>> 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
|
|
@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
#include "history/view/history_view_element.h"
|
#include "history/view/history_view_element.h"
|
||||||
#include "history/admin_log/history_admin_log_item.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 "menu/menu_antispam_validator.h"
|
||||||
#include "ui/rp_widget.h"
|
#include "ui/rp_widget.h"
|
||||||
#include "ui/effects/animations.h"
|
#include "ui/effects/animations.h"
|
||||||
|
@ -34,6 +34,7 @@ enum class PointState : char;
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class PopupMenu;
|
class PopupMenu;
|
||||||
class ChatStyle;
|
class ChatStyle;
|
||||||
|
class ChatTheme;
|
||||||
struct PeerUserpicView;
|
struct PeerUserpicView;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "window/section_widget.h"
|
#include "window/section_widget.h"
|
||||||
#include "window/section_memento.h"
|
#include "window/section_memento.h"
|
||||||
#include "history/admin_log/history_admin_log_item.h"
|
#include "history/admin_log/history_admin_log_item.h"
|
||||||
|
#include "history/admin_log/history_admin_log_filter_value.h"
|
||||||
#include "mtproto/sender.h"
|
#include "mtproto/sender.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
@ -28,45 +29,6 @@ class FixedBar;
|
||||||
class InnerWidget;
|
class InnerWidget;
|
||||||
class SectionMemento;
|
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<Flag>;
|
|
||||||
friend inline constexpr bool is_flag_type(Flag) { return true; };
|
|
||||||
|
|
||||||
// Empty "flags" means all events.
|
|
||||||
Flags flags = 0;
|
|
||||||
std::vector<not_null<UserData*>> 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 {
|
class Widget final : public Window::SectionWidget {
|
||||||
public:
|
public:
|
||||||
Widget(
|
Widget(
|
||||||
|
|
|
@ -124,6 +124,7 @@ PRIVATE
|
||||||
editor/scene/scene_item_line.cpp
|
editor/scene/scene_item_line.cpp
|
||||||
editor/scene/scene_item_line.h
|
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.cpp
|
||||||
history/history_view_top_toast.h
|
history/history_view_top_toast.h
|
||||||
history/view/controls/history_view_characters_limit.cpp
|
history/view/controls/history_view_characters_limit.cpp
|
||||||
|
|
Loading…
Add table
Reference in a new issue