Remove static functions from NotificationManager.cpp.
GitOrigin-RevId: 326ed290ac673b64ebaa390431c646be57bbd238
This commit is contained in:
parent
435d8b438a
commit
55ea23b2fc
@ -166,13 +166,7 @@ bool NotificationManager::is_disabled() const {
|
|||||||
return !td_->auth_manager_->is_authorized() || td_->auth_manager_->is_bot() || G()->close_flag();
|
return !td_->auth_manager_->is_authorized() || td_->auth_manager_->is_bot() || G()->close_flag();
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
StringBuilder &operator<<(StringBuilder &string_builder, const NotificationManager::ActiveNotificationsUpdate &update) {
|
||||||
|
|
||||||
struct ActiveNotificationsUpdate {
|
|
||||||
const td_api::updateActiveNotifications *update;
|
|
||||||
};
|
|
||||||
|
|
||||||
StringBuilder &operator<<(StringBuilder &string_builder, const ActiveNotificationsUpdate &update) {
|
|
||||||
if (update.update == nullptr) {
|
if (update.update == nullptr) {
|
||||||
return string_builder << "null";
|
return string_builder << "null";
|
||||||
}
|
}
|
||||||
@ -190,12 +184,11 @@ StringBuilder &operator<<(StringBuilder &string_builder, const ActiveNotificatio
|
|||||||
return string_builder << ']';
|
return string_builder << ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
ActiveNotificationsUpdate as_active_notifications_update(const td_api::updateActiveNotifications *update) {
|
NotificationManager::ActiveNotificationsUpdate NotificationManager::as_active_notifications_update(
|
||||||
|
const td_api::updateActiveNotifications *update) {
|
||||||
return ActiveNotificationsUpdate{update};
|
return ActiveNotificationsUpdate{update};
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
string NotificationManager::get_is_contact_registered_notifications_synchronized_key() {
|
string NotificationManager::get_is_contact_registered_notifications_synchronized_key() {
|
||||||
return "notifications_contact_registered_sync_state";
|
return "notifications_contact_registered_sync_state";
|
||||||
}
|
}
|
||||||
@ -915,13 +908,7 @@ void NotificationManager::add_notification(NotificationGroupId group_id, Notific
|
|||||||
group.pending_notifications.push_back(std::move(notification));
|
group.pending_notifications.push_back(std::move(notification));
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
StringBuilder &operator<<(StringBuilder &string_builder, const NotificationManager::NotificationUpdate &update) {
|
||||||
|
|
||||||
struct NotificationUpdate {
|
|
||||||
const td_api::Update *update;
|
|
||||||
};
|
|
||||||
|
|
||||||
StringBuilder &operator<<(StringBuilder &string_builder, const NotificationUpdate &update) {
|
|
||||||
if (update.update == nullptr) {
|
if (update.update == nullptr) {
|
||||||
return string_builder << "null";
|
return string_builder << "null";
|
||||||
}
|
}
|
||||||
@ -950,12 +937,10 @@ StringBuilder &operator<<(StringBuilder &string_builder, const NotificationUpdat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NotificationUpdate as_notification_update(const td_api::Update *update) {
|
NotificationManager::NotificationUpdate NotificationManager::as_notification_update(const td_api::Update *update) {
|
||||||
return NotificationUpdate{update};
|
return NotificationUpdate{update};
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
void NotificationManager::add_update(int32 group_id, td_api::object_ptr<td_api::Update> update) {
|
void NotificationManager::add_update(int32 group_id, td_api::object_ptr<td_api::Update> update) {
|
||||||
if (!is_binlog_processed_ || !is_inited_) {
|
if (!is_binlog_processed_ || !is_inited_) {
|
||||||
return;
|
return;
|
||||||
|
@ -188,6 +188,14 @@ class NotificationManager : public Actor {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ActiveNotificationsUpdate {
|
||||||
|
const td_api::updateActiveNotifications *update;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct NotificationUpdate {
|
||||||
|
const td_api::Update *update;
|
||||||
|
};
|
||||||
|
|
||||||
enum class SyncState : int32 { NotSynced, Pending, Completed };
|
enum class SyncState : int32 { NotSynced, Pending, Completed };
|
||||||
|
|
||||||
using NotificationGroups = std::map<NotificationGroupKey, NotificationGroup>;
|
using NotificationGroups = std::map<NotificationGroupKey, NotificationGroup>;
|
||||||
@ -321,6 +329,14 @@ class NotificationManager : public Actor {
|
|||||||
|
|
||||||
void save_announcement_ids();
|
void save_announcement_ids();
|
||||||
|
|
||||||
|
static ActiveNotificationsUpdate as_active_notifications_update(const td_api::updateActiveNotifications *update);
|
||||||
|
|
||||||
|
static NotificationUpdate as_notification_update(const td_api::Update *update);
|
||||||
|
|
||||||
|
friend StringBuilder &operator<<(StringBuilder &string_builder, const ActiveNotificationsUpdate &update);
|
||||||
|
|
||||||
|
friend StringBuilder &operator<<(StringBuilder &string_builder, const NotificationUpdate &update);
|
||||||
|
|
||||||
NotificationId current_notification_id_;
|
NotificationId current_notification_id_;
|
||||||
NotificationGroupId current_notification_group_id_;
|
NotificationGroupId current_notification_group_id_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user