mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-22 01:17:41 -04:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c182c9d68 | ||
|
|
384eea79dc | ||
|
|
f8bc755c20 | ||
|
|
aa38e8360a | ||
|
|
fdf6680b29 | ||
|
|
8999a96ef0 | ||
|
|
b5d2236a58 | ||
|
|
91e59d3c4f | ||
|
|
a6ff444e19 | ||
|
|
29d4edb285 | ||
|
|
295d5f06dc | ||
|
|
362be52be0 | ||
|
|
20f5e654ad | ||
|
|
8c38ee8208 | ||
|
|
2c1c12825d |
20
CHANGELOG
20
CHANGELOG
@@ -1,3 +1,23 @@
|
||||
Hubzilla 10.2.3 (2025-04-11)
|
||||
- Fix bogus merge from 10.2.2 release
|
||||
|
||||
|
||||
Hubzilla 10.2.2 (2025-04-11)
|
||||
- Cleanup deprecated forum queries, improved performance
|
||||
- Fix zot6 handler returning success allthough Libzot::fetch() did not return anything useful
|
||||
- Fix json encoding of a possibly empty item.target
|
||||
- Fix permalink for forum posts and comments
|
||||
- Fix an obscure delivering issue which could produce duplicate posts
|
||||
- Lazy load profile photos for reactions to reduce server load
|
||||
- Pubcrawl: deal with Update(Tombstone)
|
||||
- Pubcrawl: fix mentions not mapped to "to" in public toplevel posts (regression)
|
||||
|
||||
|
||||
Hubzilla 10.2.1 (2025-03-18)
|
||||
- Fix OWA in cases where Signature is in the REDIRECT_REMOTE_USER field
|
||||
- Fix query in mod sse_bs
|
||||
|
||||
|
||||
Hubzilla 10.2 (2025-03-17)
|
||||
- Allow to send signed requests from the zot_probe tool
|
||||
- Print an error message if OWA fails
|
||||
|
||||
@@ -323,7 +323,13 @@ class Notifier {
|
||||
self::$encoded_item = json_decode($m, true);
|
||||
}
|
||||
else {
|
||||
self::$encoded_item = Activity::build_packet(Activity::encode_activity($target_item), self::$channel, false);
|
||||
$activity = Activity::encode_activity($target_item);
|
||||
|
||||
if (!$activity) {
|
||||
return;
|
||||
}
|
||||
|
||||
self::$encoded_item = Activity::build_packet($activity, self::$channel, false);
|
||||
}
|
||||
|
||||
logger('target_item: ' . print_r($target_item, true), LOGGER_DEBUG);
|
||||
@@ -340,6 +346,10 @@ class Notifier {
|
||||
|
||||
$relay_to_owner = (!$top_level_post && intval($target_item['item_origin']) && comment_local_origin($target_item));
|
||||
|
||||
if (self::$channel['channel_hash'] === $target_item['owner_xchan']) {
|
||||
$relay_to_owner = false;
|
||||
}
|
||||
|
||||
// $cmd === 'relay' indicates the owner is sending it to the original recipients
|
||||
// don't allow the item in the relay command to relay to owner under any circumstances, it will loop
|
||||
|
||||
|
||||
@@ -1169,10 +1169,6 @@ class Libzot {
|
||||
$raw_activity = $AS->data;
|
||||
|
||||
$AS = new ActivityStreams($raw_activity['object'], portable_id: $env['sender']);
|
||||
|
||||
// Store the original activity id and type for later usage
|
||||
$AS->meta['original_id'] = $original_id;
|
||||
$AS->meta['original_type'] = $original_type;
|
||||
}
|
||||
|
||||
if (is_array($AS->obj)) {
|
||||
@@ -1853,19 +1849,12 @@ class Libzot {
|
||||
dbesc($arr['author_xchan'])
|
||||
);
|
||||
|
||||
// If we import an add/remove activity ($is_collection_operation) we strip off the
|
||||
// add/remove part and only process the object.
|
||||
// When looking up the item to pass it to the notifier for relay, we need to look up
|
||||
// the original (stripped off) message id which we stored in $act->meta.
|
||||
|
||||
$sql_mid = (($is_collection_operation && $relay && $channel['channel_hash'] === $arr['owner_xchan']) ? $act->meta['original_id'] : $arr['mid']);
|
||||
|
||||
// Reactions such as like and dislike could have an mid with /activity/ in it.
|
||||
// Check for both forms in order to prevent duplicates.
|
||||
|
||||
$r = q("select * from item where mid in ('%s', '%s') and uid = %d limit 1",
|
||||
dbesc($sql_mid),
|
||||
dbesc(reverse_activity_mid($sql_mid)),
|
||||
dbesc($arr['mid']),
|
||||
dbesc(reverse_activity_mid($arr['mid'])),
|
||||
intval($channel['channel_id'])
|
||||
);
|
||||
|
||||
|
||||
@@ -885,19 +885,13 @@ class Item extends Controller {
|
||||
if ($parent_item)
|
||||
$parent_mid = $parent_item['mid'];
|
||||
|
||||
|
||||
// Fallback so that we always have a thr_parent
|
||||
|
||||
if (!$thr_parent)
|
||||
$thr_parent = $mid;
|
||||
|
||||
|
||||
$item_thread_top = ((!$parent) ? 1 : 0);
|
||||
|
||||
if ((!$plink) && ($item_thread_top)) {
|
||||
$plink = $mid;
|
||||
}
|
||||
|
||||
if (isset($datarray['obj']) && $datarray['obj']) {
|
||||
$datarray['obj']['id'] = $mid;
|
||||
}
|
||||
@@ -960,7 +954,7 @@ class Item extends Controller {
|
||||
$datarray['public_policy'] = $public_policy;
|
||||
$datarray['comment_policy'] = map_scope($comment_policy);
|
||||
$datarray['term'] = array_unique($post_tags, SORT_REGULAR);
|
||||
$datarray['plink'] = $plink;
|
||||
$datarray['plink'] = $plink ?? $mid;
|
||||
$datarray['route'] = $route;
|
||||
|
||||
// A specific ACL over-rides public_policy completely
|
||||
|
||||
@@ -278,32 +278,11 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
$likes_sql = " AND verb NOT IN ('Like', 'Dislike', '" . dbesc(ACTIVITY_LIKE) . "', '" . dbesc(ACTIVITY_DISLIKE) . "') ";
|
||||
|
||||
// This is for nouveau view public forum cid queries (if a forum notification is clicked)
|
||||
//$p = q("SELECT oid AS parent FROM term WHERE uid = %d AND ttype = %d AND term = '%s'",
|
||||
//intval(local_channel()),
|
||||
//intval(TERM_FORUM),
|
||||
//dbesc($cid_r[0]['xchan_name'])
|
||||
//);
|
||||
|
||||
//$p_str = ids_to_querystr($p, 'parent');
|
||||
|
||||
$p_sql = '';
|
||||
//if($p_str)
|
||||
//$p_sql = " OR item.parent IN ( $p_str ) ";
|
||||
|
||||
$sql_extra = " AND ( owner_xchan = '" . protect_sprintf(dbesc($cid_r[0]['abook_xchan'])) . "' OR owner_xchan = '" . protect_sprintf(dbesc($cid_r[0]['abook_xchan'])) . "' $p_sql ) AND item_unseen = 1 $likes_sql ";
|
||||
$sql_extra = " AND item.parent IN (SELECT DISTINCT parent FROM item WHERE uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' OR owner_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' ) $item_normal) AND item_unseen = 1 AND verb != 'Announce' $likes_sql ";
|
||||
}
|
||||
else {
|
||||
// This is for threaded view cid queries (e.g. if a forum is selected from the forum filter)
|
||||
$ttype = (($pf) ? TERM_FORUM : TERM_MENTION);
|
||||
|
||||
$p1 = dbq("SELECT DISTINCT parent FROM item WHERE uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' OR owner_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' ) $item_normal ");
|
||||
$p2 = dbq("SELECT oid AS parent FROM term WHERE uid = " . intval(local_channel()) . " AND ttype = $ttype AND term = '" . dbesc($cid_r[0]['xchan_name']) . "'");
|
||||
|
||||
$p_str = ids_to_querystr(array_merge($p1, $p2), 'parent');
|
||||
if(! $p_str)
|
||||
killme();
|
||||
|
||||
$sql_extra = " AND item.parent IN ( $p_str ) ";
|
||||
$sql_extra = " AND item.parent IN (SELECT DISTINCT parent FROM item WHERE uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' OR owner_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' ) $item_normal) ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@ class Owa extends Controller {
|
||||
$this->error('Missing or invalid authorization header.');
|
||||
}
|
||||
|
||||
$_SERVER['HTTP_AUTHORIZATION'] = $_SERVER['HTTP_AUTHORIZATION'] ?? $_SERVER['REDIRECT_REMOTE_USER'];
|
||||
|
||||
$sigblock = HTTPSig::parse_sigheader($_SERVER['HTTP_AUTHORIZATION']);
|
||||
if ($sigblock) {
|
||||
$keyId = $sigblock['keyId'];
|
||||
|
||||
@@ -207,7 +207,7 @@ class Sse_bs extends Controller {
|
||||
$item_normal
|
||||
$sql_extra
|
||||
$sql_extra2
|
||||
ORDER BY created DESC, received DESC LIMIT $limit OFFSET $offset",
|
||||
ORDER BY created DESC LIMIT $limit OFFSET $offset",
|
||||
intval(self::$uid),
|
||||
dbescdate($_SESSION['sse_loadtime']),
|
||||
dbesc(self::$ob_hash)
|
||||
@@ -290,7 +290,7 @@ class Sse_bs extends Controller {
|
||||
$item_normal
|
||||
$sql_extra
|
||||
$sql_extra2
|
||||
ORDER BY created DESC, received DESC LIMIT $limit OFFSET $offset",
|
||||
ORDER BY created DESC LIMIT $limit OFFSET $offset",
|
||||
intval(self::$uid),
|
||||
dbescdate($_SESSION['sse_loadtime']),
|
||||
dbesc(self::$ob_hash)
|
||||
@@ -373,7 +373,7 @@ class Sse_bs extends Controller {
|
||||
$item_normal
|
||||
$sql_extra
|
||||
$sql_extra2
|
||||
ORDER BY created DESC, received DESC LIMIT $limit OFFSET $offset",
|
||||
ORDER BY created DESC LIMIT $limit OFFSET $offset",
|
||||
intval(self::$uid),
|
||||
dbescdate($_SESSION['sse_loadtime']),
|
||||
dbesc(self::$ob_hash)
|
||||
@@ -481,7 +481,7 @@ class Sse_bs extends Controller {
|
||||
$sql_extra
|
||||
$sql_extra2
|
||||
$sql_extra3
|
||||
ORDER BY created DESC, received DESC LIMIT $limit OFFSET $offset",
|
||||
ORDER BY created DESC LIMIT $limit OFFSET $offset",
|
||||
dbescdate($_SESSION['sse_loadtime']),
|
||||
dbesc(self::$ob_hash),
|
||||
dbescdate($_SESSION['last_login_date'] ?? $_SESSION['static_loadtime'])
|
||||
@@ -602,25 +602,15 @@ class Sse_bs extends Controller {
|
||||
$i = 0;
|
||||
|
||||
for($x = 0; $x < $fcount; $x ++) {
|
||||
/*
|
||||
$p = q("SELECT oid AS parent FROM term WHERE uid = %d AND ttype = %d AND term = '%s'",
|
||||
intval(self::$uid),
|
||||
intval(TERM_FORUM),
|
||||
dbesc($forums[$x]['xchan_name'])
|
||||
);
|
||||
|
||||
$p_str = ids_to_querystr($p, 'parent');
|
||||
$p_sql = (($p_str) ? "OR parent IN ( $p_str )" : '');
|
||||
*/
|
||||
|
||||
$r = q("select count(*) as total from item
|
||||
where uid = %d and ( owner_xchan = '%s' OR author_xchan = '%s' $p_sql ) and verb != 'Announce' and item_unseen = 1 $sql_extra $item_normal",
|
||||
where uid = %d and (owner_xchan = '%s' or author_xchan = '%s') and author_xchan != '%s' and verb != 'Announce' and item_unseen = 1 $sql_extra $item_normal",
|
||||
intval(self::$uid),
|
||||
dbesc($forums[$x]['xchan_hash']),
|
||||
dbesc($forums[$x]['xchan_hash'])
|
||||
dbesc($forums[$x]['xchan_hash']),
|
||||
dbesc(self::$ob_hash)
|
||||
);
|
||||
|
||||
|
||||
if($r[0]['total']) {
|
||||
|
||||
$forums[$x]['notify_link'] = z_root() . '/network/?f=&pf=1&unseen=1&cid=' . $forums[$x]['abook_id'];
|
||||
@@ -679,7 +669,7 @@ class Sse_bs extends Controller {
|
||||
AND author_xchan != '%s'
|
||||
AND item_unseen = 1
|
||||
$item_normal
|
||||
ORDER BY created DESC, received DESC",
|
||||
ORDER BY created DESC",
|
||||
dbesc(ACTIVITY_POST),
|
||||
intval(self::$uid),
|
||||
dbesc(self::$ob_hash)
|
||||
|
||||
@@ -34,11 +34,13 @@ class Zot6Handler implements IHandler {
|
||||
|
||||
logger('notify received from ' . $hub['hubloc_url']);
|
||||
|
||||
$x = Libzot::fetch($data, $hub);
|
||||
$ret['delivery_report'] = $x;
|
||||
$x = Libzot::fetch($data);
|
||||
|
||||
if ($x) {
|
||||
$ret['delivery_report'] = $x;
|
||||
$ret['success'] = true;
|
||||
}
|
||||
|
||||
$ret['success'] = true;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
2
boot.php
2
boot.php
@@ -66,7 +66,7 @@ require_once('include/security.php');
|
||||
|
||||
|
||||
define('PLATFORM_NAME', 'hubzilla');
|
||||
define('STD_VERSION', '10.2');
|
||||
define('STD_VERSION', '10.2.3');
|
||||
define('ZOT_REVISION', '6.0');
|
||||
|
||||
define('DB_UPDATE_VERSION', 1263);
|
||||
|
||||
@@ -1008,7 +1008,7 @@ function builtin_activity_puller($item, &$conv_responses) {
|
||||
$moderate = ((intval($item['item_blocked']) === ITEM_MODERATED) ? '<a href="moderate/' . $item['id'] . '/approve" onclick="moderate_approve(' . $item['id'] . '); return false;" class="text-success pe-2" title="' . t('Approve this item') . '"><i class="bi bi-check-lg" ></i></a><a href="moderate/' . $item['id'] . '/drop" onclick="moderate_drop(' . $item['id'] . '); return false;" class="text-danger pe-2" title="' . t('Delete this item') . '"><i class="bi bi-trash" ></i></a>' : '');
|
||||
|
||||
$url = (($item['author_xchan'] && $item['author']['xchan_photo_s'])
|
||||
? '<div class="dropdown-item">' . $moderate . '<a href="' . chanlink_hash($item['author_xchan']) . '" class="text-reset">' . '<img class="menu-img-1" src="' . zid($item['author']['xchan_photo_s']) . '" alt="' . urlencode($name) . '" /> ' . $name . '</a></div>'
|
||||
? '<div class="dropdown-item">' . $moderate . '<a href="' . chanlink_hash($item['author_xchan']) . '" class="text-reset">' . '<img class="menu-img-1" src="' . $item['author']['xchan_photo_s'] . '" alt="' . urlencode($name) . '" loading="lazy" /> ' . $name . '</a></div>'
|
||||
: '<a class="dropdown-item" href="#" class="disabled">' . $name . '</a>'
|
||||
);
|
||||
|
||||
|
||||
@@ -3181,11 +3181,11 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
|
||||
$item['parent_mid'] = $item['mid'];
|
||||
$item['thr_parent'] = $item['mid'];
|
||||
$item['llink'] = z_root() . '/display/' . $item['uuid'];
|
||||
$item['target'] = [
|
||||
$item['target'] = json_encode([
|
||||
'id' => str_replace('/item/', '/conversation/', $item['mid']),
|
||||
'type' => 'Collection',
|
||||
'attributedTo' => z_root() . '/channel/' . $channel['channel_address']
|
||||
];
|
||||
]);
|
||||
$item['tgt_type'] = 'Collection';
|
||||
}
|
||||
}
|
||||
@@ -3254,7 +3254,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
|
||||
dbesc($item['parent_mid']),
|
||||
dbesc($item['thr_parent']),
|
||||
dbesc($item['llink']),
|
||||
dbesc(json_encode($item['target'])),
|
||||
dbesc($item['target']),
|
||||
dbesc($item['tgt_type']),
|
||||
intval($item_id)
|
||||
);
|
||||
@@ -3334,6 +3334,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
|
||||
$arr['uuid'] = uuid_from_url($item['mid'] . '#group_item');
|
||||
$arr['mid'] = z_root() . '/item/' . $arr['uuid'];
|
||||
$arr['parent_mid'] = $arr['mid'];
|
||||
$arr['plink'] = $arr['mid'];
|
||||
}
|
||||
|
||||
$arr['aid'] = $channel['channel_account_id'];
|
||||
@@ -5299,8 +5300,13 @@ function addToCollectionAndSync($ret) {
|
||||
$sync_items[] = encode_item($items[0], true);
|
||||
|
||||
if (!in_array($ret['item']['verb'], ['Add', 'Remove'])) {
|
||||
$activity = Activity::encode_activity($items[0]);
|
||||
|
||||
$new_obj = Activity::build_packet(Activity::encode_activity($items[0]), $channel, false);
|
||||
if (!$activity) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$new_obj = Activity::build_packet($activity, $channel, false);
|
||||
$approval = Activity::addToCollection($channel, $new_obj, $ret['item']['parent_mid'], $ret['item'], deliver: false);
|
||||
|
||||
if ($approval['success']) {
|
||||
|
||||
Reference in New Issue
Block a user