🐛 Fix disturbable condition

This commit is contained in:
LittleSheep 2024-06-27 12:20:42 +08:00
parent 9f7205ba14
commit 0276a9b0bf
2 changed files with 9 additions and 4 deletions

9
.idea/workspace.xml generated
View File

@ -4,7 +4,10 @@
<option name="autoReloadType" value="ALL" /> <option name="autoReloadType" value="ALL" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":bug: Fix bugs in status" /> <list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":bug: Fix status query condition">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/services/statuses.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/services/statuses.go" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -149,7 +152,6 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value=":bug: Bug fixes" />
<MESSAGE value=":arrow_up: Fix notification listen" /> <MESSAGE value=":arrow_up: Fix notification listen" />
<MESSAGE value=":bug: Fix magic token's foreign key" /> <MESSAGE value=":bug: Fix magic token's foreign key" />
<MESSAGE value=":sparkles: Better avatar and banner APIs" /> <MESSAGE value=":sparkles: Better avatar and banner APIs" />
@ -174,7 +176,8 @@
<MESSAGE value=":ambulance: Fix getting user panic again..." /> <MESSAGE value=":ambulance: Fix getting user panic again..." />
<MESSAGE value=":bug: Fix status validation issue" /> <MESSAGE value=":bug: Fix status validation issue" />
<MESSAGE value=":bug: Fix bugs in status" /> <MESSAGE value=":bug: Fix bugs in status" />
<option name="LAST_COMMIT_MESSAGE" value=":bug: Fix bugs in status" /> <MESSAGE value=":bug: Fix status query condition" />
<option name="LAST_COMMIT_MESSAGE" value=":bug: Fix status query condition" />
</component> </component>
<component name="VgoProject"> <component name="VgoProject">
<settings-migrated>true</settings-migrated> <settings-migrated>true</settings-migrated>

View File

@ -37,8 +37,10 @@ func GetStatusDisturbable(uid uint) error {
return nil return nil
} else if err == nil && status.IsNoDisturb { } else if err == nil && status.IsNoDisturb {
return fmt.Errorf("do not disturb") return fmt.Errorf("do not disturb")
} else { } else if !isOnline {
return fmt.Errorf("offline") return fmt.Errorf("offline")
} else {
return nil
} }
} }