The automated status priority hierarchy (OUT_OF_OFFICE > AVAILABILITY >
CALL > CALENDAR_BUSY) was encoded as a nested if/elseif chain that required
touching multiple branches to add a new automated message type, and made the
relative ordering of statuses non-obvious.
Replace it with a MESSAGE_PRIORITY constant map (higher value = higher
priority) and a single comparison. The update shortcut — which directly
overwrites the active status without creating a new backup, used when a
higher-priority automated status takes over from a lower-priority one that
is already active — is only taken when both the incoming and current
messageIds are known automated statuses in the map. This preserves the
existing behaviour where a non-automated current status always goes through
the backup path.
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>