aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorwinter2025-05-04 18:47:22 +0100
committerwinter2025-05-04 18:47:22 +0100
commit8b4bac25d588720f88d178cfd71fc8a8361e2ff5 (patch)
tree0a30150a07958740b2bb240d4fccb081607943b7
parent2f3377290a9478aff1c43558167fe8566787bc3a (diff)
fix interacting with notes from instances with no instance metadata
-rw-r--r--Digitigrade/Model/Actor.php2
-rw-r--r--templates/note/interaction_button.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/Digitigrade/Model/Actor.php b/Digitigrade/Model/Actor.php
index d18c1f5..ffaf4e8 100644
--- a/Digitigrade/Model/Actor.php
+++ b/Digitigrade/Model/Actor.php
@@ -359,7 +359,7 @@ class Actor extends PushableModel implements RpcReceiver {
return $relation != null;
}
- public function findHomeInstance(): Instance {
+ public function findHomeInstance(): ?Instance {
if ($this->isLocal) {
// can't do this because we don't keep track of ourself in the instance table
throw new \RuntimeException("attempted to find the instance of a local actor");
diff --git a/templates/note/interaction_button.php b/templates/note/interaction_button.php
index bfcbd85..1410b30 100644
--- a/templates/note/interaction_button.php
+++ b/templates/note/interaction_button.php
@@ -1,6 +1,6 @@
<?php
$active = $active ?? false;
-$forbidden = $disabled ? '.forbidden' : '';
+$forbidden = ($disabled ?? false) ? '.forbidden' : '';
$tooltip = match ($action) {
'like' => __("note.action.like$forbidden"),
'dislike' => __("note.action.dislike$forbidden"),