aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/ConversationObject.php23
-rw-r--r--include/ItemObject.php14
-rw-r--r--include/zot.php5
3 files changed, 30 insertions, 12 deletions
diff --git a/include/ConversationObject.php b/include/ConversationObject.php
index 30026e908..5157dad05 100644
--- a/include/ConversationObject.php
+++ b/include/ConversationObject.php
@@ -138,22 +138,25 @@ class Conversation extends BaseObject {
return false;
}
- if(local_user() && $item->get_data_value('uid') == local_user())
- $this->commentable = true;
+// if(local_user() && $item->get_data_value('uid') == local_user())
+// $this->commentable = true;
- if($this->writable)
- $this->commentable = true;
+// if($this->writable)
+// $this->commentable = true;
+
+ $item->set_commentable(false);
+ $ob_hash = (($this->observer) ? $this->observer['xchan_hash'] : '');
+
+ if(($item->get_data_value('author_xchan') === $ob_hash) || ($item->get_data_value('owner_xchan') === $ob_hash))
+ $item->set_commentable(true);
if($item->get_data_value('item_flags') & ITEM_NOCOMMENT) {
- $this->commentable = false;
+ $item->set_commentable(false);
}
- elseif(($this->observer) && (! $this->writable)) {
- $this->commentable = can_comment_on_post($this->observer['xchan_hash'],$item->data);
+ elseif(($this->observer) && (! $item->is_commentable())) {
+ $item->set_commentable(can_comment_on_post($this->observer['xchan_hash'],$item->data));
}
-
-
-
$item->set_conversation($this);
$this->threads[] = $item;
return end($this->threads);
diff --git a/include/ItemObject.php b/include/ItemObject.php
index 0256160e9..681757a09 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -14,6 +14,7 @@ class Item extends BaseObject {
public $data = array();
private $template = 'conv_item.tpl';
private $comment_box_template = 'comment_item.tpl';
+ private $commentable = false;
private $toplevel = false;
private $children = array();
private $parent = null;
@@ -295,6 +296,15 @@ class Item extends BaseObject {
return $this->threaded;
}
+
+ public function set_commentable($val) {
+ $this->commentable = $val;
+ }
+
+ public function is_commentable() {
+ return $this->commentable;
+ }
+
/**
* Add a child item
*/
@@ -480,7 +490,9 @@ class Item extends BaseObject {
$comment_box = '';
$conv = $this->get_conversation();
- if(! $conv->is_commentable())
+// logger('Commentable conv: ' . $conv->is_commentable());
+
+ if(! $this->is_commentable())
return;
$template = get_markup_template($this->get_comment_box_template());
diff --git a/include/zot.php b/include/zot.php
index a98aca711..efcc4abaa 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -983,7 +983,10 @@ function public_recips($msg) {
else
$sql = " where (( " . $col . " & " . PERMS_NETWORK . " ) or ( " . $col . " & " . PERMS_PUBLIC . ")) ";
- $r = q("select channel_hash as hash from channel " . $sql );
+
+ $r = q("select channel_hash as hash from channel $sql or channel_hash = '%s' ",
+ dbesc($msg['notify']['sender']['hash'])
+ );
if(! $r)
$r = array();