diff --git a/Telegram/SourceFiles/api/api_sending.cpp b/Telegram/SourceFiles/api/api_sending.cpp index 9eb036ce7..1fd4fa79a 100644 --- a/Telegram/SourceFiles/api/api_sending.cpp +++ b/Telegram/SourceFiles/api/api_sending.cpp @@ -525,9 +525,13 @@ void SendConfirmedFile( } session->data().sendHistoryChangeNotifications(); - session->changes().historyUpdated( - history, - Data::HistoryUpdate::Flag::MessageSent); + if (!itemToEdit) { + session->changes().historyUpdated( + history, + (action.options.scheduled + ? Data::HistoryUpdate::Flag::ScheduledSent + : Data::HistoryUpdate::Flag::MessageSent)); + } } } // namespace Api diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 6afa35ac9..6e0c19254 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -3903,8 +3903,10 @@ void ApiWrap::userPhotosDone( //} void ApiWrap::sendAction(const SendAction &action) { - _session->data().histories().readInbox(action.history); - action.history->getReadyFor(ShowAtTheEndMsgId); + if (!action.options.scheduled) { + _session->data().histories().readInbox(action.history); + action.history->getReadyFor(ShowAtTheEndMsgId); + } _sendActions.fire_copy(action); } @@ -3924,7 +3926,9 @@ void ApiWrap::finishForwarding(const SendAction &action) { _session->data().sendHistoryChangeNotifications(); _session->changes().historyUpdated( history, - Data::HistoryUpdate::Flag::MessageSent); + (action.options.scheduled + ? Data::HistoryUpdate::Flag::ScheduledSent + : Data::HistoryUpdate::Flag::MessageSent)); } void ApiWrap::forwardMessages( @@ -4164,7 +4168,9 @@ void ApiWrap::sendSharedContact( _session->data().sendHistoryChangeNotifications(); _session->changes().historyUpdated( history, - Data::HistoryUpdate::Flag::MessageSent); + (action.options.scheduled + ? Data::HistoryUpdate::Flag::ScheduledSent + : Data::HistoryUpdate::Flag::MessageSent)); } void ApiWrap::sendVoiceMessage( diff --git a/Telegram/SourceFiles/data/data_changes.h b/Telegram/SourceFiles/data/data_changes.h index 4e40a7ab9..86ad3628d 100644 --- a/Telegram/SourceFiles/data/data_changes.h +++ b/Telegram/SourceFiles/data/data_changes.h @@ -109,12 +109,13 @@ struct HistoryUpdate { LocalMessages = (1 << 5), ChatOccupied = (1 << 6), MessageSent = (1 << 7), - ForwardDraft = (1 << 8), - OutboxRead = (1 << 9), - BotKeyboard = (1 << 10), - CloudDraft = (1 << 11), + ScheduledSent = (1 << 8), + ForwardDraft = (1 << 9), + OutboxRead = (1 << 10), + BotKeyboard = (1 << 11), + CloudDraft = (1 << 12), - LastUsedBit = (1 << 11), + LastUsedBit = (1 << 12), }; using Flags = base::flags; friend inline constexpr auto is_flag_type(Flag) { return true; } diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index e7304e7d1..283a6c8a2 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -3116,7 +3116,9 @@ void HistoryWidget::send(Api::SendOptions options) { } session().changes().historyUpdated( _history, - Data::HistoryUpdate::Flag::MessageSent); + (options.scheduled + ? Data::HistoryUpdate::Flag::ScheduledSent + : Data::HistoryUpdate::Flag::MessageSent)); } void HistoryWidget::sendWithModifiers(Qt::KeyboardModifiers modifiers) {