Commit 2dd47a9f authored by Mario's avatar Mario
Browse files

Merge branch '6.0RC'

parents 6de32740 a92ad512
......@@ -33,8 +33,10 @@ apps/
home.html
# page header plugin
pageheader.html
# Ignore site TOS
# Ignore site TOS & gddpr
doc/SiteTOS.md
doc/*/SiteTOS.md
doc/*/gdpr.md
# themes except for redbasic
view/theme/*
!view/theme/redbasic
......@@ -55,6 +57,7 @@ tests/results/
.buildpath
.externalToolBuilders
.settings/
.pydevproject
# NetBeans project folder
nbproject/
# Kdevelop project files
......@@ -75,3 +78,5 @@ composer.phar
vendor/**/tests/
vendor/**/Test/
vendor/sabre/*/examples/
# /info is a directory containing site-specific HTML documents
/info/
Hubzilla 6.0 (2021-07-xx)
- Implement swipe to right for bringing in left aside
- DB update 1247 to clean up bogus entries in updates
- DB update 1246 to mark legacy zot xchans and hublocs deleted
- Implement desktop notifications
- Emit a warning if the calendar for the created event is disabled
- Add an option to drop media for bbcode processing
- Make mod HQ the default landing page after login
- Implement direct messages view for mod HQ
- Implement public/restricted messages view for mod HQ
- Implement starred messages view for mod HQ (only available if the Star Posts feature is enabled)
- Update composer libs
- Remove deprecated mod ping
- Remove legacy zot libs and functions - major cleanup
Bugfixes
- Fix deleting and starring in unthreaded view
- Fix issue where incomplete datasets were stored into updates
- Fix photo item tags not stored and propagated
- Fix notifications not loading if a filter was applied
- Fix in browser email validation for registrations
- Fix directory sync issues
- Fix issue where the original rawmsg iconfig got overwritten
- Fix unmaintained id3 pareser for PHP8
- Fix item_private state for imported items
- Random PHP8 fixes (ongoing)
Addons
- Pubcrawl: fix ld-signature for profile updates
- Pubcrawl: deprecate as_actor_store() in favor of Activity::actor_store()
- Twitter: prevent duplicated tweets
- Remove legacy zot dpendencies and deprecated functions
- Pubcrawl: fix remote reply for peertube
- Pubcrawl: fix issue where we could end up with an xchan but without hubloc
- Diaspora: implement the direct_message_recipients hook
- Queueworker: add a simple priority mechanism to prevent not so important janitor tasks (e.g. onedirsync) stuffing up the queue and delaying delivery of items
- Pubcrawl: implement direct message recognision for activities coming from Mastodon
- Pubcrawl: always show complete threads (complete as in all the messages we have received) in public stream
- Twitter_api: remove the mail endpoint
- Mail: make interface read only with the possibility to download and delete mails (this addon will be removed in a future version)
- Pubsubhubbub: move to addons-unmaintained
- GNU-Social: move to addons-unmaintained
- Fixes to reflect core notifier changes
- Diaspora: refactor conversations a.k.a mail to implement direct messages infrastructure
- Pubcrawl: allow hublocs to be upgraded from ostatus
- Diaspora: fix issue where we could end up with an xchan but without hubloc
Hubzilla 5.6.1 (2021-06-04)
- Update spanish translations
- Fix login name label if register email verification is disabled
......
......@@ -5,15 +5,15 @@
|blueimp/jquery-file-upload|10.31.0.0|MIT|https://github.com/vkhramtsov/jQuery-File-Upload.git|
|brick/math|0.9.2.0|MIT|https://github.com/brick/math.git|
|bshaffer/oauth2-server-php|1.11.1.0|MIT|https://github.com/bshaffer/oauth2-server-php.git|
|commerceguys/intl|1.0.7.0|MIT|https://github.com/commerceguys/intl.git|
|commerceguys/intl|1.1.0.0|MIT|https://github.com/commerceguys/intl.git|
|desandro/imagesloaded|4.1.4.0|MIT|https://github.com/desandro/imagesloaded.git|
|ezyang/htmlpurifier|4.13.0.0|LGPL-2.1-or-later|https://github.com/ezyang/htmlpurifier.git|
|league/html-to-markdown|4.10.0.0|MIT|https://github.com/thephpleague/html-to-markdown.git|
|league/html-to-markdown|5.0.0.0|MIT|https://github.com/thephpleague/html-to-markdown.git|
|lukasreschke/id3parser|0.0.3.0|GPL|https://github.com/LukasReschke/ID3Parser.git|
|michelf/php-markdown|1.9.0.0|BSD-3-Clause|https://github.com/michelf/php-markdown.git|
|pear/text_languagedetect|1.0.1.0|BSD-2-Clause|https://github.com/pear/Text_LanguageDetect.git|
|phpseclib/phpseclib|2.0.30.0|MIT|https://github.com/phpseclib/phpseclib.git|
|psr/log|1.1.3.0|MIT|https://github.com/php-fig/log.git|
|psr/log|1.1.4.0|MIT|https://github.com/php-fig/log.git|
|ramsey/collection|1.1.3.0|MIT|https://github.com/ramsey/collection.git|
|ramsey/uuid|4.1.1.0|MIT|https://github.com/ramsey/uuid.git|
|sabre/dav|4.1.5.0|BSD-3-Clause|https://github.com/sabre-io/dav.git|
......@@ -23,8 +23,8 @@
|sabre/vobject|4.3.5.0|BSD-3-Clause|https://github.com/sabre-io/vobject.git|
|sabre/xml|2.2.3.0|BSD-3-Clause|https://github.com/sabre-io/xml.git|
|simplepie/simplepie|1.5.6.0|BSD-3-Clause|https://github.com/simplepie/simplepie.git|
|smarty/smarty|3.1.38.0|LGPL-3.0|https://github.com/smarty-php/smarty.git|
|symfony/polyfill-ctype|1.22.0.0|MIT|https://github.com/symfony/polyfill-ctype.git|
|smarty/smarty|3.1.39.0|LGPL-3.0|https://github.com/smarty-php/smarty.git|
|symfony/polyfill-ctype|1.23.0.0|MIT|https://github.com/symfony/polyfill-ctype.git|
|twbs/bootstrap|4.6.0.0|MIT|https://github.com/twbs/bootstrap.git|
|fullcalendar/fullcalendar|4.4.2.0|MIT|https://github.com/fullcalendar/fullcalendar.git|
|miromannino/Justified-Gallery|3.8.1.0|MIT|https://github.com/miromannino/Justified-Gallery.git|
......
......@@ -165,11 +165,6 @@ class Cron {
}
}
// check if any connections transitioned to zot6 and upgrade the connections to zot6 at this hub if so.
require_once('include/connections.php');
z6trans_connections();
require_once('include/attach.php');
attach_upgrade();
......
......@@ -95,8 +95,6 @@ class Cron_daily {
remove_obsolete_hublocs();
remove_duplicate_singleton_hublocs();
z6_discover();
$date = datetime_convert();
call_hooks('cron_daily', $date);
......
......@@ -2,7 +2,7 @@
namespace Zotlabs\Daemon;
require_once('include/queue_fn.php');
use Zotlabs\Lib\Queue;
class Deliver {
......@@ -23,7 +23,7 @@ class Deliver {
);
if ($r) {
queue_deliver($r[0], true);
Queue::deliver($r[0], true);
}
}
......
......@@ -74,7 +74,7 @@ class Directory {
* the directory packet. That means we'll try again on the next poll run.
*/
$hash = random_string();
$hash = new_uuid();
Queue::insert(array(
'hash' => $hash,
......
......@@ -2,6 +2,7 @@
namespace Zotlabs\Daemon;
require_once('include/items.php');
class Expire {
......
This diff is collapsed.
......@@ -5,10 +5,6 @@ namespace Zotlabs\Daemon;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Libzotdir;
require_once('include/zot.php');
require_once('include/dir_fns.php');
class Onedirsync {
static public function run($argc, $argv) {
......@@ -55,14 +51,14 @@ class Onedirsync {
// ignore doing an update if this ud_addr refers to a known dead hubloc
$h = q("select * from hubloc where hubloc_addr = '%s'",
dbesc($r[0]['ud_addr'])
dbesc($r[0]['ud_addr']),
);
$h = Libzot::zot_record_preferred($h);
if (($h) && (($h['hubloc_status'] & HUBLOC_OFFLINE) || $h['hubloc_deleted'] || $h['hubloc_error']) ) {
if (($h) && (($h['hubloc_status'] & HUBLOC_OFFLINE) || $h['hubloc_deleted'] || $h['hubloc_error'])) {
q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and ( ud_flags & %d ) = 0 ",
intval(UPDATE_FLAGS_UPDATED),
intval(UPDATE_FLAGS_DELETED),
dbesc($r[0]['ud_addr']),
intval(UPDATE_FLAGS_UPDATED)
);
......@@ -72,7 +68,7 @@ class Onedirsync {
// we might have to pull this out some day, but for now update_directory_entry()
// runs zot_finger() and is kind of zot specific
if ($h && !in_array($h['hubloc_network'], ['zot6', 'zot']))
if ($h && $h['hubloc_network'] !== 'zot6')
return;
Libzotdir::update_directory_entry($r[0]);
......
......@@ -8,6 +8,7 @@ use Zotlabs\Lib\ASCollection;
use Zotlabs\Lib\Libzot;
require_once('include/socgraph.php');
require_once('include/feedutils.php');
class Onepoll {
......@@ -44,7 +45,7 @@ class Onepoll {
return;
}
$contact = array_shift($contacts);
$contact = $contacts[0];
$importer_uid = $contact['abook_channel'];
$r = q("SELECT * from channel left join xchan on channel_hash = xchan_hash where channel_id = %d limit 1",
......@@ -75,16 +76,12 @@ class Onepoll {
return;
}
if (!in_array($contact['xchan_network'], ['zot', 'zot6']))
if ($contact['xchan_network'] !== 'zot6')
return;
// update permissions
if ($contact['xchan_network'] === 'zot6')
$x = Libzot::refresh($contact, $importer);
if ($contact['xchan_network'] === 'zot')
$x = zot_refresh($contact, $importer);
$x = Libzot::refresh($contact, $importer);
$responded = false;
$updated = datetime_convert();
......@@ -109,31 +106,30 @@ class Onepoll {
return;
$fetch_feed = true;
$x = null;
// They haven't given us permission to see their stream
$can_view_stream = intval(get_abconfig($importer_uid, $contact['abook_xchan'], 'their_perms', 'view_stream'));
if (!$can_view_stream)
if (!$can_view_stream) {
$fetch_feed = false;
}
// we haven't given them permission to send us their stream
$can_send_stream = intval(get_abconfig($importer_uid, $contact['abook_xchan'], 'my_perms', 'send_stream'));
if (!$can_send_stream)
if (!$can_send_stream) {
$fetch_feed = false;
}
if ($fetch_feed && $contact['xchan_network'] !== 'zot') {
if ($fetch_feed) {
$max = intval(get_config('system', 'max_imported_posts', 30));
if (intval($max)) {
$cl = get_xconfig($contact['abook_xchan'], 'activitypub', 'collections');
if (is_array($cl) && $cl) {
$url = ((array_key_exists('outbox', $cl)) ? $cl['outbox'] : '');
if (is_array($cl) && array_key_exists('outbox', $cl)) {
$url = $cl['outbox'];
}
else {
$url = str_replace('/poco/', '/zotfeed/', $contact['xchan_connurl']);
......@@ -163,8 +159,10 @@ class Onepoll {
// 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']),
db_utcnow(), db_quoteinterval('1 DAY')
db_utcnow(),
db_quoteinterval('1 DAY')
);
if (!$r) {
poco_load($contact['xchan_hash'], $contact['xchan_connurl']);
}
......
......@@ -69,11 +69,11 @@ class Poller {
abook.abook_channel, abook.abook_id, abook.abook_archived, abook.abook_pending,
abook.abook_ignored, abook.abook_blocked,
xchan.xchan_network,
account.account_lastlog, account.account_flags
FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash
account.account_lastlog, account.account_flags
FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash
LEFT JOIN account on abook_account = account_id
where abook_self = 0
$sql_extra
$sql_extra
AND (( account_flags = %d ) OR ( account_flags = %d )) $abandon_sql ORDER BY $randfunc",
intval(ACCOUNT_OK),
intval(ACCOUNT_UNVERIFIED) // FIXME
......@@ -102,8 +102,7 @@ class Poller {
continue;
}
if (!in_array($contact['xchan_network'], ['zot', 'zot6']))
if ($contact['xchan_network'] !== 'zot6')
continue;
if ($c == $t) {
......@@ -191,7 +190,7 @@ class Poller {
set_config('system', 'lastpoll', datetime_convert());
//All done - clear the lockfile
//All done - clear the lockfile
@unlink($lockfile);
......
......@@ -2,8 +2,7 @@
namespace Zotlabs\Daemon;
require_once('include/queue_fn.php');
require_once('include/zot.php');
use Zotlabs\Lib\Queue as LibQueue;
class Queue {
......@@ -48,17 +47,17 @@ class Queue {
else {
// For the first 12 hours we'll try to deliver every 15 minutes
// After that, we'll only attempt delivery once per hour.
// This currently only handles the default queue drivers ('zot' or '') which we will group by posturl
// After that, we'll only attempt delivery once per hour.
// This currently only handles the default queue drivers ('zot' or '') which we will group by posturl
// so that we don't start off a thousand deliveries for a couple of dead hubs.
// The zot driver will deliver everything destined for a single hub once contact is made (*if* contact is made).
// Other drivers will have to do something different here and may need their own query.
// Note: this requires some tweaking as new posts to long dead hubs once a day will keep them in the
// Note: this requires some tweaking as new posts to long dead hubs once a day will keep them in the
// "every 15 minutes" category. We probably need to prioritise them when inserted into the queue
// or just prior to this query based on recent and long-term delivery history. If we have good reason to believe
// the site is permanently down, there's no reason to attempt delivery at all, or at most not more than once
// or twice a day.
// the site is permanently down, there's no reason to attempt delivery at all, or at most not more than once
// or twice a day.
$sqlrandfunc = db_getfunc('rand');
......@@ -67,7 +66,7 @@ class Queue {
);
while ($r) {
foreach ($r as $rv) {
queue_deliver($rv);
LibQueue::deliver($rv);
}
$r = q("SELECT *,$sqlrandfunc as rn FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s order by rn limit 1",
db_utcnow()
......@@ -78,7 +77,7 @@ class Queue {
return;
foreach ($r as $rv) {
queue_deliver($rv);
LibQueue::deliver($rv);
}
}
}
<?php
namespace Zotlabs\Daemon;
require_once('include/zot.php');
require_once('include/queue_fn.php');
class Ratenotif {
static public function run($argc,$argv) {
// Deprecated
return;
require_once("datetime.php");
require_once('include/items.php');
if($argc < 3)
return;
logger('ratenotif: invoked: ' . print_r($argv,true), LOGGER_DEBUG);
$cmd = $argv[1];
$item_id = $argv[2];
if($cmd === 'rating') {
$r = q("select * from xlink where xlink_id = %d and xlink_static = 1 limit 1",
intval($item_id)
);
if(! $r) {
logger('rating not found');
return;
}
$encoded_item = array(
'type' => 'rating',
'encoding' => 'zot',
'target' => $r[0]['xlink_link'],
'rating' => intval($r[0]['xlink_rating']),
'rating_text' => $r[0]['xlink_rating_text'],
'signature' => $r[0]['xlink_sig'],
'edited' => $r[0]['xlink_updated']
);
}
$channel = channelx_by_hash($r[0]['xlink_xchan']);
if(! $channel) {
logger('no channel');
return;
}
$primary = get_directory_primary();
if(! $primary)
return;
$interval = ((get_config('system','delivery_interval') !== false)
? intval(get_config('system','delivery_interval')) : 2 );
$deliveries_per_process = intval(get_config('system','delivery_batch_count'));
if($deliveries_per_process <= 0)
$deliveries_per_process = 1;
$deliver = array();
$x = z_fetch_url($primary . '/regdir');
if($x['success']) {
$j = json_decode($x['body'],true);
if($j && $j['success'] && is_array($j['directories'])) {
foreach($j['directories'] as $h) {
if($h == z_root())
continue;
$hash = random_string();
$n = zot_build_packet($channel,'notify',null,null,'',$hash);
queue_insert(array(
'hash' => $hash,
'account_id' => $channel['channel_account_id'],
'channel_id' => $channel['channel_id'],
'posturl' => $h . '/post',
'notify' => $n,
'msg' => json_encode($encoded_item)
));
$x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300))) {
logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
update_queue_item($hash);
continue;
}
$deliver[] = $hash;
if(count($deliver) >= $deliveries_per_process) {
Master::Summon(array('Deliver',$deliver));
$deliver = array();
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
}
}
// catch any stragglers
if(count($deliver)) {
Master::Summon(array('Deliver',$deliver));
}
}
}
logger('ratenotif: complete.');
return;
}
}
......@@ -45,7 +45,6 @@ class Thumbnail {
return;
}
$default_controller = null;
$files = glob('Zotlabs/Thumbs/*.php');
......
......@@ -11,6 +11,7 @@ use Zotlabs\Web\HTTPSig;
require_once('include/event.php');
require_once('include/html2plain.php');
require_once('include/items.php');
class Activity {
......@@ -41,9 +42,6 @@ class Activity {
if ($x['type'] === ACTIVITY_OBJ_EVENT) {
return self::fetch_event($x);
}
if ($x['type'] === ACTIVITY_OBJ_PHOTO) {
return self::fetch_image($x);
}
call_hooks('encode_object', $x);
}
......@@ -193,6 +191,7 @@ class Activity {
}
static function fetch_image($x) {
$ret = [
'type' => 'Image',
'id' => $x['id'],
......@@ -649,7 +648,7 @@ class Activity {
$atts = ((is_array($item['attach'])) ? $item['attach'] : json_decode($item['attach'], true));
if ($atts) {
foreach ($atts as $att) {
if (strpos($att['type'], 'image')) {
if (isset($att['type']) && strpos($att['type'], 'image')) {
$ret[] = ['type' => 'Image', 'url' => $att['href']];
}
else {
......@@ -1534,8 +1533,9 @@ class Activity {
static function actor_store($url, $person_obj) {
if (!is_array($person_obj))
if (!is_array($person_obj)) {
return;
}
$inbox = $person_obj['inbox'];
......@@ -1546,11 +1546,14 @@ class Activity {
}
$name = $person_obj['name'];
if (!$name)
if (!$name) {
$name = $person_obj['preferredUsername'];
if (!$name)
}
if (!$name) {
$name = t('Unknown');
}
$icon = z_root() . '/' . get_default_profile_photo(300);
if ($person_obj['icon']) {
if (is_array($person_obj['icon'])) {
if (array_key_exists('url', $person_obj['icon']))
......@@ -1615,84 +1618,85 @@ class Activity {
}
}
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
$m = parse_url($url);
if($m) {
$hostname = $m['host'];
$baseurl = $m['scheme'] . '://' . $m['host'] . (($m['port']) ? ':' . $m['port'] : '');
$site_url = $m['scheme'] . '://' . $m['host'];
}
$r = q("select * from xchan join hubloc on xchan_hash = hubloc_hash where xchan_hash = '%s'",
dbesc($url)
);
if (!$r) {
// create a new record
xchan_store_lowlevel(
[
'xchan_hash' => $url,
'xchan_guid' => $url,
'xchan_pubkey' => $pubkey,
'xchan_addr' => '',
'xchan_url' => $profile,
'xchan_name' => $name,
'xchan_name_date' => datetime_convert(),
'xchan_network' => 'activitypub'
]
);
}
else {
if($r) {
// Record exists. Cache existing records for one week at most
// then refetch to catch updated profile photos, names, etc.
$d = datetime_convert('UTC', 'UTC', 'now - 1 week');
if ($r[0]['xchan_name_date'] > $d)
$d = datetime_convert('UTC', 'UTC', 'now - 3 days');
if($r[0]['hubloc_updated'] > $d) {
return;
}
// update existing record
q("update xchan set xchan_name = '%s', xchan_pubkey = '%s', xchan_network = '%s', xchan_name_date = '%s' where xchan_hash = '%s'",
dbesc($name),
dbesc($pubkey),
dbesc('activitypub'),
q("UPDATE site SET site_update = '%s', site_dead = 0 WHERE site_url = '%s'",
dbesc(datetime_convert()),
dbesc($site_url)
);
// update existing xchan record
q("update xchan set xchan_name = '%s', xchan_guid = '%s', xchan_pubkey = '%s', xchan_network = 'activitypub', xchan_name_date = '%s' where xchan_hash = '%s'",
dbesc(escape_tags($name)),
dbesc(escape_tags($url)),
dbesc(escape_tags($pubkey)),
dbescdate(datetime_convert()),