Fix local forward header
This commit is contained in:
parent
3b016583c2
commit
e58300be58
@ -357,7 +357,8 @@ export default class AudioElement extends HTMLElement {
|
|||||||
const doc = this.message.media.document || this.message.media.webpage.document;
|
const doc = this.message.media.document || this.message.media.webpage.document;
|
||||||
const isRealVoice = doc.type === 'voice';
|
const isRealVoice = doc.type === 'voice';
|
||||||
const isVoice = !this.voiceAsMusic && isRealVoice;
|
const isVoice = !this.voiceAsMusic && isRealVoice;
|
||||||
const uploading = this.message.pFlags.is_outgoing;
|
const isOutgoing = this.message.pFlags.is_outgoing;
|
||||||
|
const uploading = isOutgoing && this.preloader;
|
||||||
|
|
||||||
const durationStr = String(doc.duration | 0).toHHMMSS();
|
const durationStr = String(doc.duration | 0).toHHMMSS();
|
||||||
|
|
||||||
@ -420,7 +421,7 @@ export default class AudioElement extends HTMLElement {
|
|||||||
this.addAudioListener('playing', onPlaying);
|
this.addAudioListener('playing', onPlaying);
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!uploading) {
|
if(!isOutgoing) {
|
||||||
let preloader: ProgressivePreloader = this.preloader;
|
let preloader: ProgressivePreloader = this.preloader;
|
||||||
|
|
||||||
const getDownloadPromise = () => appDocsManager.downloadDoc(doc);
|
const getDownloadPromise = () => appDocsManager.downloadDoc(doc);
|
||||||
@ -540,7 +541,7 @@ export default class AudioElement extends HTMLElement {
|
|||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
} else {
|
} else if(uploading) {
|
||||||
this.preloader.attach(downloadDiv, false);
|
this.preloader.attach(downloadDiv, false);
|
||||||
//onLoad();
|
//onLoad();
|
||||||
}
|
}
|
||||||
@ -581,4 +582,4 @@ export default class AudioElement extends HTMLElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customElements.define("audio-element", AudioElement);
|
customElements.define("audio-element", AudioElement);
|
||||||
|
@ -387,6 +387,7 @@ export function wrapDocument({message, withTime, fontWeight, voiceAsMusic, showS
|
|||||||
if(!fontWeight) fontWeight = 500;
|
if(!fontWeight) fontWeight = 500;
|
||||||
|
|
||||||
const doc = (message.media.document || message.media.webpage.document) as MyDocument;
|
const doc = (message.media.document || message.media.webpage.document) as MyDocument;
|
||||||
|
const uploading = message.pFlags.is_outgoing && message.media?.preloader;
|
||||||
if(doc.type === 'audio' || doc.type === 'voice') {
|
if(doc.type === 'audio' || doc.type === 'voice') {
|
||||||
const audioElement = new AudioElement();
|
const audioElement = new AudioElement();
|
||||||
audioElement.setAttribute('message-id', '' + message.mid);
|
audioElement.setAttribute('message-id', '' + message.mid);
|
||||||
@ -398,8 +399,7 @@ export function wrapDocument({message, withTime, fontWeight, voiceAsMusic, showS
|
|||||||
if(searchContext) audioElement.searchContext = searchContext;
|
if(searchContext) audioElement.searchContext = searchContext;
|
||||||
if(showSender) audioElement.showSender = showSender;
|
if(showSender) audioElement.showSender = showSender;
|
||||||
|
|
||||||
const isPending = message.pFlags.is_outgoing;
|
if(uploading) {
|
||||||
if(isPending) {
|
|
||||||
audioElement.preloader = message.media.preloader;
|
audioElement.preloader = message.media.preloader;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -407,8 +407,6 @@ export function wrapDocument({message, withTime, fontWeight, voiceAsMusic, showS
|
|||||||
audioElement.render();
|
audioElement.render();
|
||||||
return audioElement;
|
return audioElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uploading = message.pFlags.is_outgoing && message.media?.preloader;
|
|
||||||
|
|
||||||
let extSplitted = doc.file_name ? doc.file_name.split('.') : '';
|
let extSplitted = doc.file_name ? doc.file_name.split('.') : '';
|
||||||
let ext = '';
|
let ext = '';
|
||||||
|
@ -1472,7 +1472,7 @@ export class AppMessagesManager {
|
|||||||
|
|
||||||
private generateForwardHeader(peerId: number, originalMessage: Message.message) {
|
private generateForwardHeader(peerId: number, originalMessage: Message.message) {
|
||||||
const myId = appUsersManager.getSelf().id;
|
const myId = appUsersManager.getSelf().id;
|
||||||
if(originalMessage.fromId === myId && !originalMessage.fwd_from) {
|
if(originalMessage.fromId === myId && originalMessage.peerId === myId && !originalMessage.fwd_from) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user