mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
skip updateLastMessage for inactive convos
those are the ones created when getting messages on a public group. they are not shown on the conversation list
This commit is contained in:
parent
13df6c476e
commit
9645c210dd
1 changed files with 5 additions and 5 deletions
|
@ -849,16 +849,18 @@
|
|||
);
|
||||
await serverAPI.setAvatar(url, profileKey);
|
||||
},
|
||||
async updateLastMessage() {
|
||||
async bouncyUpdateLastMessage() {
|
||||
if (!this.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.get('active_at')) {
|
||||
window.log.info('Skipping update last message as active_at is falsy');
|
||||
return;
|
||||
}
|
||||
const messages = await window.Signal.Data.getMessagesByConversation(
|
||||
this.id,
|
||||
{ limit: 1, MessageCollection: Whisper.MessageCollection }
|
||||
);
|
||||
|
||||
const lastMessageModel = messages.at(0);
|
||||
const lastMessageJSON = lastMessageModel
|
||||
? lastMessageModel.toJSON()
|
||||
|
@ -874,12 +876,10 @@
|
|||
? lastMessageModel.getNotificationText()
|
||||
: null,
|
||||
});
|
||||
|
||||
// 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 = {};
|
||||
this.set(lastMessageUpdate);
|
||||
|
||||
if (this.hasChanged()) {
|
||||
await this.commit();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue