diff --git a/Zotlabs/Daemon/Onepoll.php b/Zotlabs/Daemon/Onepoll.php
index abb86e6b8..b3bdf2c47 100644
--- a/Zotlabs/Daemon/Onepoll.php
+++ b/Zotlabs/Daemon/Onepoll.php
@@ -99,68 +99,6 @@ class Onepoll {
if(! $responded)
return;
- if($contact['xchan_connurl']) {
- $fetch_feed = true;
- $x = null;
-
- // They haven't given us permission to see their stream
-
- $can_view_stream = their_perms_contains($importer_uid,$contact['abook_xchan'],'view_stream');
-
- if(! $can_view_stream)
- $fetch_feed = false;
-
- // we haven't given them permission to send us their stream
-
- $can_send_stream = ((strpos(get_abconfig($importer_uid,$contact['abook_xchan'],'system','my_perms',EMPTY_STR),'send_stream') !== false) ? true : false);
-
- if(! $can_send_stream)
- $fetch_feed = false;
-
- 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 = Libzot::process_delivery($contact['xchan_hash'], null, get_item_elements($message), [ $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
if($contact['xchan_connurl']) {
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 29ee104bd..3b83699af 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -982,7 +982,7 @@ class Activity {
$ret['outbox'] = z_root() . '/nullbox';
}
$ret['publicKey'] = [
- 'id' => $p['xchan_url'] . '/public_key_pem',
+ 'id' => $p['xchan_url'],
'owner' => $p['xchan_url'],
'publicKeyPem' => $p['xchan_pubkey']
];
diff --git a/Zotlabs/Module/Profiles.php b/Zotlabs/Module/Profiles.php
index b3eb8f815..e800aec5c 100644
--- a/Zotlabs/Module/Profiles.php
+++ b/Zotlabs/Module/Profiles.php
@@ -164,12 +164,7 @@ class Profiles extends Controller {
echo json_encode($r1[0]);
killme();
}
-
-
-
-
- // Run Libprofile::load() here to make sure the theme is set before
- // we start loading content
+
if(((argc() > 1) && (intval(argv(1)))) || !feature_enabled(local_channel(),'multi_profiles')) {
if(feature_enabled(local_channel(),'multi_profiles'))
$id = argv(1);
@@ -324,7 +319,7 @@ class Profiles extends Controller {
$orig_vcard = null;
- $channel = \App::get_channel();
+ $channel = App::get_channel();
$default_vcard_cat = ((defined('DEFAULT_VCARD_CAT')) ? DEFAULT_VCARD_CAT : 'HOME');
@@ -595,12 +590,12 @@ class Profiles extends Controller {
if($r)
info( t('Profile updated.') . EOL);
- $r = q("select * from profile where id = %d and uid = %d limit 1",
+ $sync = q("select * from profile where id = %d and uid = %d limit 1",
intval(argv(1)),
intval(local_channel())
);
- if($r) {
- Libsync::build_sync_packet(local_channel(),array('profile' => $r));
+ if($sync) {
+ Libsync::build_sync_packet(local_channel(),array('profile' => $sync));
}
$channel = App::get_channel();
@@ -618,10 +613,8 @@ class Profiles extends Controller {
}
if($is_default) {
- // reload the info for the sidebar widget - Q: why does this not work?
- // A: The page is already loaded. Perhaps need to redirect instead to force widget updates.
- Libprofile::load($channel['channel_address']);
Master::Summon(array('Directory',local_channel()));
+ goaway(z_root() . '/profiles/' . $sync[0]['id']);
}
}
}
diff --git a/Zotlabs/Module/Zotfeed.php b/Zotlabs/Module/Zotfeed.php
index 1f0bf994f..b26148e3e 100644
--- a/Zotlabs/Module/Zotfeed.php
+++ b/Zotlabs/Module/Zotfeed.php
@@ -41,6 +41,7 @@ class Zotfeed extends \Zotlabs\Web\Controller {
logger('zotfeed request: ' . $r[0]['channel_name'], LOGGER_DEBUG);
+ $result['project'] = 'Zap';
$result['messages'] = zot_feed($r[0]['channel_id'],$observer['xchan_hash'],array('mindate' => $mindate));
$result['success'] = true;
json_return_and_die($result);
diff --git a/boot.php b/boot.php
index 561b2fc13..5c7527347 100755
--- a/boot.php
+++ b/boot.php
@@ -48,7 +48,7 @@ require_once('include/items.php');
-define ( 'STD_VERSION', '19.8.19' );
+define ( 'STD_VERSION', '19.8.21' );
define ( 'ZOT_REVISION', '6.0' );
define ( 'DB_UPDATE_VERSION', 1234 );
diff --git a/include/import.php b/include/import.php
index edd35d1aa..d8f4415a2 100644
--- a/include/import.php
+++ b/include/import.php
@@ -1309,9 +1309,9 @@ function sync_files($channel, $files) {
logger('sync_files duplicate check: attach_by_hash() returned ' . print_r($x,true), LOGGER_DEBUG);
if ($x['success']) {
- $orig_attach = $x[0];
+ $orig_attach = $x['data'];
$attach_exists = true;
- $attach_id = $x[0]['id'];
+ $attach_id = $orig_attach['id'];
}
$newfname = 'store/' . $channel['channel_address'] . '/' . get_attach_binname($att['content']);
diff --git a/include/text.php b/include/text.php
index ef32a9bc9..bd5554348 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1505,21 +1505,35 @@ function prepare_body(&$item,$attach = false,$opts = false) {
$is_photo = ((($item['verb'] === ACTIVITY_POST) && ($item['obj_type'] === ACTIVITY_OBJ_PHOTO)) ? true : false);
- if($is_photo && ! $censored) {
+ if ($is_photo && ! $censored) {
$object = json_decode($item['obj'],true);
+ $ptr = null;
+
+ if (array_key_exists('url',$object) && is_array($object['url'])) {
+ if (array_key_exists(0,$object['url'])) {
+ foreach ($object['url'] as $link) {
+ if(array_key_exists('width',$link) && $link['width'] >= 640 && $link['width'] <= 1024) {
+ $ptr = $link;
+ }
+ }
+ if (! $ptr) {
+ $ptr = $object['url'][0];
+ }
+ }
+ else {
+ $ptr = $object['url'];
+ }
- if(array_key_exists('url',$object) && is_array($object['url']) && array_key_exists(0,$object['url'])) {
// if original photo width is > 640px make it a cover photo
- if(array_key_exists('width',$object['url'][0]) && $object['url'][0]['width'] > 640) {
- $scale = ((($object['url'][1]['width'] == 1024) || ($object['url'][1]['height'] == 1024)) ? 1 : 0);
- $photo = '';
+ if ($ptr) {
+ if (array_key_exists('width',$ptr) && $ptr['width'] > 640) {
+ $photo = '';
+ }
+ else {
+ $item['body'] = '[zmg]' . $ptr['href'] . '[/zmg]' . "\n\n" . $item['body'];
+ }
}
- // if original photo width is <= 640px prepend it to item body
- elseif(array_key_exists('width',$object['url'][0]) && $object['url'][0]['width'] <= 640) {
- $item['body'] = '[zmg]' . $object['url'][0]['href'] . '[/zmg]' . "\n\n" . $item['body'];
- }
-
}
}
diff --git a/view/js/main.js b/view/js/main.js
index 0886964fe..49541c341 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -107,7 +107,7 @@ $(document).ready(function() {
if (event.ctrlKey) {
totStopped = true;
}
- $('#pause').html('');
+ $('#pause').html('');
} else {
unpause();
}
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index fb40fc2a2..aafb0d9f2 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -805,7 +805,7 @@ div.jGrowl div.info {
}
#jGrowl.top-right {
top: 4.5rem;
- right: 15px;
+ left: 150px;
}
div.jGrowl div.jGrowl-notification {