👔 Update the automated status logic

This commit is contained in:
2025-09-09 00:01:56 +08:00
parent ab2bdcc7ca
commit 0eeafb5352

View File

@@ -239,7 +239,7 @@ public class AccountCurrentController(
.Where(s => s.ClearedAt == null || s.ClearedAt > now)
.OrderByDescending(s => s.CreatedAt)
.FirstOrDefaultAsync();
if (existingStatus is not null)
if (existingStatus is not null && existingStatus.IsAutomated)
if (existingStatus.IsAutomated && request.AppIdentifier == existingStatus.AppIdentifier)
{
existingStatus.Attitude = request.Attitude;
@@ -256,6 +256,8 @@ public class AccountCurrentController(
db.Update(existingStatus);
await db.SaveChangesAsync();
}
else if (existingStatus is not null)
return Ok(existingStatus); // Do not override manually set status with automated ones
}
var status = new Status