修复了一些问题
This commit is contained in:
1 parent
8eb0079bc4
commit
dbb1f776f2
19 files changed
+785
-634
No files matched your search
@@ -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';
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user