diff options
author | Mario <mario@mariovavti.com> | 2023-06-16 12:16:22 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-06-16 12:16:22 +0000 |
commit | 18b7b3f125b88143d4edefec22a0df67869788d9 (patch) | |
tree | 95091a727d0e0e34dbfaafb739294b52151dbd5e /Zotlabs/Lib/Activity.php | |
parent | 6989a3eaadd676c5c1b5fd523c4196d289423471 (diff) | |
download | volse-hubzilla-18b7b3f125b88143d4edefec22a0df67869788d9.tar.gz volse-hubzilla-18b7b3f125b88143d4edefec22a0df67869788d9.tar.bz2 volse-hubzilla-18b7b3f125b88143d4edefec22a0df67869788d9.zip |
deprecate ActivityStreams::fetch() and provide the possibility to fetch local items directly
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r-- | Zotlabs/Lib/Activity.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index dbf7f7b46..23ba89462 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -50,6 +50,25 @@ class Activity { } + public static function fetch_local($url, $portable_id) { + $sql_extra = item_permissions_sql(0, $portable_id); + $item_normal = item_normal(); + + // Find the original object + $j = q( + "select *, id as item_id from item where mid = '%s' and item_wall = 1 $item_normal $sql_extra", + dbesc($url) + ); + if ($j) { + xchan_query($j, true); + $items = fetch_post_tags($j); + } + if ($items) { + return self::encode_item(array_shift($items), true); + } + return false; + } + static function fetch($url, $channel = null) { $redirects = 0; if (!check_siteallowed($url)) { @@ -2962,7 +2981,6 @@ class Activity { }*/ } else { - $allowed = true; // reject public stream comments that weren't sent by the conversation owner @@ -3180,7 +3198,6 @@ class Activity { // TODO: not implemented // self::rewrite_mentions($item); - $r = q("select id, created, edited from item where mid = '%s' and uid = %d limit 1", dbesc($item['mid']), intval($item['uid']) |