diff options
author | zotlabs <mike@macgirvin.com> | 2016-10-25 20:43:24 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-10-25 20:43:24 -0700 |
commit | bd83936e5dfa3f39f382e9b52f3cb28e19d5c2d0 (patch) | |
tree | b78ccc5c57dd643b83d1435c942a34b9a8e98e98 | |
parent | 88a68b941ff2c8295ac5a6f221855bc4940ddb40 (diff) | |
download | volse-hubzilla-bd83936e5dfa3f39f382e9b52f3cb28e19d5c2d0.tar.gz volse-hubzilla-bd83936e5dfa3f39f382e9b52f3cb28e19d5c2d0.tar.bz2 volse-hubzilla-bd83936e5dfa3f39f382e9b52f3cb28e19d5c2d0.zip |
send "hidden" edit activities to networks which don't support edits themselves
-rw-r--r-- | Zotlabs/Daemon/Notifier.php | 1 | ||||
-rw-r--r-- | Zotlabs/Module/Editpost.php | 1 | ||||
-rw-r--r-- | Zotlabs/Module/Item.php | 2 | ||||
-rw-r--r-- | include/conversation.php | 7 | ||||
-rwxr-xr-x | include/items.php | 32 |
5 files changed, 39 insertions, 4 deletions
diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 441997db9..7b0dfab92 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -4,6 +4,7 @@ namespace Zotlabs\Daemon; require_once('include/queue_fn.php'); require_once('include/html2plain.php'); +require_once('include/conversation.php'); /* * This file was at one time responsible for doing all deliveries, but this caused diff --git a/Zotlabs/Module/Editpost.php b/Zotlabs/Module/Editpost.php index 2c57cde5a..5c04653b8 100644 --- a/Zotlabs/Module/Editpost.php +++ b/Zotlabs/Module/Editpost.php @@ -85,6 +85,7 @@ class Editpost extends \Zotlabs\Web\Controller { 'hide_voting' => true, 'hide_future' => true, 'hide_location' => true, + 'parent' => (($itm[0]['mid'] === $itm[0]['parent_mid']) ? 0 : $itm[0]['parent']), 'mimetype' => $itm[0]['mimetype'], 'ptyp' => $itm[0]['obj_type'], 'body' => htmlspecialchars_decode(undo_post_tagging($itm[0]['body']),ENT_COMPAT), diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index bcbdcb9e9..344e839f4 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -901,7 +901,7 @@ class Item extends \Zotlabs\Web\Controller { $x = item_store_update($datarray,$execflag); - // item_create_edit_activity($x); + item_create_edit_activity($x); if(! $parent) { $r = q("select * from item where id = %d", diff --git a/include/conversation.php b/include/conversation.php index 02c61b688..61d31fef4 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -414,8 +414,8 @@ function visible_activity($item) { } } -// if(is_edit_activity($item)) -// return false; + if(is_edit_activity($item)) + return false; return true; } @@ -1312,7 +1312,8 @@ function status_editor($a, $x, $popup = false) { '$expiryModalOK' => t('OK'), '$expiryModalCANCEL' => t('Cancel'), '$expanded' => ((x($x, 'expanded')) ? $x['expanded'] : false), - '$bbcode' => ((x($x, 'bbcode')) ? $x['bbcode'] : false) + '$bbcode' => ((x($x, 'bbcode')) ? $x['bbcode'] : false), + '$parent' => ((array_key_exists('parent',$x) && $x['parent']) ? $x['parent'] : 0) )); if ($popup === true) { diff --git a/include/items.php b/include/items.php index bb78af930..2357384de 100755 --- a/include/items.php +++ b/include/items.php @@ -4506,6 +4506,7 @@ function fix_attached_file_permissions($channel,$observer_hash,$body, function item_create_edit_activity($post) { + if((! $post) || (! $post['item'])) return; @@ -4513,6 +4514,13 @@ function item_create_edit_activity($post) { $new_item = $update_item; + $author = q("select * from xchan where xchan_hash = '%s' limit 1", + dbesc($new_item['author_xchan']) + ); + if($author) + $item_author = $author[0]; + + $new_item['id'] = 0; $new_item['parent'] = 0; $new_item['mid'] = item_message_id(); @@ -4521,11 +4529,35 @@ function item_create_edit_activity($post) { $new_item['body'] .= "\n\n"; $new_item['body'] .= $update_item['body']; + + $new_item['sig'] = ''; $new_item['verb'] = ACTIVITY_UPDATE; $new_item['item_thread_top'] = 0; $new_item['created'] = $new_item['edited'] = datetime_convert(); + $new_item['obj'] = json_encode(array( + 'type' => (($update_item['item_thread_top']) ? ACTIVITY_OBJ_NOTE : ACTIVITY_OBJ_COMMENT), + 'id' => $update_item['mid'], + 'parent' => $update_item['parent_mid'], + 'link' => array(array('rel' => 'alternate','type' => 'text/html', 'href' => $update_item['plink'])), + 'title' => $update_item['title'], + 'content' => $update_item['body'], + 'created' => $update_item['created'], + 'edited' => $update_item['edited'], + 'author' => array( + 'name' => $item_author['xchan_name'], + 'address' => $item_author['xchan_addr'], + 'guid' => $item_author['xchan_guid'], + 'guid_sig' => $item_author['xchan_guid_sig'], + 'link' => array( + array('rel' => 'alternate', 'type' => 'text/html', 'href' => $item_author['xchan_url']), + array('rel' => 'photo', 'type' => $item_author['xchan_photo_mimetype'], 'href' => $item_author['xchan_photo_m'])), + ), + )); + + + $x = post_activity_item($new_item); $post_id = $x['id']; |