From 2df44eb084dc3e4e29ef2b0dd45e68f28ae1908d Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 18 Jan 2018 20:16:14 +0000 Subject: [PATCH 1/2] Liking of your own stuff wasn't possible/enable dislike for Diaspora --- src/Object/Post.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Object/Post.php b/src/Object/Post.php index a26004e0f3..517a06b777 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -82,8 +82,9 @@ class Post extends BaseObject continue; } - // You can always comment on Diaspora items - if (($item['network'] == NETWORK_DIASPORA) && (local_user() == $item['uid'])) { + // You can always comment on Diaspora and OStatus items + // The empty network can happen with your local (self) contact + if (in_array($item['network'], ['', NETWORK_OSTATUS, NETWORK_DIASPORA]) && (local_user() == $item['uid'])) { $item['writable'] = true; } @@ -321,8 +322,7 @@ class Post extends BaseObject $owner_name_e = $this->getOwnerName(); // Disable features that aren't available in several networks - /// @todo Add NETWORK_DIASPORA when it will pass this information - if (!in_array($item["item_network"], [NETWORK_DFRN]) && isset($buttons["dislike"])) { + if (!in_array($item["item_network"], [NETWORK_DFRN, NETWORK_DIASPORA]) && isset($buttons["dislike"])) { unset($buttons["dislike"]); $isevent = false; $tagger = ''; From 7b3e334f06ba185a0fb6275085fab011d3e2b01c Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 18 Jan 2018 20:54:40 +0000 Subject: [PATCH 2/2] "save to folder" and "mark" can't work on global items --- src/Object/Post.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Object/Post.php b/src/Object/Post.php index 517a06b777..a3d6818fcf 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -175,7 +175,7 @@ class Post extends BaseObject 'delete' => t('Delete'), ]; - $filer = (($conv->getProfileOwner() == local_user()) ? t("save to folder") : false); + $filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? t("save to folder") : false); $diff_author = !link_compare($item['url'], $item['author-link']); $profile_name = htmlentities(((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']); @@ -252,7 +252,7 @@ class Post extends BaseObject $tagger = ''; if ($this->isToplevel()) { - if ($conv->getProfileOwner() == local_user()) { + if ($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) { $isstarred = (($item['starred']) ? "starred" : "unstarred"); $star = [ @@ -263,6 +263,7 @@ class Post extends BaseObject 'classundo' => $item['starred'] ? "" : "hidden", 'starred' => t('starred'), ]; + $thread = dba::selectFirst('thread', ['ignored'], ['uid' => $item['uid'], 'iid' => $item['id']]); if (DBM::is_result($thread)) { $ignore = [