Bring lastMessage and lastMessageStatus back to conversation
This commit is contained in:
@@ -135,8 +135,6 @@
|
||||
this.unset('unidentifiedDeliveryUnrestricted');
|
||||
this.unset('hasFetchedProfile');
|
||||
this.unset('tokens');
|
||||
this.unset('lastMessage');
|
||||
this.unset('lastMessageStatus');
|
||||
|
||||
this.typingRefreshTimer = null;
|
||||
this.typingPauseTimer = null;
|
||||
@@ -323,8 +321,8 @@
|
||||
|
||||
isTyping: typingKeys.length > 0,
|
||||
lastMessage: {
|
||||
status: this.lastMessageStatus,
|
||||
text: this.lastMessage,
|
||||
status: this.get('lastMessageStatus'),
|
||||
text: this.get('lastMessage'),
|
||||
},
|
||||
|
||||
onClick: () => this.trigger('select', this),
|
||||
@@ -879,10 +877,10 @@
|
||||
});
|
||||
|
||||
const message = this.addSingleMessage(messageWithSchema);
|
||||
this.lastMessage = message.getNotificationText();
|
||||
this.lastMessageStatus = 'sending';
|
||||
|
||||
this.set({
|
||||
lastMessage: message.getNotificationText(),
|
||||
lastMessageStatus: 'sending',
|
||||
active_at: now,
|
||||
timestamp: now,
|
||||
});
|
||||
@@ -1154,17 +1152,6 @@
|
||||
: null,
|
||||
});
|
||||
|
||||
let hasChanged = false;
|
||||
const { lastMessage, lastMessageStatus } = lastMessageUpdate;
|
||||
delete lastMessageUpdate.lastMessage;
|
||||
delete lastMessageUpdate.lastMessageStatus;
|
||||
|
||||
hasChanged = hasChanged || lastMessage !== this.lastMessage;
|
||||
this.lastMessage = lastMessage;
|
||||
|
||||
hasChanged = hasChanged || lastMessageStatus !== this.lastMessageStatus;
|
||||
this.lastMessageStatus = lastMessageStatus;
|
||||
|
||||
// Because we're no longer using Backbone-integrated saves, we need to manually
|
||||
// clear the changed fields here so our hasChanged() check below is useful.
|
||||
this.changed = {};
|
||||
@@ -1174,8 +1161,6 @@
|
||||
await window.Signal.Data.updateConversation(this.id, this.attributes, {
|
||||
Conversation: Whisper.Conversation,
|
||||
});
|
||||
} else if (hasChanged) {
|
||||
this.trigger('change');
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user