More granular icon safety

dev
gravel 2 years ago
parent a058bf2de1
commit c1541b2c9a
Signed by: gravel
GPG Key ID: C0538F3C906B308F

@ -537,12 +537,11 @@ label[for=toggle-show-room-ids]::after {
transition: filter 0.15s, opacity 0.15s; transition: filter 0.15s, opacity 0.15s;
} }
#details-modal-community-icon:not([data-icon-safety="1"], #details-modal-community-icon-wrapper:hover > *) { #details-modal-community-icon:not([data-icon-safety="-1"], #details-modal-community-icon-wrapper:hover > *) {
opacity: 0.5; opacity: 0.5;
filter: blur(3px); filter: blur(3px);
} }
#details-modal-start #details-modal-description { #details-modal-start #details-modal-description {
max-height: 50vh; max-height: 50vh;
overflow: auto; overflow: auto;

@ -67,10 +67,12 @@
/** /**
* @var string[] $ICON_BLOCKLIST * @var string[] $ICON_BLOCKLIST
* These hostnames are considered to have unsafe room icons. * These hostnames or rooms are considered to have unsafe room icons.
*/ */
$ICON_BLOCKLIST = [ $ICON_BLOCKLIST = [
"gaohuangse.work" "gaohuangse.work",
"46.101.253.18",
"womanbodybeauty+13f6"
]; ];
$SERVER_ICON_MAPPING = [ $SERVER_ICON_MAPPING = [

@ -80,6 +80,9 @@
function room_icon_safety(\CommunityRoom $room): int { function room_icon_safety(\CommunityRoom $room): int {
global $ICON_ALLOWLIST, $ICON_BLOCKLIST; global $ICON_ALLOWLIST, $ICON_BLOCKLIST;
if (in_array($room->get_room_identifier(), $ICON_BLOCKLIST)) {
return -1;
}
if (in_array($room->server->get_hostname(), $ICON_ALLOWLIST)) { if (in_array($room->server->get_hostname(), $ICON_ALLOWLIST)) {
return 1; return 1;
} }

Loading…
Cancel
Save