aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Import.php20
-rw-r--r--Zotlabs/Module/Import_progress.php39
-rw-r--r--Zotlabs/Module/Siteinfo.php4
-rw-r--r--Zotlabs/Module/Sse_bs.php6
-rw-r--r--Zotlabs/Module/Wall_attach.php14
5 files changed, 65 insertions, 18 deletions
diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php
index e8968c6bd..24b7498dd 100644
--- a/Zotlabs/Module/Import.php
+++ b/Zotlabs/Module/Import.php
@@ -525,14 +525,21 @@ class Import extends Controller {
// This will indirectly perform a refresh_all *and* update the directory
Master::Summon(['Directory', $channel['channel_id']]);
- $cf_api_compat = true;
+ if ($api_path) {
+ $parsed = parse_url($api_path);
+ unset($parsed['path']);
- if ($api_path && $import_posts) { // we are importing from a server and not a file
- if (version_compare($data['compatibility']['version'], '6.3.4', '>=')) {
+ // store the import host so we can manually kick off item/file sync later in case anything did not work out
+ set_pconfig($channel['channel_id'], 'import', 'host', $parsed['host']);
+
+ $hz_server = unparse_url($parsed);
+ }
- $m = parse_url($api_path);
+ $cf_api_compat = false;
- $hz_server = $m['scheme'] . '://' . $m['host'];
+ if ($api_path && $hz_server && $import_posts) { // we are importing from a server and not a file
+ if (version_compare($data['compatibility']['version'], '6.3.4', '>=')) {
+ $cf_api_compat = true;
$since = datetime_convert(date_default_timezone_get(), date_default_timezone_get(), '0001-01-01 00:00');
$until = datetime_convert(date_default_timezone_get(), date_default_timezone_get(), 'now + 1 day');
@@ -543,9 +550,6 @@ class Import extends Controller {
Master::Summon(['Content_importer', sprintf('%d', $page), $since, $until, $channel['channel_address'], urlencode($hz_server)]);
Master::Summon(['File_importer', sprintf('%d', $page), $channel['channel_address'], urlencode($hz_server)]);
}
- else {
- $cf_api_compat = false;
- }
}
change_channel($channel['channel_id']);
diff --git a/Zotlabs/Module/Import_progress.php b/Zotlabs/Module/Import_progress.php
index 5c68f9ff1..d9b13e8a8 100644
--- a/Zotlabs/Module/Import_progress.php
+++ b/Zotlabs/Module/Import_progress.php
@@ -1,6 +1,7 @@
<?php
namespace Zotlabs\Module;
+use App;
use Zotlabs\Lib\PConfig;
use Zotlabs\Daemon\Master;
@@ -21,6 +22,9 @@ class Import_progress extends \Zotlabs\Web\Controller {
nav_set_selected('Channel Import');
+ $channel = App::get_channel();
+ $import_host = PConfig::Get(local_channel(), 'import', 'host');
+
// items
$c = PConfig::Get(local_channel(), 'import', 'content_progress');
@@ -41,6 +45,24 @@ class Import_progress extends \Zotlabs\Web\Controller {
}
}
else {
+ if(argv(1) === 'resume_itemsync' && $import_host) {
+ $alive = probe_api_path($import_host);
+ if ($alive) {
+ $parsed = parse_url($alive);
+ unset($parsed['path']);
+
+ $hz_server = unparse_url($parsed);
+ $since = datetime_convert(date_default_timezone_get(), date_default_timezone_get(), '0001-01-01 00:00');
+ $until = datetime_convert(date_default_timezone_get(), date_default_timezone_get(), 'now + 1 day');
+ $page = 0;
+ Master::Summon(['Content_importer', sprintf('%d', $page), $since, $until, $channel['channel_address'], urlencode($hz_server)]);
+ goaway('/import_progress');
+ }
+ else {
+ notice(t('Import host does not seem to be online or compatible') . EOL);
+ }
+ }
+
$cprogress = 'waiting to start...';
if (PConfig::Get(local_channel(), 'import', 'content_completed')) {
@@ -73,6 +95,23 @@ class Import_progress extends \Zotlabs\Web\Controller {
}
}
else {
+ if(argv(1) === 'resume_filesync' && $import_host) {
+ $alive = probe_api_path($import_host);
+ if ($alive) {
+ $parsed = parse_url($alive);
+ unset($parsed['path']);
+
+ $hz_server = unparse_url($parsed);
+ $page = 0;
+
+ Master::Summon(['File_importer', sprintf('%d', $page), $channel['channel_address'], urlencode($hz_server)]);
+ goaway('/import_progress');
+ }
+ else {
+ notice(t('Import host does not seem to be online or compatible') . EOL);
+ }
+ }
+
$fprogress = 'waiting to start...';
if (PConfig::Get(local_channel(), 'import', 'files_completed')) {
diff --git a/Zotlabs/Module/Siteinfo.php b/Zotlabs/Module/Siteinfo.php
index df6a334d8..3cad64a13 100644
--- a/Zotlabs/Module/Siteinfo.php
+++ b/Zotlabs/Module/Siteinfo.php
@@ -29,8 +29,8 @@ class Siteinfo extends \Zotlabs\Web\Controller {
'$terms' => t('Terms of Service'),
'$prj_header' => t('Software and Project information'),
'$prj_name' => t('This site is powered by $Projectname'),
- '$prj_transport' => t('Federated and decentralised networking and identity services provided by Zot'),
- '$transport_link' => '<a href="https://zotlabs.org">https://zotlabs.org</a>',
+ '$prj_transport' => t('Federated and decentralised networking and identity services provided by'),
+ '$transport_link' => '<a href="https://hubzilla.org">https://hubzilla.org</a>',
'$additional_text' => t('Additional federated transport protocols:'),
'$additional_fed' => implode(', ', $federated),
diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php
index a18301a1a..09c4ed614 100644
--- a/Zotlabs/Module/Sse_bs.php
+++ b/Zotlabs/Module/Sse_bs.php
@@ -590,6 +590,7 @@ class Sse_bs extends Controller {
if($forums) {
$item_normal = item_normal();
+ $p_sql = '';
$sql_extra = '';
if(! (self::$vnotify & VNOTIFY_LIKE))
@@ -599,6 +600,7 @@ 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),
@@ -607,14 +609,16 @@ class Sse_bs extends Controller {
$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 item_unseen = 1 $sql_extra $item_normal",
+ where uid = %d and ( owner_xchan = '%s' OR author_xchan = '%s' $p_sql ) and verb != 'Announce' and item_unseen = 1 $sql_extra $item_normal",
intval(self::$uid),
dbesc($forums[$x]['xchan_hash']),
dbesc($forums[$x]['xchan_hash'])
);
+
if($r[0]['total']) {
$forums[$x]['notify_link'] = z_root() . '/network/?f=&pf=1&unseen=1&cid=' . $forums[$x]['abook_id'];
diff --git a/Zotlabs/Module/Wall_attach.php b/Zotlabs/Module/Wall_attach.php
index 0d5c9e983..3c57d4b94 100644
--- a/Zotlabs/Module/Wall_attach.php
+++ b/Zotlabs/Module/Wall_attach.php
@@ -104,32 +104,32 @@ class Wall_attach extends \Zotlabs\Web\Controller {
}
if(intval($r['data']['is_photo'])) {
- $s = "\n\n" . $r['body'] . "\n\n";
+ $s = $r['body'];
}
else {
- if(strpos($r['data']['filetype'],'video') === 0) {
+ if(strpos($r['data']['filetype'], 'video') === 0) {
// give a wee bit of time for the background thumbnail processor to do its thing
// or else we'll never see a video poster
sleep(3);
$url = z_root() . '/cloud/' . $channel['channel_address'] . '/' . $r['data']['display_path'];
$thumb = Linkinfo::get_video_poster($url);
if($thumb) {
- $s = "\n\n" . '[zvideo poster=\'' . $thumb . '\']' . $url . '[/zvideo]' . "\n\n";
+ $s = '[zvideo poster=\'' . $thumb . '\']' . $url . '[/zvideo]';
}
else {
- $s = "\n\n" . '[zvideo]' . $url . '[/zvideo]' . "\n\n";
+ $s = '[zvideo]' . $url . '[/zvideo]';
}
}
if(strpos($r['data']['filetype'],'audio') === 0) {
$url = z_root() . '/cloud/' . $channel['channel_address'] . '/' . $r['data']['display_path'];
- $s = "\n\n" . '[zaudio]' . $url . '[/zaudio]' . "\n\n";
+ $s = '[zaudio]' . $url . '[/zaudio]';
}
if ($r['data']['filetype'] === 'image/svg+xml') {
$x = @file_get_contents('store/' . $channel['channel_address'] . '/' . $r['data']['os_path']);
if ($x) {
$bb = svg2bb($x);
if ($bb) {
- $s .= "\n\n" . $bb;
+ $s .= $bb;
}
else {
logger('empty return from svgbb');
@@ -140,7 +140,7 @@ class Wall_attach extends \Zotlabs\Web\Controller {
}
}
- $s .= "\n\n" . '[attachment]' . $r['data']['hash'] . ',' . $r['data']['revision'] . '[/attachment]' . "\n";
+ $s .= '[attachment]' . $r['data']['hash'] . ',' . $r['data']['revision'] . '[/attachment]';
}
$sync = attach_export_data($channel,$r['data']['hash']);