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');
}

View file

@ -91,7 +91,6 @@ import {
isGroupV2Change,
isIncoming,
isKeyChange,
isMessageHistoryUnsynced,
isOutgoing,
isStory,
isProfileChange,
@ -295,7 +294,6 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
!isGroupV2Change(attributes) &&
!isGroupV1Migration(attributes) &&
!isKeyChange(attributes) &&
!isMessageHistoryUnsynced(attributes) &&
!isProfileChange(attributes) &&
!isUniversalTimerNotification(attributes) &&
!isUnsupportedMessage(attributes) &&
@ -1056,7 +1054,6 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
// Locally-generated notifications
const isKeyChangeValue = isKeyChange(attributes);
const isMessageHistoryUnsyncedValue = isMessageHistoryUnsynced(attributes);
const isProfileChangeValue = isProfileChange(attributes);
const isUniversalTimerNotificationValue =
isUniversalTimerNotification(attributes);
@ -1085,7 +1082,6 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
hasErrorsValue ||
// Locally-generated notifications
isKeyChangeValue ||
isMessageHistoryUnsyncedValue ||
isProfileChangeValue ||
isUniversalTimerNotificationValue;