Add NotificationGroupFromDatabase struct.
This commit is contained in:
parent
fbc74dc8f4
commit
1e6970e3fe
@ -715,6 +715,7 @@ set(TDLIB_SOURCE
|
||||
td/telegram/net/TempAuthKeyWatchdog.h
|
||||
td/telegram/NewPasswordState.h
|
||||
td/telegram/Notification.h
|
||||
td/telegram/NotificationGroupFromDatabase.h
|
||||
td/telegram/NotificationGroupId.h
|
||||
td/telegram/NotificationGroupInfo.h
|
||||
td/telegram/NotificationGroupKey.h
|
||||
|
@ -29105,8 +29105,7 @@ NotificationId MessagesManager::get_next_notification_id(NotificationInfo *notif
|
||||
return notification_id;
|
||||
}
|
||||
|
||||
MessagesManager::MessageNotificationGroup MessagesManager::get_message_notification_group_force(
|
||||
NotificationGroupId group_id) {
|
||||
NotificationGroupFromDatabase MessagesManager::get_message_notification_group_force(NotificationGroupId group_id) {
|
||||
CHECK(!td_->auth_manager_->is_bot());
|
||||
CHECK(group_id.is_valid());
|
||||
Dialog *d = nullptr;
|
||||
@ -29129,7 +29128,7 @@ MessagesManager::MessageNotificationGroup MessagesManager::get_message_notificat
|
||||
}
|
||||
|
||||
if (d == nullptr || d->notification_info == nullptr) {
|
||||
return MessageNotificationGroup();
|
||||
return NotificationGroupFromDatabase();
|
||||
}
|
||||
if (!is_dialog_notification_group_id(d, group_id)) {
|
||||
if (d->dialog_id.get_type() == DialogType::SecretChat &&
|
||||
@ -29148,7 +29147,7 @@ MessagesManager::MessageNotificationGroup MessagesManager::get_message_notificat
|
||||
bool from_mentions = d->notification_info->mention_notification_group_.has_group_id(group_id);
|
||||
auto &group_info = get_notification_group_info(d, from_mentions);
|
||||
|
||||
MessageNotificationGroup result;
|
||||
NotificationGroupFromDatabase result;
|
||||
VLOG(notifications) << "Found " << (from_mentions ? "Mentions " : "Messages ") << group_info.get_group_id() << '/'
|
||||
<< d->dialog_id << " by " << group_id << " with " << d->unread_mention_count
|
||||
<< " unread mentions, " << d->unread_reaction_count << " unread reactions, pinned "
|
||||
|
@ -47,6 +47,7 @@
|
||||
#include "td/telegram/net/DcId.h"
|
||||
#include "td/telegram/net/NetQuery.h"
|
||||
#include "td/telegram/Notification.h"
|
||||
#include "td/telegram/NotificationGroupFromDatabase.h"
|
||||
#include "td/telegram/NotificationGroupId.h"
|
||||
#include "td/telegram/NotificationGroupInfo.h"
|
||||
#include "td/telegram/NotificationGroupKey.h"
|
||||
@ -1005,13 +1006,7 @@ class MessagesManager final : public Actor {
|
||||
bool is_from_scheduled, bool contains_mention,
|
||||
bool is_pinned, bool is_from_binlog);
|
||||
|
||||
struct MessageNotificationGroup {
|
||||
DialogId dialog_id;
|
||||
NotificationGroupType type = NotificationGroupType::Calls;
|
||||
int32 total_count = 0;
|
||||
vector<Notification> notifications;
|
||||
};
|
||||
MessageNotificationGroup get_message_notification_group_force(NotificationGroupId group_id);
|
||||
NotificationGroupFromDatabase get_message_notification_group_force(NotificationGroupId group_id);
|
||||
|
||||
vector<NotificationGroupKey> get_message_notification_group_keys_from_database(NotificationGroupKey from_group_key,
|
||||
int32 limit);
|
||||
|
24
td/telegram/NotificationGroupFromDatabase.h
Normal file
24
td/telegram/NotificationGroupFromDatabase.h
Normal file
@ -0,0 +1,24 @@
|
||||
//
|
||||
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include "td/telegram/DialogId.h"
|
||||
#include "td/telegram/Notification.h"
|
||||
#include "td/telegram/NotificationGroupType.h"
|
||||
|
||||
#include "td/utils/common.h"
|
||||
|
||||
namespace td {
|
||||
|
||||
struct NotificationGroupFromDatabase {
|
||||
DialogId dialog_id;
|
||||
NotificationGroupType type = NotificationGroupType::Calls;
|
||||
int32 total_count = 0;
|
||||
vector<Notification> notifications;
|
||||
};
|
||||
|
||||
} // namespace td
|
Loading…
x
Reference in New Issue
Block a user