mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-23 05:41:14 +01:00
Message List / Scheduled: Allow Copy and disable Report (#2009)
This commit is contained in:
parent
b35090a0c7
commit
858912d66f
@ -176,15 +176,16 @@ const MessageSelectToolbar: FC<OwnProps & StateProps> = ({
|
||||
export default memo(withGlobal<OwnProps>(
|
||||
(global): StateProps => {
|
||||
const { type: messageListType, chatId } = selectCurrentMessageList(global) || {};
|
||||
const isSchedule = messageListType === 'scheduled';
|
||||
const { canDelete } = selectCanDeleteSelectedMessages(global);
|
||||
const canReport = selectCanReportSelectedMessages(global);
|
||||
const canReport = Boolean(!isSchedule && selectCanReportSelectedMessages(global));
|
||||
const canDownload = selectCanDownloadSelectedMessages(global);
|
||||
const { messageIds: selectedMessageIds } = global.selectedMessages || {};
|
||||
const hasProtectedMessage = chatId ? selectHasProtectedMessage(global, chatId, selectedMessageIds) : false;
|
||||
const isForwardModalOpen = global.forwardMessages.isModalShown;
|
||||
|
||||
return {
|
||||
isSchedule: messageListType === 'scheduled',
|
||||
isSchedule,
|
||||
selectedMessagesCount: selectSelectedMessagesCount(global),
|
||||
canDeleteMessages: canDelete,
|
||||
canReportMessages: canReport,
|
||||
|
@ -34,6 +34,7 @@ import {
|
||||
selectReplyingToId,
|
||||
selectReplyStack,
|
||||
selectSender,
|
||||
selectScheduledMessages,
|
||||
} from '../../selectors';
|
||||
import { findLast } from '../../../util/iteratees';
|
||||
import { getServerTime } from '../../../util/serverTime';
|
||||
@ -729,10 +730,12 @@ addActionHandler('copyMessagesByIds', (global, actions, payload: { messageIds?:
|
||||
});
|
||||
|
||||
function copyTextForMessages(global: GlobalState, chatId: string, messageIds: number[]) {
|
||||
const { threadId } = selectCurrentMessageList(global) || {};
|
||||
const { type: messageListType, threadId } = selectCurrentMessageList(global) || {};
|
||||
const lang = langProvider.getTranslation;
|
||||
|
||||
const chatMessages = selectChatMessages(global, chatId);
|
||||
const chatMessages = messageListType === 'scheduled'
|
||||
? selectScheduledMessages(global, chatId)
|
||||
: selectChatMessages(global, chatId);
|
||||
if (!chatMessages || !threadId) return;
|
||||
const messages = messageIds
|
||||
.map((id) => chatMessages[id])
|
||||
|
Loading…
x
Reference in New Issue
Block a user