diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 38f236c4bf..84986c28a9 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -2037,6 +2037,9 @@ void HistoryItem::setRealId(MsgId newId) { const auto oldId = std::exchange(id, newId); _flags &= ~(MessageFlag::BeingSent | MessageFlag::Local); + if (isBusinessShortcut()) { + _date = 0; + } if (isRegular()) { _history->unregisterClientSideMessage(this); } @@ -2154,7 +2157,9 @@ bool HistoryItem::canDelete() const { return false; } else if (topicRootId() == id) { return false; - } else if (!isHistoryEntry() && !isScheduled()) { + } else if (!isHistoryEntry() + && !isScheduled() + && !isBusinessShortcut()) { return false; } auto channel = _history->peer->asChannel(); diff --git a/Telegram/SourceFiles/settings/business/settings_shortcut_messages.cpp b/Telegram/SourceFiles/settings/business/settings_shortcut_messages.cpp index 06ea5ac7e0..df5f778ba9 100644 --- a/Telegram/SourceFiles/settings/business/settings_shortcut_messages.cpp +++ b/Telegram/SourceFiles/settings/business/settings_shortcut_messages.cpp @@ -164,6 +164,8 @@ private: void pushReplyReturn(not_null item); void checkReplyReturns(); + void confirmDeleteSelected(); + void clearSelected(); void uploadFile(const QByteArray &fileContent, SendMediaType type); bool confirmSendingFiles( @@ -579,7 +581,7 @@ void ShortcutMessages::listCancelRequest() { } void ShortcutMessages::listDeleteRequest() { - //confirmDeleteSelected(); + confirmDeleteSelected(); } void ShortcutMessages::listTryProcessKeyInput(not_null e) { @@ -803,6 +805,14 @@ void ShortcutMessages::checkReplyReturns() { } } +void ShortcutMessages::confirmDeleteSelected() { + ConfirmDeleteSelectedItems(_inner); +} + +void ShortcutMessages::clearSelected() { + _inner->cancelSelection(); +} + void ShortcutMessages::uploadFile( const QByteArray &fileContent, SendMediaType type) {