Move link notification to the conversation hero

This commit is contained in:
Josh Perez 2022-04-25 17:03:24 -04:00 committed by GitHub
parent 5f3a62cbb6
commit 2f44e33c9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 174 additions and 350 deletions

View file

@ -219,8 +219,6 @@ export class ConversationModel extends window.Backbone
private isFetchingUUID?: boolean;
private hasAddedHistoryDisclaimer?: boolean;
private lastIsTyping?: boolean;
private muteTimer?: NodeJS.Timer;
@ -4578,38 +4576,6 @@ export class ConversationModel extends window.Backbone
return message;
}
async addMessageHistoryDisclaimer(): Promise<void> {
const timestamp = Date.now();
if (this.hasAddedHistoryDisclaimer) {
log.warn(
`addMessageHistoryDisclaimer/${this.idForLogging()}: Refusing to add another this session`
);
return;
}
this.hasAddedHistoryDisclaimer = true;
const model = new window.Whisper.Message({
type: 'message-history-unsynced',
readStatus: ReadStatus.Read,
seenStatus: SeenStatus.NotApplicable,
conversationId: this.id,
sent_at: timestamp,
received_at: window.Signal.Util.incrementMessageCounter(),
received_at_ms: timestamp,
// TODO: DESKTOP-722
} as unknown as MessageAttributesType);
const id = await window.Signal.Data.saveMessage(model.attributes, {
ourUuid: window.textsecure.storage.user.getCheckedUuid().toString(),
});
model.set({ id });
const message = window.MessageController.register(id, model);
this.addSingleMessage(message);
}
isSearchable(): boolean {
return !this.get('left');
}