diff options
author | Mario <mario@mariovavti.com> | 2020-04-12 07:35:17 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-04-12 07:35:17 +0000 |
commit | 27ae9c9d343fec96f117d5c4940d2221bc7cfd55 (patch) | |
tree | f11956bc308c0679f6bc72074afc6fc2f229bc74 /include/conversation.php | |
parent | 52e698cae6794ce92c249fd365f6035f88382688 (diff) | |
download | volse-hubzilla-27ae9c9d343fec96f117d5c4940d2221bc7cfd55.tar.gz volse-hubzilla-27ae9c9d343fec96f117d5c4940d2221bc7cfd55.tar.bz2 volse-hubzilla-27ae9c9d343fec96f117d5c4940d2221bc7cfd55.zip |
just comment out is_edit_activity() call and add comments on why it is commented out
Diffstat (limited to 'include/conversation.php')
-rw-r--r-- | include/conversation.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/conversation.php b/include/conversation.php index a78ee1704..b0e81b7e2 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -423,9 +423,43 @@ function visible_activity($item) { } } + // We only need edit activities for other federated protocols + // which do not support edits natively. While this does federate + // edits, it presents a number of issues locally - such as #757 and #758. + // The SQL check for an edit activity would not perform that well so to fix these issues + // requires an additional item flag (perhaps 'item_edit_activity') that we can add to the + // query for searches and notifications. + + // For now we'll just forget about trying to make edits work on network protocols that + // don't support them. + + // 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 true; + + return false; +} /** * @brief "Render" a conversation or list of items for HTML display. |