Fix activity notification delition on message delition
This commit is contained in:
parent
5b0d8a7c4e
commit
6f93913be5
|
@ -43,6 +43,10 @@ func (db sqlitePersistence) DeleteActivityCenterNotificationForMessage(chatID st
|
||||||
var ids []types.HexBytes
|
var ids []types.HexBytes
|
||||||
|
|
||||||
for _, notification := range notifications {
|
for _, notification := range notifications {
|
||||||
|
if notification.LastMessage != nil && notification.LastMessage.ID == messageID {
|
||||||
|
ids = append(ids, notification.ID)
|
||||||
|
}
|
||||||
|
|
||||||
if notification.Message != nil && notification.Message.ID == messageID {
|
if notification.Message != nil && notification.Message.ID == messageID {
|
||||||
ids = append(ids, notification.ID)
|
ids = append(ids, notification.ID)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1167,6 +1167,10 @@ func (m *Messenger) HandleDeleteMessage(state *ReceivedMessageState, deleteMessa
|
||||||
if err := m.updateLastMessage(chat); err != nil {
|
if err := m.updateLastMessage(chat); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if chat.LastMessage != nil && chat.LastMessage.Seen == false && chat.OneToOne() && !chat.Active {
|
||||||
|
m.createMessageNotification(chat, state)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
state.Response.AddRemovedMessage(&RemovedMessage{MessageID: messageID, ChatID: chat.ID})
|
state.Response.AddRemovedMessage(&RemovedMessage{MessageID: messageID, ChatID: chat.ID})
|
||||||
|
|
Loading…
Reference in New Issue