修复了一些问题

This commit is contained in:
2026-08-25 17:57:20 +08:00
parent 8eb0079bc4
commit dbb1f776f2
19 changed files with 785 additions and 634 deletions
+8 -9
View File
@@ -69,21 +69,20 @@ final class NotificationPreferences {
public static function category_for_type(string $notification_type): string {
$type = sanitize_key($notification_type);
if (
in_array($type, ['posts', 'post', 'comment', 'favorite', 'pending_comments'], true)
|| str_starts_with($type, 'post_')
|| str_starts_with($type, 'comment_')
|| str_starts_with($type, 'favorite_')
) {
return 'posts';
}
if (
in_array($type, ['like', 'follow', 'followed', 'hot'], true)
in_array($type, ['like', 'post_like', 'comment_like', 'follow', 'followed', 'hot'], true)
|| str_starts_with($type, 'like_')
|| str_starts_with($type, 'follow_')
|| str_starts_with($type, 'followed_')
) {
return 'like';
}
if (
in_array($type, ['posts', 'post', 'comment', 'favorite', 'post_favorite', 'pending_comments'], true)
|| str_starts_with($type, 'comment_')
|| str_starts_with($type, 'favorite_')
) {
return 'posts';
}
return 'system';
}