aboutsummaryrefslogtreecommitdiffstats
path: root/include/conversation.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2016-10-25 16:21:56 -0700
committerzotlabs <mike@macgirvin.com>2016-10-25 16:21:56 -0700
commit084b41fc2c0e8abeec1da5c792ec552b5ae1ce8f (patch)
treeb123a0bf7453a95f5b94caa22b8c7b4a746c003f /include/conversation.php
parent7b713e25768a36ea032b683eb1763578102166d0 (diff)
downloadvolse-hubzilla-084b41fc2c0e8abeec1da5c792ec552b5ae1ce8f.tar.gz
volse-hubzilla-084b41fc2c0e8abeec1da5c792ec552b5ae1ce8f.tar.bz2
volse-hubzilla-084b41fc2c0e8abeec1da5c792ec552b5ae1ce8f.zip
first cut at edit activities
Diffstat (limited to 'include/conversation.php')
-rw-r--r--include/conversation.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/include/conversation.php b/include/conversation.php
index 43533e3c1..154a9f82d 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -405,8 +405,6 @@ function count_descendants($item) {
function visible_activity($item) {
$hidden_activities = [ ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_AGREE, ACTIVITY_DISAGREE, ACTIVITY_ABSTAIN, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE ];
- $post_types = [ ACTIVITY_OBJ_NOTE, ACTIVITY_OBJ_COMMENT, basename(ACTIVITY_OBJ_NOTE), basename(ACTIVITY_OBJ_COMMENT)];
-
if(intval($item['item_notshown']))
return false;
@@ -416,14 +414,32 @@ function visible_activity($item) {
}
}
+ if(is_edit_activity($item))
+ return false;
+
+ return true;
+}
+
+/**
+ * @brief Check if a given activity is an edit activity
+ *
+ *
+ * @param array $item
+ * @return boolean
+ */
+
+function is_edit_activity($item) {
+
+ $post_types = [ ACTIVITY_OBJ_NOTE, ACTIVITY_OBJ_COMMENT, basename(ACTIVITY_OBJ_NOTE), basename(ACTIVITY_OBJ_COMMENT)];
+
// In order to share edits with networks which have no concept of editing, we'll create
// separate activities to indicate the edit. Our network will not require them, since our
// edits are automatically applied and the activity indicated.
if(($item['verb'] === ACTIVITY_UPDATE) && (in_array($item['obj_type'],$post_types)))
- return false;
+ return true;
- return true;
+ return false;
}
/**