mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-22 16:24:00 +01:00
Avoid returning DB error when deleted message identifiers don't have a device ID
This commit is contained in:
parent
f1ca76a5a0
commit
a937b35e54
@ -204,7 +204,8 @@ func (db *DB) DeleteMessagesFromBackend(ctx context.Context, userId string, dele
|
|||||||
return 0, fmt.Errorf("failed to delete entry because userId is empty")
|
return 0, fmt.Errorf("failed to delete entry because userId is empty")
|
||||||
}
|
}
|
||||||
if message.DeviceId == "" {
|
if message.DeviceId == "" {
|
||||||
return 0, fmt.Errorf("failed to delete entry because MessageIdentifier.DeviceId is empty")
|
// The DeviceId is empty, so there is nothing to do for this since it won't match anything
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
if message.EndTime != (time.Time{}) && message.EntryId != "" {
|
if message.EndTime != (time.Time{}) && message.EntryId != "" {
|
||||||
// Note that we do an OR with date or the ID matching since the ID is not always recorded for older history entries.
|
// Note that we do an OR with date or the ID matching since the ID is not always recorded for older history entries.
|
||||||
|
Loading…
Reference in New Issue
Block a user