aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Activity.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-06-16 12:16:22 +0000
committerMario <mario@mariovavti.com>2023-06-16 12:16:22 +0000
commit18b7b3f125b88143d4edefec22a0df67869788d9 (patch)
tree95091a727d0e0e34dbfaafb739294b52151dbd5e /Zotlabs/Lib/Activity.php
parent6989a3eaadd676c5c1b5fd523c4196d289423471 (diff)
downloadvolse-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.php21
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'])