Improve log event name.

This commit is contained in:
levlam 2021-10-27 15:27:09 +03:00
parent 22a859045f
commit 8916cacd21
4 changed files with 14 additions and 15 deletions

View File

@ -30925,7 +30925,7 @@ void MessagesManager::on_get_dialog_notification_settings_query_finished(DialogI
}
}
class MessagesManager::GetDialogFromServerLogEvent {
class MessagesManager::RegetDialogLogEvent {
public:
DialogId dialog_id_;
@ -30940,10 +30940,9 @@ class MessagesManager::GetDialogFromServerLogEvent {
}
};
uint64 MessagesManager::save_get_dialog_from_server_log_event(DialogId dialog_id) {
GetDialogFromServerLogEvent log_event{dialog_id};
return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::GetDialogFromServer,
get_log_event_storer(log_event));
uint64 MessagesManager::save_reget_dialog_log_event(DialogId dialog_id) {
RegetDialogLogEvent log_event{dialog_id};
return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::RegetDialog, get_log_event_storer(log_event));
}
void MessagesManager::send_get_dialog_query(DialogId dialog_id, Promise<Unit> &&promise, uint64 log_event_id,
@ -30975,7 +30974,7 @@ void MessagesManager::send_get_dialog_query(DialogId dialog_id, Promise<Unit> &&
}
if (log_event_id == 0 && G()->parameters().use_message_db) {
log_event_id = save_get_dialog_from_server_log_event(dialog_id);
log_event_id = save_reget_dialog_log_event(dialog_id);
}
if (log_event_id != 0) {
auto result = get_dialog_query_log_event_id_.emplace(dialog_id, log_event_id);
@ -37963,28 +37962,28 @@ void MessagesManager::on_binlog_events(vector<BinlogEvent> &&events) {
set_dialog_folder_id_on_server(dialog_id, true);
break;
}
case LogEvent::HandlerType::GetDialogFromServer: {
case LogEvent::HandlerType::RegetDialog: {
if (!G()->parameters().use_message_db) {
binlog_erase(G()->td_db()->get_binlog(), event.id_);
break;
}
GetDialogFromServerLogEvent log_event;
RegetDialogLogEvent log_event;
log_event_parse(log_event, event.data_).ensure();
auto dialog_id = log_event.dialog_id_;
Dependencies dependencies;
add_dialog_dependencies(dependencies, dialog_id);
resolve_dependencies_force(td_, dependencies, "GetDialogFromServerLogEvent");
resolve_dependencies_force(td_, dependencies, "RegetDialogLogEvent");
get_dialog_force(dialog_id, "GetDialogFromServerLogEvent"); // load it if exists
get_dialog_force(dialog_id, "RegetDialogLogEvent"); // load it if exists
if (!have_input_peer(dialog_id, AccessRights::Read)) {
binlog_erase(G()->td_db()->get_binlog(), event.id_);
break;
}
send_get_dialog_query(dialog_id, Auto(), event.id_, "GetDialogFromServerLogEvent");
send_get_dialog_query(dialog_id, Auto(), event.id_, "RegetDialogLogEvent");
break;
}
case LogEvent::HandlerType::UnpinAllDialogMessagesOnServer: {

View File

@ -1654,12 +1654,12 @@ class MessagesManager final : public Actor {
class DeleteScheduledMessagesFromServerLogEvent;
class ForwardMessagesLogEvent;
class GetChannelDifferenceLogEvent;
class GetDialogFromServerLogEvent;
class ReadAllDialogMentionsOnServerLogEvent;
class ReadHistoryInSecretChatLogEvent;
class ReadHistoryOnServerLogEvent;
class ReadMessageContentsOnServerLogEvent;
class ReadMessageThreadHistoryOnServerLogEvent;
class RegetDialogLogEvent;
class ReorderPinnedDialogsOnServerLogEvent;
class ResetAllNotificationSettingsOnServerLogEvent;
class SaveDialogDraftMessageOnServerLogEvent;
@ -3116,7 +3116,7 @@ class MessagesManager final : public Actor {
static uint64 save_reset_all_notification_settings_on_server_log_event();
static uint64 save_get_dialog_from_server_log_event(DialogId dialog_id);
static uint64 save_reget_dialog_log_event(DialogId dialog_id);
static uint64 save_forward_messages_log_event(DialogId to_dialog_id, DialogId from_dialog_id,
const vector<Message *> &messages,

View File

@ -108,7 +108,7 @@ Status init_binlog(Binlog &binlog, string path, BinlogKeyValue<Binlog> &binlog_p
case LogEvent::HandlerType::UpdateScopeNotificationSettingsOnServer:
case LogEvent::HandlerType::ResetAllNotificationSettingsOnServer:
case LogEvent::HandlerType::ToggleDialogReportSpamStateOnServer:
case LogEvent::HandlerType::GetDialogFromServer:
case LogEvent::HandlerType::RegetDialog:
case LogEvent::HandlerType::GetChannelDifference:
case LogEvent::HandlerType::ReadHistoryInSecretChat:
case LogEvent::HandlerType::ToggleDialogIsMarkedAsUnreadOnServer:

View File

@ -89,7 +89,7 @@ class LogEvent {
UpdateScopeNotificationSettingsOnServer = 0x110,
ResetAllNotificationSettingsOnServer = 0x111,
ToggleDialogReportSpamStateOnServer = 0x112,
GetDialogFromServer = 0x113,
RegetDialog = 0x113,
ReadHistoryInSecretChat = 0x114,
ToggleDialogIsMarkedAsUnreadOnServer = 0x115,
SetDialogFolderIdOnServer = 0x116,