mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-23 17:55:46 -04:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ebb1f685f | ||
|
|
805a25eb62 | ||
|
|
4ca12afc9d | ||
|
|
6cfa2572a8 | ||
|
|
04ec986bf7 | ||
|
|
ee453c4acc | ||
|
|
4d3524ba9d | ||
|
|
29beea28c2 | ||
|
|
e2a289d614 | ||
|
|
59d3483a06 | ||
|
|
a99161abdf | ||
|
|
79d48dc92b |
13
CHANGELOG
13
CHANGELOG
@@ -1,3 +1,16 @@
|
||||
Hubzilla 5.4.2 (2021-03-15)
|
||||
- Fix translation plural variable
|
||||
- Fix issue with following/unfollowing a thread
|
||||
- Fix rendering of long text in xchan vcard
|
||||
- Fix local link for rss content if rewrite author is sets
|
||||
- Fix regression in mod display
|
||||
|
||||
Addons
|
||||
- Pubcrawl: fix issue with following/unfollowing a thread
|
||||
- Pubcrawl: more robust implementation of mastodon remote reply
|
||||
- Photocache: remove suffix from the cached photo URL
|
||||
|
||||
|
||||
Hubzilla 5.4.1 (2021-03-09)
|
||||
- Fix profile not found if not logged in
|
||||
- Fix summary not reset on cancel
|
||||
|
||||
@@ -331,6 +331,12 @@ class Notifier {
|
||||
return;
|
||||
}
|
||||
|
||||
// follow/unfollow is for internal use only
|
||||
if (in_array($target_item['verb'], [ACTIVITY_FOLLOW, ACTIVITY_UNFOLLOW])) {
|
||||
logger('not fowarding follow/unfollow note activity');
|
||||
return;
|
||||
}
|
||||
|
||||
if (strpos($target_item['postopts'], 'nodeliver') !== false) {
|
||||
logger('notifier: target item is undeliverable', LOGGER_DEBUG);
|
||||
return;
|
||||
|
||||
@@ -160,50 +160,6 @@ class Onepoll {
|
||||
}
|
||||
}
|
||||
|
||||
/* if ($fetch_feed) {
|
||||
|
||||
if (strpos($contact['xchan_connurl'], z_root()) === 0) {
|
||||
// local channel - save a network fetch
|
||||
$c = channelx_by_hash($contact['xchan_hash']);
|
||||
if ($c) {
|
||||
$x = [
|
||||
'success' => true,
|
||||
'body' => json_encode([
|
||||
'success' => true,
|
||||
'messages' => zot_feed($c['channel_id'], $importer['xchan_hash'], ['mindate' => $last_update])
|
||||
])
|
||||
];
|
||||
}
|
||||
}
|
||||
else {
|
||||
// remote fetch
|
||||
|
||||
$feedurl = str_replace('/poco/', '/zotfeed/', $contact['xchan_connurl']);
|
||||
$feedurl .= '?f=&mindate=' . urlencode($last_update) . '&zid=' . $importer['channel_address'] . '@' . App::get_hostname();
|
||||
$recurse = 0;
|
||||
$x = z_fetch_url($feedurl, false, $recurse, ['session' => true]);
|
||||
}
|
||||
|
||||
logger('feed_update: ' . print_r($x, true), LOGGER_DATA);
|
||||
}
|
||||
|
||||
if (($x) && ($x['success'])) {
|
||||
$total = 0;
|
||||
logger('onepoll: feed update ' . $contact['xchan_name'] . ' ' . $feedurl);
|
||||
|
||||
$j = json_decode($x['body'], true);
|
||||
if ($j['success'] && $j['messages']) {
|
||||
foreach ($j['messages'] as $message) {
|
||||
$results = process_delivery(['hash' => $contact['xchan_hash']], get_item_elements($message),
|
||||
[['hash' => $importer['xchan_hash']]], false);
|
||||
logger('onepoll: feed_update: process_delivery: ' . print_r($results, true), LOGGER_DATA);
|
||||
$total++;
|
||||
}
|
||||
logger("onepoll: $total messages processed");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// update the poco details for this connection
|
||||
$r = q("SELECT xlink_id from xlink where xlink_xchan = '%s' and xlink_updated > %s - INTERVAL %s and xlink_static = 0 limit 1",
|
||||
intval($contact['xchan_hash']),
|
||||
|
||||
@@ -376,6 +376,8 @@ class Activity {
|
||||
|
||||
$ret = [];
|
||||
|
||||
|
||||
|
||||
if ($i['verb'] === ACTIVITY_FRIEND) {
|
||||
// Hubzilla 'make-friend' activity, no direct mapping from AS1 to AS2 - make it a note
|
||||
$objtype = 'Note';
|
||||
@@ -719,7 +721,6 @@ class Activity {
|
||||
$ret = [];
|
||||
$reply = false;
|
||||
|
||||
|
||||
if ($i['verb'] === ACTIVITY_FRIEND) {
|
||||
// Hubzilla 'make-friend' activity, no direct mapping from AS1 to AS2 - make it a note
|
||||
$ret['obj'] = [];
|
||||
@@ -1122,7 +1123,7 @@ class Activity {
|
||||
|
||||
static function encode_item_object($item, $elm = 'obj') {
|
||||
$ret = [];
|
||||
|
||||
|
||||
if ($item[$elm]) {
|
||||
if (! is_array($item[$elm])) {
|
||||
$item[$elm] = json_decode($item[$elm],true);
|
||||
@@ -1164,6 +1165,7 @@ class Activity {
|
||||
'http://activitystrea.ms/schema/1.0/tag' => 'Add',
|
||||
'http://activitystrea.ms/schema/1.0/follow' => 'Follow',
|
||||
'http://activitystrea.ms/schema/1.0/unfollow' => 'Unfollow',
|
||||
'http://activitystrea.ms/schema/1.0/stop-following' => 'Unfollow',
|
||||
'http://purl.org/zot/activity/attendyes' => 'Accept',
|
||||
'http://purl.org/zot/activity/attendno' => 'Reject',
|
||||
'http://purl.org/zot/activity/attendmaybe' => 'TentativeAccept',
|
||||
@@ -1211,6 +1213,7 @@ class Activity {
|
||||
'http://activitystrea.ms/schema/1.0/tag' => 'Add',
|
||||
'http://activitystrea.ms/schema/1.0/follow' => 'Follow',
|
||||
'http://activitystrea.ms/schema/1.0/unfollow' => 'Unfollow',
|
||||
'http://activitystrea.ms/schema/1.0/stop-following' => 'Unfollow',
|
||||
'http://purl.org/zot/activity/attendyes' => 'Accept',
|
||||
'http://purl.org/zot/activity/attendno' => 'Reject',
|
||||
'http://purl.org/zot/activity/attendmaybe' => 'TentativeAccept',
|
||||
@@ -2093,6 +2096,15 @@ class Activity {
|
||||
|
||||
static function decode_note($act) {
|
||||
|
||||
// Within our family of projects, Follow/Unfollow of a thread is an internal activity which should not be transmitted,
|
||||
// hence if we receive it - ignore or reject it.
|
||||
// Unfollow is not defined by ActivityStreams, which prefers Undo->Follow.
|
||||
// This may have to be revisited if AP projects start using Follow for objects other than actors.
|
||||
|
||||
if (in_array($act->type, [ 'Follow', 'Unfollow' ])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$response_activity = false;
|
||||
|
||||
$s = [];
|
||||
@@ -2290,13 +2302,16 @@ class Activity {
|
||||
$s['iconfig'] = $a;
|
||||
}
|
||||
|
||||
if ($act->obj['type'] === 'Note' && $s['attach']) {
|
||||
$s['body'] .= self::bb_attach($s['attach'], $s['body']);
|
||||
}
|
||||
if (array_key_exists('type', $act->obj)) {
|
||||
|
||||
if ($act->obj['type'] === 'Question' && in_array($act->type, ['Create', 'Update'])) {
|
||||
if ($act->obj['endTime']) {
|
||||
$s['comments_closed'] = datetime_convert('UTC', 'UTC', $act->obj['endTime']);
|
||||
if ($act->obj['type'] === 'Note' && $s['attach']) {
|
||||
$s['body'] .= self::bb_attach($s['attach'], $s['body']);
|
||||
}
|
||||
|
||||
if ($act->obj['type'] === 'Question' && in_array($act->type, ['Create', 'Update'])) {
|
||||
if (array_key_exists('endTime', $act->obj)) {
|
||||
$s['comments_closed'] = datetime_convert('UTC', 'UTC', $act->obj['endTime']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,12 @@ class Activity extends Controller {
|
||||
|
||||
$portable_id = EMPTY_STR;
|
||||
|
||||
$item_normal = " and item.item_hidden = 0 and item.item_type = 0 and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_blocked = 0 ";
|
||||
$item_normal_extra = sprintf(" and not verb in ('%s', '%s') ",
|
||||
dbesc(ACTIVITY_FOLLOW),
|
||||
dbesc(ACTIVITY_UNFOLLOW)
|
||||
);
|
||||
|
||||
$item_normal = " and item.item_hidden = 0 and item.item_type = 0 and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_blocked = 0 $item_normal_extra ";
|
||||
|
||||
$i = null;
|
||||
|
||||
@@ -86,7 +91,7 @@ class Activity extends Controller {
|
||||
}
|
||||
|
||||
$parents_str = ids_to_querystr($i,'item_id');
|
||||
|
||||
|
||||
$items = q("SELECT item.*, item.id AS item_id FROM item WHERE item.parent IN ( %s ) $item_normal ",
|
||||
dbesc($parents_str)
|
||||
);
|
||||
@@ -197,8 +202,12 @@ class Activity extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$item_normal = " and item.item_hidden = 0 and item.item_type = 0 and item.item_unpublished = 0
|
||||
and item.item_delayed = 0 and item.item_blocked = 0 ";
|
||||
$item_normal_extra = sprintf(" and not verb in ('%s', '%s') ",
|
||||
dbesc(ACTIVITY_FOLLOW),
|
||||
dbesc(ACTIVITY_UNFOLLOW)
|
||||
);
|
||||
|
||||
$item_normal = " and item.item_hidden = 0 and item.item_type = 0 and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_blocked = 0 $item_normal_extra ";
|
||||
|
||||
$sigdata = HTTPSig::verify(EMPTY_STR);
|
||||
if ($sigdata['portable_id'] && $sigdata['header_valid']) {
|
||||
|
||||
@@ -243,7 +243,7 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
$item_normal = item_normal();
|
||||
$item_normal_update = item_normal_update();
|
||||
|
||||
$sql_extra = public_permissions_sql($observer_hash);
|
||||
$sql_extra = ((local_channel()) ? EMPTY_STR : item_permissions_sql(0, $observer_hash));
|
||||
|
||||
if($noscript_content || $load) {
|
||||
|
||||
@@ -260,8 +260,7 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
);
|
||||
}
|
||||
|
||||
if(! $r) {
|
||||
|
||||
if($r === null) {
|
||||
// in case somebody turned off public access to sys channel content using permissions
|
||||
// make that content unsearchable by ensuring the owner uid can't match
|
||||
|
||||
@@ -269,20 +268,18 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
$sysid = 0;
|
||||
|
||||
$r = q("SELECT item.id as item_id from item
|
||||
WHERE ( (mid = '%s'
|
||||
WHERE ((mid = '%s'
|
||||
AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = ''
|
||||
AND item.deny_gid = '' AND item_private = 0 )
|
||||
and uid in ( " . stream_perms_api_uids(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
|
||||
OR uid = %d ) ) ) OR
|
||||
(mid = '%s' $sql_extra ) )
|
||||
OR uid = %d ))) OR
|
||||
(mid = '%s' $sql_extra ))
|
||||
$item_normal
|
||||
limit 1",
|
||||
dbesc($target_item['parent_mid']),
|
||||
intval($sysid),
|
||||
dbesc($target_item['parent_mid'])
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,20 +303,22 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
if($r === null) {
|
||||
// in case somebody turned off public access to sys channel content using permissions
|
||||
// make that content unsearchable by ensuring the owner_xchan can't match
|
||||
|
||||
if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
|
||||
$sysid = 0;
|
||||
$r = q("SELECT item.parent AS item_id from item
|
||||
WHERE parent_mid = '%s'
|
||||
|
||||
$r = q("SELECT item.id as item_id from item
|
||||
WHERE ((parent_mid = '%s'
|
||||
AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = ''
|
||||
AND item.deny_gid = '' AND item_private = 0 )
|
||||
and uid in ( " . stream_perms_api_uids(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
|
||||
OR uid = %d )
|
||||
$sql_extra )
|
||||
$item_normal_update
|
||||
$simple_update
|
||||
OR uid = %d ))) OR
|
||||
(parent_mid = '%s' $sql_extra ))
|
||||
$item_normal
|
||||
limit 1",
|
||||
dbesc($target_item['parent_mid']),
|
||||
intval($sysid)
|
||||
intval($sysid),
|
||||
dbesc($target_item['parent_mid'])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,12 @@ class Item extends Controller {
|
||||
|
||||
$portable_id = EMPTY_STR;
|
||||
|
||||
$item_normal = " and item.item_hidden = 0 and item.item_type = 0 and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_blocked = 0 ";
|
||||
$item_normal_extra = sprintf(" and not verb in ('%s', '%s') ",
|
||||
dbesc(ACTIVITY_FOLLOW),
|
||||
dbesc(ACTIVITY_UNFOLLOW)
|
||||
);
|
||||
|
||||
$item_normal = " and item.item_hidden = 0 and item.item_type = 0 and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_blocked = 0 $item_normal_extra ";
|
||||
|
||||
$i = null;
|
||||
|
||||
@@ -167,7 +172,12 @@ class Item extends Controller {
|
||||
|
||||
$portable_id = EMPTY_STR;
|
||||
|
||||
$item_normal = " and item.item_hidden = 0 and item.item_type = 0 and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_blocked = 0 ";
|
||||
$item_normal_extra = sprintf(" and not verb in ('%s', '%s') ",
|
||||
dbesc(ACTIVITY_FOLLOW),
|
||||
dbesc(ACTIVITY_UNFOLLOW)
|
||||
);
|
||||
|
||||
$item_normal = " and item.item_hidden = 0 and item.item_type = 0 and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_blocked = 0 $item_normal_extra ";
|
||||
|
||||
$i = null;
|
||||
|
||||
@@ -821,12 +831,10 @@ class Item extends Controller {
|
||||
// and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.)
|
||||
// we may need virtual or template classes to implement the possible alternatives
|
||||
|
||||
$summary = cleanup_bbcode($summary);
|
||||
$body = cleanup_bbcode($body);
|
||||
|
||||
// Look for tags and linkify them
|
||||
|
||||
$results = linkify_tags($summary, ($uid) ? $uid : $profile_uid);
|
||||
$results = linkify_tags($body, ($uid) ? $uid : $profile_uid);
|
||||
|
||||
if($results) {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Activity;
|
||||
|
||||
|
||||
require_once('include/security.php');
|
||||
require_once('include/bbcode.php');
|
||||
require_once('include/items.php');
|
||||
@@ -10,22 +13,22 @@ require_once('include/items.php');
|
||||
class Subthread extends \Zotlabs\Web\Controller {
|
||||
|
||||
function get() {
|
||||
|
||||
|
||||
if(! local_channel()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$sys = get_sys_channel();
|
||||
$channel = \App::get_channel();
|
||||
|
||||
$item_id = ((argc() > 2) ? notags(trim(argv(2))) : 0);
|
||||
|
||||
|
||||
if(argv(1) === 'sub')
|
||||
$activity = ACTIVITY_FOLLOW;
|
||||
elseif(argv(1) === 'unsub')
|
||||
$activity = ACTIVITY_UNFOLLOW;
|
||||
|
||||
|
||||
|
||||
|
||||
$i = q("select * from item where id = %d and uid = %d",
|
||||
intval($item_id),
|
||||
intval(local_channel())
|
||||
@@ -42,7 +45,7 @@ class Subthread extends \Zotlabs\Web\Controller {
|
||||
$item_id = (($i) ? $i[0]['id'] : 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(! $i) {
|
||||
return;
|
||||
}
|
||||
@@ -56,37 +59,37 @@ class Subthread extends \Zotlabs\Web\Controller {
|
||||
dbesc($r[0]['parent'])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if((! $item_id) || (! $r)) {
|
||||
logger('subthread: no item ' . $item_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$item = $r[0];
|
||||
|
||||
|
||||
$owner_uid = $item['uid'];
|
||||
$observer = \App::get_observer();
|
||||
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
|
||||
|
||||
|
||||
if(! perm_is_allowed($owner_uid,$ob_hash,'post_comments'))
|
||||
return;
|
||||
|
||||
|
||||
$sys = get_sys_channel();
|
||||
|
||||
|
||||
$owner_uid = $item['uid'];
|
||||
$owner_aid = $item['aid'];
|
||||
|
||||
|
||||
// if this is a "discover" item, (item['uid'] is the sys channel),
|
||||
// fallback to the item comment policy, which should've been
|
||||
// respected when generating the conversation thread.
|
||||
// Even if the activity is rejected by the item owner, it should still get attached
|
||||
// to the local discover conversation on this site.
|
||||
|
||||
// to the local discover conversation on this site.
|
||||
|
||||
if(($owner_uid != $sys['channel_id']) && (! perm_is_allowed($owner_uid,$observer['xchan_hash'],'post_comments'))) {
|
||||
notice( t('Permission denied') . EOL);
|
||||
killme();
|
||||
}
|
||||
|
||||
|
||||
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
|
||||
dbesc($item['owner_xchan'])
|
||||
);
|
||||
@@ -94,7 +97,7 @@ class Subthread extends \Zotlabs\Web\Controller {
|
||||
$thread_owner = $r[0];
|
||||
else
|
||||
killme();
|
||||
|
||||
|
||||
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
|
||||
dbesc($item['author_xchan'])
|
||||
);
|
||||
@@ -102,50 +105,32 @@ class Subthread extends \Zotlabs\Web\Controller {
|
||||
$item_author = $r[0];
|
||||
else
|
||||
killme();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$uuid = item_message_id();
|
||||
$mid = z_root() . '/item/' . $uuid;
|
||||
|
||||
$post_type = (($item['resource_type'] === 'photo') ? t('photo') : t('status'));
|
||||
|
||||
|
||||
$links = array(array('rel' => 'alternate','type' => 'text/html', 'href' => $item['plink']));
|
||||
$objtype = (($item['resource_type'] === 'photo') ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE );
|
||||
|
||||
$objtype = (($item['resource_type'] === 'photo') ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE );
|
||||
|
||||
$body = $item['body'];
|
||||
|
||||
$obj = json_encode(array(
|
||||
'type' => $objtype,
|
||||
'id' => $item['mid'],
|
||||
'parent' => (($item['thr_parent']) ? $item['thr_parent'] : $item['parent_mid']),
|
||||
'link' => $links,
|
||||
'title' => $item['title'],
|
||||
'content' => $item['body'],
|
||||
'created' => $item['created'],
|
||||
'edited' => $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'])),
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
$obj = Activity::fetch_item( [ 'id' => $item['mid'] ] );
|
||||
|
||||
if(! intval($item['item_thread_top']))
|
||||
$post_type = 'comment';
|
||||
|
||||
$post_type = 'comment';
|
||||
|
||||
if($activity === ACTIVITY_FOLLOW)
|
||||
$bodyverb = t('%1$s is following %2$s\'s %3$s');
|
||||
if($activity === ACTIVITY_UNFOLLOW)
|
||||
$bodyverb = t('%1$s stopped following %2$s\'s %3$s');
|
||||
|
||||
|
||||
$arr = array();
|
||||
|
||||
|
||||
$arr['uuid'] = $uuid;
|
||||
$arr['mid'] = $mid;
|
||||
$arr['aid'] = $owner_aid;
|
||||
@@ -161,35 +146,35 @@ class Subthread extends \Zotlabs\Web\Controller {
|
||||
$arr['item_wall'] = 1;
|
||||
else
|
||||
$arr['item_wall'] = 0;
|
||||
|
||||
|
||||
$ulink = '[zrl=' . $item_author['xchan_url'] . ']' . $item_author['xchan_name'] . '[/zrl]';
|
||||
$alink = '[zrl=' . $observer['xchan_url'] . ']' . $observer['xchan_name'] . '[/zrl]';
|
||||
$plink = '[zrl=' . z_root() . '/display/' . gen_link_id($item['mid']) . ']' . $post_type . '[/zrl]';
|
||||
|
||||
|
||||
$arr['body'] = sprintf( $bodyverb, $alink, $ulink, $plink );
|
||||
|
||||
|
||||
$arr['verb'] = $activity;
|
||||
$arr['obj_type'] = $objtype;
|
||||
$arr['obj'] = $obj;
|
||||
|
||||
$arr['obj'] = json_encode($obj);
|
||||
|
||||
$arr['allow_cid'] = $item['allow_cid'];
|
||||
$arr['allow_gid'] = $item['allow_gid'];
|
||||
$arr['deny_cid'] = $item['deny_cid'];
|
||||
$arr['deny_gid'] = $item['deny_gid'];
|
||||
|
||||
$post = item_store($arr);
|
||||
|
||||
$post = item_store($arr);
|
||||
$post_id = $post['item_id'];
|
||||
|
||||
|
||||
$arr['id'] = $post_id;
|
||||
|
||||
|
||||
call_hooks('post_local_end', $arr);
|
||||
|
||||
|
||||
killme();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ class Zotfeed extends Controller {
|
||||
killme();
|
||||
}
|
||||
|
||||
$channel = ((argv(1)) ? channelx_by_nick(argv(1)) : get_sys_channel());
|
||||
$channel = channelx_by_nick(argv(1));
|
||||
if (!$channel) {
|
||||
killme();
|
||||
}
|
||||
@@ -120,45 +120,5 @@ class Zotfeed extends Controller {
|
||||
|
||||
as_return_and_die($ret, $channel);
|
||||
}
|
||||
|
||||
/*
|
||||
$result = array('success' => false);
|
||||
|
||||
$mindate = (($_REQUEST['mindate']) ? datetime_convert('UTC','UTC',$_REQUEST['mindate']) : '');
|
||||
if(! $mindate)
|
||||
$mindate = datetime_convert('UTC','UTC', 'now - 14 days');
|
||||
|
||||
if(observer_prohibited()) {
|
||||
$result['message'] = 'Public access denied';
|
||||
json_return_and_die($result);
|
||||
}
|
||||
|
||||
$observer = App::get_observer();
|
||||
|
||||
logger('observer: ' . get_observer_hash(), LOGGER_DEBUG);
|
||||
|
||||
$channel_address = ((argc() > 1) ? argv(1) : '');
|
||||
if($channel_address) {
|
||||
$r = q("select channel_id, channel_name from channel where channel_address = '%s' and channel_removed = 0 limit 1",
|
||||
dbesc(argv(1))
|
||||
);
|
||||
}
|
||||
else {
|
||||
$x = get_sys_channel();
|
||||
if($x)
|
||||
$r = array($x);
|
||||
$mindate = datetime_convert('UTC','UTC', 'now - 14 days');
|
||||
}
|
||||
if(! $r) {
|
||||
$result['message'] = 'Channel not found.';
|
||||
json_return_and_die($result);
|
||||
}
|
||||
|
||||
logger('zotfeed request: ' . $r[0]['channel_name'], LOGGER_DEBUG);
|
||||
$result['project'] = 'Hubzilla';
|
||||
$result['messages'] = zot_feed($r[0]['channel_id'],$observer['xchan_hash'],array('mindate' => $mindate));
|
||||
$result['success'] = true;
|
||||
json_return_and_die($result);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
2
boot.php
2
boot.php
@@ -52,7 +52,7 @@ require_once('include/attach.php');
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
define ( 'PLATFORM_NAME', 'hubzilla' );
|
||||
define ( 'STD_VERSION', '5.4.1' );
|
||||
define ( 'STD_VERSION', '5.4.2' );
|
||||
define ( 'ZOT_REVISION', '6.0' );
|
||||
|
||||
define ( 'DB_UPDATE_VERSION', 1243 );
|
||||
|
||||
@@ -151,6 +151,18 @@ function bb_spacefy($st) {
|
||||
return $new_str;
|
||||
}
|
||||
|
||||
// The previously spacefied [noparse][ i ]italic[ /i ][/noparse],
|
||||
// now turns back returning [noparse][i]italic[/i][/noparse]
|
||||
function bb_unspacefy($st) {
|
||||
$whole_match = $st[0];
|
||||
$captured = $st[1];
|
||||
$spacefied = preg_replace("/\[ (.*?) \]/", "[$1]", $captured);
|
||||
$new_str = str_replace($captured, $spacefied, $whole_match);
|
||||
|
||||
return $new_str;
|
||||
}
|
||||
|
||||
|
||||
// The previously spacefied [noparse][ i ]italic[ /i ][/noparse],
|
||||
// now turns back and the [noparse] tags are trimmed
|
||||
// returning [i]italic[/i]
|
||||
@@ -1097,6 +1109,9 @@ function bbcode($Text, $options = []) {
|
||||
if (strpos($Text,'[pre]') !== false) {
|
||||
$Text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", 'bb_spacefy',$Text);
|
||||
}
|
||||
if (strpos($Text,'[summary]') !== false) {
|
||||
$Text = preg_replace_callback("/\[summary\](.*?)\[\/summary\]/ism", 'bb_spacefy',$Text);
|
||||
}
|
||||
|
||||
$Text = bb_format_attachdata($Text);
|
||||
|
||||
@@ -1438,11 +1453,6 @@ function bbcode($Text, $options = []) {
|
||||
$Text = preg_replace("/\[font=(.*?)\](.*?)\[\/font\]/sm", "<span style=\"font-family: $1;\">$2</span>", $Text);
|
||||
}
|
||||
|
||||
|
||||
if(strpos($Text,'[/summary]') !== false) {
|
||||
$Text = preg_replace_callback("/^(.*?)\[summary\](.*?)\[\/summary\](.*?)$/is", 'bb_summary', $Text);
|
||||
}
|
||||
|
||||
// Check for [spoiler] text
|
||||
$endlessloop = 0;
|
||||
while ((strpos($Text, "[/spoiler]")!== false) and (strpos($Text, "[spoiler]") !== false) and (++$endlessloop < 20)) {
|
||||
@@ -1611,6 +1621,13 @@ function bbcode($Text, $options = []) {
|
||||
|
||||
}
|
||||
|
||||
if (strpos($Text,'[summary]') !== false) {
|
||||
$Text = preg_replace_callback("/\[summary\](.*?)\[\/summary\]/ism", 'bb_unspacefy',$Text);
|
||||
}
|
||||
if(strpos($Text,'[/summary]') !== false) {
|
||||
$Text = preg_replace_callback("/^(.*?)\[summary\](.*?)\[\/summary\](.*?)$/is", 'bb_summary', $Text);
|
||||
}
|
||||
|
||||
// Unhide all [noparse] contained bbtags unspacefying them
|
||||
// and triming the [noparse] tag.
|
||||
if (strpos($Text,'[noparse]') !== false) {
|
||||
|
||||
@@ -3253,13 +3253,15 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
|
||||
$item['mid'] = z_root() . '/item/' . $item['uuid'];
|
||||
$item['parent_mid'] = $item['mid'];
|
||||
$item['thr_parent'] = $item['mid'];
|
||||
$item['llink'] = z_root() . '/display/' . gen_link_id($item['mid']);
|
||||
}
|
||||
|
||||
$r = q("UPDATE item SET author_xchan = '%s', mid = '%s', parent_mid = '%s', thr_parent = '%s' WHERE id = %d",
|
||||
$r = q("UPDATE item SET author_xchan = '%s', mid = '%s', parent_mid = '%s', thr_parent = '%s', llink = '%s' WHERE id = %d",
|
||||
dbesc($item['author_xchan']),
|
||||
dbesc($item['mid']),
|
||||
dbesc($item['parent_mid']),
|
||||
dbesc($item['thr_parent']),
|
||||
dbesc($item['llink']),
|
||||
intval($item_id)
|
||||
);
|
||||
}
|
||||
@@ -4508,6 +4510,13 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
|
||||
$item_uids = " item.uid = " . intval($uid) . " ";
|
||||
}
|
||||
|
||||
if (! (isset($arr['include_follow']) && intval($arr['include_follow']))) {
|
||||
$sql_options .= sprintf(" and not verb in ('%s', '%s') ",
|
||||
dbesc(ACTIVITY_FOLLOW),
|
||||
dbesc(ACTIVITY_UNFOLLOW)
|
||||
);
|
||||
}
|
||||
|
||||
if($arr['star'])
|
||||
$sql_options .= " and item_starred = 1 ";
|
||||
|
||||
@@ -4575,7 +4584,7 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
|
||||
}
|
||||
|
||||
if($channel && intval($arr['compat']) === 1) {
|
||||
$sql_extra = " AND author_xchan = '" . $channel['channel_hash'] . "' and item_private = 0 $item_normal ";
|
||||
$sql_extra = " AND author_xchan = '" . $channel['channel_hash'] . "' and item_private = 0 $sql_options $item_normal ";
|
||||
}
|
||||
|
||||
if ($arr['datequery']) {
|
||||
@@ -4680,7 +4689,6 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
|
||||
);
|
||||
|
||||
require_once('include/items.php');
|
||||
|
||||
xchan_query($items);
|
||||
|
||||
$items = fetch_post_tags($items,true);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if(! function_exists("string_plural_select_es_es")) {
|
||||
function string_plural_select_es_es($n){
|
||||
return (n != 1 ? 1 : 0);
|
||||
return ($n != 1 ? 1 : 0);
|
||||
}}
|
||||
App::$rtl = 0;
|
||||
App::$strings["plural_function_code"] = "(n != 1 ? 1 : 0)";
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
<img class="u-photo" src="{{$photo}}" alt="{{$name}}" width="80px" height="80px">
|
||||
</a>
|
||||
</div>
|
||||
<div class="col m-1">
|
||||
<div class="col-7 m-1">
|
||||
<div class="row">
|
||||
<strong class="fn p-name">{{$name}}</strong>
|
||||
<strong class="fn p-name text-truncate">{{$name}}</strong>
|
||||
</div>
|
||||
<div class="row">
|
||||
<small class="text-muted p-adr">{{$addr}}</small>
|
||||
<small class="text-muted p-adr text-truncate">{{$addr}}</small>
|
||||
</div>
|
||||
{{if $connect}}
|
||||
<div class="row mt-2">
|
||||
|
||||
Reference in New Issue
Block a user