Fix forwarding changelog
This commit is contained in:
parent
0ac6675e28
commit
4e6176e8c8
@ -311,8 +311,8 @@ export default class ChatContextMenu {
|
||||
}, {
|
||||
icon: 'forward',
|
||||
text: 'Forward',
|
||||
onClick: this.onForwardClick,
|
||||
verify: () => this.chat.type !== 'scheduled' && !this.message.pFlags.is_outgoing && this.message._ !== 'messageService'
|
||||
onClick: this.onForwardClick, // let forward the message if it's outgoing but not ours (like a changelog)
|
||||
verify: () => this.chat.type !== 'scheduled' && (!this.message.pFlags.is_outgoing || !this.message.pFlags.out) && this.message._ !== 'messageService'
|
||||
}, {
|
||||
icon: 'forward',
|
||||
text: 'Message.Context.Selection.Forward',
|
||||
|
@ -1900,6 +1900,24 @@ export class AppMessagesManager {
|
||||
peerId = appPeersManager.getPeerMigratedTo(peerId) || peerId;
|
||||
mids = mids.slice().sort((a, b) => a - b);
|
||||
|
||||
for(let i = 0, length = mids.length; i < length; ++i) {
|
||||
const mid = mids[i];
|
||||
const originalMessage: Message.message = this.getMessageByPeer(fromPeerId, mid);
|
||||
if(originalMessage.pFlags.is_outgoing) { // this can happen when forwarding a changelog
|
||||
this.sendText(peerId, originalMessage.message, {
|
||||
entities: originalMessage.entities,
|
||||
scheduleDate: options.scheduleDate,
|
||||
silent: options.silent
|
||||
});
|
||||
|
||||
mids.splice(i--, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if(!mids.length) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if(options.dropCaptions) {
|
||||
options.dropAuthor = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user