diff --git a/assets/misuzu.css/profile/warning.css b/assets/misuzu.css/profile/warning.css index bed75fc..ad35b65 100644 --- a/assets/misuzu.css/profile/warning.css +++ b/assets/misuzu.css/profile/warning.css @@ -11,10 +11,6 @@ --accent-colour: #666; } -.profile__warning--silence { - --accent-colour: #f70; -} - .profile__warning--ban { --accent-colour: #c33; } @@ -136,4 +132,4 @@ .profile__warning__options { justify-content: flex-start; } -} \ No newline at end of file +} diff --git a/public-legacy/comments.php b/public-legacy/comments.php index b2d9047..d9f465a 100644 --- a/public-legacy/comments.php +++ b/public-legacy/comments.php @@ -28,10 +28,6 @@ if($currentUserInfo->isBanned()) { echo render_info('You have been banned, check your profile for more information.', 403); return; } -if($currentUserInfo->isSilenced()) { - echo render_info('You have been silenced, check your profile for more information.', 403); - return; -} $comments = $msz->getComments(); diff --git a/public-legacy/forum/post.php b/public-legacy/forum/post.php index 0d9f197..ab236f3 100644 --- a/public-legacy/forum/post.php +++ b/public-legacy/forum/post.php @@ -22,10 +22,6 @@ if(isset($currentUser) && $currentUser->isBanned()) { echo render_info('You have been banned, check your profile for more information.', 403); return; } -if(isset($currentUser) && $currentUser->isSilenced()) { - echo render_info('You have been silenced, check your profile for more information.', 403); - return; -} $postInfo = forum_post_get($postId, true); $perms = empty($postInfo) diff --git a/public-legacy/forum/topic.php b/public-legacy/forum/topic.php index 98c856c..f512b57 100644 --- a/public-legacy/forum/topic.php +++ b/public-legacy/forum/topic.php @@ -87,10 +87,6 @@ if(in_array($moderationMode, $validModerationModes, true)) { echo render_info('You have been banned, check your profile for more information.', 403); return; } - if($topicUser->isSilenced()) { - echo render_info('You have been silenced, check your profile for more information.', 403); - return; - } switch($moderationMode) { case 'delete': diff --git a/public-legacy/manage/users/warnings.php b/public-legacy/manage/users/warnings.php index d9ee50f..abf4558 100644 --- a/public-legacy/manage/users/warnings.php +++ b/public-legacy/manage/users/warnings.php @@ -154,7 +154,6 @@ Template::render('manage.users.warnings', [ 'types' => [ UserWarning::TYPE_NOTE => 'Note', UserWarning::TYPE_WARN => 'Warning', - UserWarning::TYPE_MUTE => 'Silence', UserWarning::TYPE_BAHN => 'Ban', ], ], diff --git a/src/SharpChat/SharpChatPerms.php b/src/SharpChat/SharpChatPerms.php index c72c7f1..7879642 100644 --- a/src/SharpChat/SharpChatPerms.php +++ b/src/SharpChat/SharpChatPerms.php @@ -6,7 +6,7 @@ use Misuzu\Users\User; final class SharpChatPerms { private const P_KICK_USER = 0x00000001; private const P_BAN_USER = 0x00000002; - private const P_SILENCE_USER = 0x00000004; + //private const P_SILENCE_USER = 0x00000004; private const P_BROADCAST = 0x00000008; private const P_SET_OWN_NICK = 0x00000010; private const P_SET_OTHER_NICK = 0x00000020; @@ -26,7 +26,7 @@ final class SharpChatPerms { private const PERMS_DEFAULT = self::P_SEND_MESSAGE | self::P_DELETE_OWN_MSG | self::P_EDIT_OWN_MSG; private const PERMS_MANAGE_USERS = self::P_SET_OWN_NICK | self::P_SET_OTHER_NICK | self::P_DELETE_ANY_MSG | self::P_EDIT_ANY_MSG | self::P_VIEW_IP_ADDR | self::P_BROADCAST; - private const PERMS_MANAGE_WARNS = self::P_KICK_USER | self::P_BAN_USER | self::P_SILENCE_USER; + private const PERMS_MANAGE_WARNS = self::P_KICK_USER | self::P_BAN_USER; private const PERMS_CHANGE_BACKG = self::P_SET_OWN_NICK | self::P_CREATE_CHANNEL | self::P_SET_CHAN_PASS; private const PERMS_MANAGE_FORUM = self::P_CREATE_CHANNEL | self::P_SET_CHAN_PERMA | self::P_SET_CHAN_PASS | self::P_SET_CHAN_HIER | self::P_DELETE_CHANNEL | self::P_JOIN_ANY_CHAN; diff --git a/src/SharpChat/SharpChatRoutes.php b/src/SharpChat/SharpChatRoutes.php index ca00501..cc74340 100644 --- a/src/SharpChat/SharpChatRoutes.php +++ b/src/SharpChat/SharpChatRoutes.php @@ -234,7 +234,6 @@ final class SharpChatRoutes { 'colour_raw' => Colour::toMisuzu($userInfo->getColour()), 'rank' => $rank = $userInfo->getRank(), 'hierarchy' => $rank, - 'is_silenced' => date('c', $userInfo->isSilenced() || $userInfo->isBanned() ? ($userInfo->isActiveWarningPermanent() ? strtotime('10 years') : $userInfo->getActiveWarningExpiration()) : 0), 'perms' => SharpChatPerms::convert($userInfo), ]; } diff --git a/src/Users/User.php b/src/Users/User.php index 34be691..b165e62 100644 --- a/src/Users/User.php +++ b/src/Users/User.php @@ -497,9 +497,6 @@ class User implements HasRankInterface { public function hasActiveWarning(): bool { return $this->getActiveWarning() !== null && !$this->getActiveWarning()->hasExpired(); } - public function isSilenced(): bool { - return $this->hasActiveWarning() && $this->getActiveWarning()->isSilence(); - } public function isBanned(): bool { return $this->hasActiveWarning() && $this->getActiveWarning()->isBan(); } diff --git a/src/Users/UserWarning.php b/src/Users/UserWarning.php index 5dd4167..4965ffa 100644 --- a/src/Users/UserWarning.php +++ b/src/Users/UserWarning.php @@ -13,20 +13,17 @@ class UserWarning { // Warning, only shows up to moderators and the user themselves public const TYPE_WARN = 1; - // Silences, prevent a user from speaking and is visible to any logged in user - public const TYPE_MUTE = 2; - // Banning, prevents a user from interacting in general // User will still be able to log in and change certain details but can no longer partake in community things public const TYPE_BAHN = 3; - private const TYPES = [self::TYPE_NOTE, self::TYPE_WARN, self::TYPE_MUTE, self::TYPE_BAHN]; + private const TYPES = [self::TYPE_NOTE, self::TYPE_WARN, self::TYPE_BAHN]; private const VISIBLE_TO_STAFF = self::TYPES; - private const VISIBLE_TO_USER = [self::TYPE_WARN, self::TYPE_MUTE, self::TYPE_BAHN]; - private const VISIBLE_TO_PUBLIC = [self::TYPE_MUTE, self::TYPE_BAHN]; + private const VISIBLE_TO_USER = [self::TYPE_WARN, self::TYPE_BAHN]; + private const VISIBLE_TO_PUBLIC = [self::TYPE_BAHN]; - private const HAS_DURATION = [self::TYPE_MUTE, self::TYPE_BAHN]; + private const HAS_DURATION = [self::TYPE_BAHN]; private const PROFILE_BACKLOG = 90; @@ -132,7 +129,6 @@ class UserWarning { public function getType(): int { return $this->warning_type; } public function isNote(): bool { return $this->getType() === self::TYPE_NOTE; } public function isWarning(): bool { return $this->getType() === self::TYPE_WARN; } - public function isSilence(): bool { return $this->getType() === self::TYPE_MUTE; } public function isBan(): bool { return $this->getType() === self::TYPE_BAHN; } public function isVisibleToUser(): bool { diff --git a/src/manage.php b/src/manage.php index 0a2bff8..35257d1 100644 --- a/src/manage.php +++ b/src/manage.php @@ -194,7 +194,7 @@ function manage_perms_list(array $rawPerms): array { ], [ 'section' => 'manage-warnings', - 'title' => 'Can manage warnings, silences and bans.', + 'title' => 'Can manage bans, warnings and notes.', 'perm' => MSZ_PERM_USER_MANAGE_WARNINGS, ], ], diff --git a/templates/auth/register.twig b/templates/auth/register.twig index c7d1fb8..b99717d 100644 --- a/templates/auth/register.twig +++ b/templates/auth/register.twig @@ -43,7 +43,7 @@
{% if register_restricted == 'ban' %} -

A user is currently in a banned and/or silenced state from the same IP address you're currently visiting the site from. If said user isn't you and you wish to create an account, please contact us!

+

A user from the same IP address you're currently visiting the site from is banned. If said user isn't you and you wish to create an account, please contact us!

{% else %}

The IP address from which you are visiting the website appears on our blacklist, you are not allowed to register from this address but if you already have an account you can log in just fine using the form above. If you think this blacklisting is a mistake, please contact us!

{% endif %} diff --git a/templates/master.twig b/templates/master.twig index 6fc5cf5..db292c1 100644 --- a/templates/master.twig +++ b/templates/master.twig @@ -129,7 +129,7 @@ {% if current_user.hasActiveWarning|default(false) %}
- You have been {{ current_user.isSilenced ? 'silenced' : 'banned' }} {% if current_user.isActiveWarningPermanent %}permanently{% else %}until {{ current_user.activeWarningExpiration|date('r') }}{% endif %}, view the account standing table on your profile to view why. + You have been banned {% if current_user.isActiveWarningPermanent %}permanently{% else %}until {{ current_user.activeWarningExpiration|date('r') }}{% endif %}, view the account standing table on your profile to view why.
{% endif %} diff --git a/templates/user/macros.twig b/templates/user/macros.twig index 0340bbf..a715de8 100644 --- a/templates/user/macros.twig +++ b/templates/user/macros.twig @@ -251,10 +251,7 @@ {% macro user_profile_warning(warning, show_private_note, show_user_info, delete_csrf) %} {% from 'macros.twig' import avatar %} - {% if warning.isSilence %} - {% set warning_text = 'Silence' %} - {% set warning_class = 'silence' %} - {% elseif warning.isBan %} + {% if warning.isBan %} {% set warning_text = 'Ban' %} {% set warning_class = 'ban' %} {% elseif warning.isWarning %}