Add dummy load_message_notifications_from_database.
GitOrigin-RevId: 9aad6c7f34c26b43fcc0f2693679237458f955f9
This commit is contained in:
parent
869a33541f
commit
2b5be01417
@ -17733,6 +17733,7 @@ void MessagesManager::remove_message_notification(DialogId dialog_id, Notificati
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (G()->parameters().use_message_db) {
|
||||||
G()->td_db()->get_messages_db_async()->get_messages_from_notification_id(
|
G()->td_db()->get_messages_db_async()->get_messages_from_notification_id(
|
||||||
dialog_id, NotificationId(notification_id.get() + 1), 1,
|
dialog_id, NotificationId(notification_id.get() + 1), 1,
|
||||||
PromiseCreator::lambda(
|
PromiseCreator::lambda(
|
||||||
@ -17741,6 +17742,7 @@ void MessagesManager::remove_message_notification(DialogId dialog_id, Notificati
|
|||||||
std::move(result));
|
std::move(result));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MessagesManager::do_remove_message_notification(DialogId dialog_id, NotificationId notification_id,
|
void MessagesManager::do_remove_message_notification(DialogId dialog_id, NotificationId notification_id,
|
||||||
vector<BufferSlice> result) {
|
vector<BufferSlice> result) {
|
||||||
@ -17750,14 +17752,8 @@ void MessagesManager::do_remove_message_notification(DialogId dialog_id, Notific
|
|||||||
CHECK(result.size() == 1);
|
CHECK(result.size() == 1);
|
||||||
|
|
||||||
Dialog *d = get_dialog_force(dialog_id);
|
Dialog *d = get_dialog_force(dialog_id);
|
||||||
if (d == nullptr) {
|
CHECK(d != nullptr);
|
||||||
LOG(ERROR) << "Can't find " << dialog_id;
|
CHECK(d->message_notification_group_id.is_valid());
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!d->message_notification_group_id.is_valid()) {
|
|
||||||
LOG(ERROR) << "There is no message notiication group in " << dialog_id;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto m = on_get_message_from_database(dialog_id, d, std::move(result[0]));
|
auto m = on_get_message_from_database(dialog_id, d, std::move(result[0]));
|
||||||
if (m->notification_id == notification_id && is_message_has_active_notification(d, m)) {
|
if (m->notification_id == notification_id && is_message_has_active_notification(d, m)) {
|
||||||
|
@ -244,6 +244,11 @@ int32 NotificationManager::load_message_notification_groups_from_database(int32
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NotificationManager::load_message_notifications_from_database(const NotificationGroupKey &group_key,
|
||||||
|
const NotificationGroup &group) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
size_t NotificationManager::get_max_notification_group_size() const {
|
size_t NotificationManager::get_max_notification_group_size() const {
|
||||||
return max_notification_group_size_;
|
return max_notification_group_size_;
|
||||||
}
|
}
|
||||||
@ -1151,7 +1156,7 @@ void NotificationManager::remove_notification(NotificationGroupId group_id, Noti
|
|||||||
added_notifications.pop_back();
|
added_notifications.pop_back();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO preload more notifications in the group
|
load_message_notifications_from_database(group_it->first, group_it->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1388,8 +1393,8 @@ void NotificationManager::on_notification_group_size_max_changed() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (new_max_notification_group_size_size_t > notification_count &&
|
if (new_max_notification_group_size_size_t > notification_count &&
|
||||||
static_cast<size_t>(group.total_count) > notification_count) {
|
static_cast<size_t>(group.total_count) > notification_count && G()->parameters().use_message_db) {
|
||||||
// TODO load more notifications in the group from the message database
|
load_message_notifications_from_database(group_key, group);
|
||||||
}
|
}
|
||||||
if (added_notifications.empty()) {
|
if (added_notifications.empty()) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -141,6 +141,8 @@ class NotificationManager : public Actor {
|
|||||||
|
|
||||||
int32 load_message_notification_groups_from_database(int32 limit, bool send_update);
|
int32 load_message_notification_groups_from_database(int32 limit, bool send_update);
|
||||||
|
|
||||||
|
void load_message_notifications_from_database(const NotificationGroupKey &group_key, const NotificationGroup &group);
|
||||||
|
|
||||||
NotificationGroupKey get_last_updated_group_key() const;
|
NotificationGroupKey get_last_updated_group_key() const;
|
||||||
|
|
||||||
void send_remove_group_update(const NotificationGroupKey &group_key, const NotificationGroup &group,
|
void send_remove_group_update(const NotificationGroupKey &group_key, const NotificationGroup &group,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user