aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Activity.php104
-rw-r--r--Zotlabs/Lib/ActivityStreams.php2
-rw-r--r--Zotlabs/Lib/Apps.php21
-rw-r--r--Zotlabs/Lib/Cache.php14
-rw-r--r--Zotlabs/Lib/JSalmon.php2
-rw-r--r--Zotlabs/Lib/Libzot.php73
-rw-r--r--Zotlabs/Lib/QueueWorker.php8
-rw-r--r--Zotlabs/Lib/ThreadItem.php9
-rw-r--r--Zotlabs/Lib/Zotfinger.php8
9 files changed, 158 insertions, 83 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 55ca1fb49..835909849 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -120,6 +120,7 @@ class Activity {
}
$h = HTTPSig::create_sig($headers, $channel['channel_prvkey'], channel_url($channel), false);
+ $start_timestamp = microtime(true);
$x = z_fetch_url($url, true, $redirects, ['headers' => $h]);
}
@@ -142,8 +143,14 @@ class Activity {
logger('returned: ' . json_encode($y, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES), LOGGER_DEBUG);
if (isset($y['type']) && ActivityStreams::is_an_actor($y['type'])) {
+ logger('logger_stats_data cmd:Actor_fetch' . ' start:' . $start_timestamp . ' ' . 'end:' . microtime(true) . ' meta:' . $url . '#' . random_string(16));
+ btlogger('actor fetch');
+ $y['actor_cache_date'] = datetime_convert();
XConfig::Set($y['id'], 'system', 'actor_record', $y);
}
+ else {
+ logger('logger_stats_data cmd:Activity_fetch' . ' start:' . $start_timestamp . ' ' . 'end:' . microtime(true) . ' meta:' . $url . '#' . random_string(16));
+ }
return json_decode($x['body'], true);
}
@@ -151,6 +158,8 @@ class Activity {
logger('fetch failed: ' . $url);
logger($x['body']);
}
+
+
return null;
}
@@ -543,7 +552,7 @@ class Activity {
$ret['commentPolicy'] .= 'until=' . datetime_convert('UTC', 'UTC', $i['comments_closed'], ATOM_TIME);
}
- $ret['attributedTo'] = $i['author']['xchan_url'];
+ $ret['attributedTo'] = self::encode_person($i['author'], false);
if ($i['mid'] !== $i['parent_mid']) {
$ret['inReplyTo'] = ((strpos($i['thr_parent'], 'http') === 0) ? $i['thr_parent'] : z_root() . '/item/' . urlencode($i['thr_parent']));
@@ -1369,7 +1378,7 @@ class Activity {
// store their xchan and hubloc
- self::actor_store($person_obj['id'], $person_obj);
+ self::actor_store($person_obj);
// Find any existing abook record
@@ -1600,15 +1609,7 @@ class Activity {
}
- static function actor_store($url, $person_obj = null, $force = false) {
-
- if ($person_obj === null) {
- $tgt = self::fetch($url);
- if (is_array($tgt) && ActivityStreams::is_an_actor($tgt['type'])) {
- self::actor_store($tgt['id'], $tgt);
- }
- return;
- }
+ static function actor_store($person_obj, $force = false) {
if (!is_array($person_obj)) {
return;
@@ -1618,13 +1619,14 @@ class Activity {
if (array_key_exists('movedTo',$person_obj) && $person_obj['movedTo'] && ! is_array($person_obj['movedTo'])) {
$tgt = self::fetch($person_obj['movedTo']);
if (is_array($tgt)) {
- self::actor_store($person_obj['movedTo'],$tgt);
+ self::actor_store($tgt);
ActivityPub::move($person_obj['id'],$tgt);
}
return;
}
*/
+ $url = null;
$ap_hubloc = null;
$hublocs = self::get_actor_hublocs($url);
@@ -1645,7 +1647,7 @@ class Activity {
if ($ap_hubloc) {
// we already have a stored record. Determine if it needs updating.
if ($ap_hubloc['hubloc_updated'] < datetime_convert('UTC', 'UTC', ' now - 3 days') || $force) {
- $person_obj = self::fetch($url);
+ $person_obj = self::get_cached_actor($url);
}
else {
return;
@@ -1668,11 +1670,6 @@ class Activity {
return;
}
- // store the actor record in XConfig
-
- // we already store this in Activity::fetch()
- // XConfig::Set($url, 'system', 'actor_record', $person_obj);
-
$name = $person_obj['name'] ?? '';
if (!$name) {
$name = $person_obj['preferredUsername'] ?? '';
@@ -1697,7 +1694,7 @@ class Activity {
$webfinger_addr = escape_tags($person_obj['preferredUsername']) . '@' . $hostname;
}
- $icon = z_root() . '/' . get_default_profile_photo(300);
+ $icon = null;
if (isset($person_obj['icon'])) {
if (is_array($person_obj['icon'])) {
if (array_key_exists('url', $person_obj['icon'])) {
@@ -1807,6 +1804,9 @@ class Activity {
'xchan_addr' => $webfinger_addr,
'xchan_url' => $profile,
'xchan_name' => escape_tags($name),
+ 'xchan_photo_l' => z_root() . '/' . get_default_profile_photo(),
+ 'xchan_photo_m' => z_root() . '/' . get_default_profile_photo(80),
+ 'xchan_photo_s' => z_root() . '/' . get_default_profile_photo(48),
'xchan_name_date' => datetime_convert(),
'xchan_network' => 'activitypub',
'xchan_pubforum' => intval($group_actor)
@@ -1846,16 +1846,9 @@ class Activity {
}
}
- $photos = import_xchan_photo($icon, $url);
- q("update xchan set xchan_photo_date = '%s', xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s' where xchan_hash = '%s'",
- dbescdate(datetime_convert('UTC', 'UTC', $photos[5])),
- dbesc($photos[0]),
- dbesc($photos[1]),
- dbesc($photos[2]),
- dbesc($photos[3]),
- dbesc($url)
- );
-
+ if ($icon) {
+ Master::Summon(['Xchan_photo', bin2hex($icon), bin2hex($url)]);
+ }
}
static function create_action($channel, $observer_hash, $act) {
@@ -2308,7 +2301,7 @@ class Activity {
}
// ensure we store the original actor
- self::actor_store($act->actor['id'], $act->actor);
+ self::actor_store($act->actor);
$s['owner_xchan'] = $act->actor['id'];
$s['author_xchan'] = $act->actor['id'];
@@ -2352,7 +2345,7 @@ class Activity {
$s['expires'] = datetime_convert('UTC', 'UTC', $act->obj['expires']);
}
- if ($act->type === 'Invite' && $act->objprop('type') === 'Event') {
+ if (in_array($act->type, ['Invite', 'Create']) && $act->objprop('type') === 'Event') {
$s['mid'] = $s['parent_mid'] = $act->id;
}
@@ -2394,30 +2387,30 @@ class Activity {
}
// ensure we store the original actor
- self::actor_store($obj_actor['id'], $obj_actor);
+ self::actor_store($obj_actor);
$mention = self::get_actor_bbmention($obj_actor['id']);
if ($act->type === 'Like') {
- $content['content'] = sprintf(t('Likes %1$s\'s %2$s'), $mention, $act->obj['type']) . "\n\n" . $content['content'] ?? '';
+ $content['content'] = sprintf(t('Likes %1$s\'s %2$s'), $mention, $act->obj['type']) . EOL . EOL . ($content['content'] ?? '');
}
if ($act->type === 'Dislike') {
- $content['content'] = sprintf(t('Doesn\'t like %1$s\'s %2$s'), $mention, $act->obj['type']) . "\n\n" . $content['content'] ?? '';
+ $content['content'] = sprintf(t('Doesn\'t like %1$s\'s %2$s'), $mention, $act->obj['type']) . EOL . EOL . ($content['content'] ?? '');
}
// handle event RSVPs
if (($act->objprop('type') === 'Event') || ($act->objprop('type') === 'Invite' && array_path_exists('object/type', $act->obj) && $act->obj['object']['type'] === 'Event')) {
if ($act->type === 'Accept') {
- $content['content'] = sprintf(t('Will attend %s\'s event'), $mention) . EOL . EOL . $content['content'];
+ $content['content'] = sprintf(t('Will attend %s\'s event'), $mention) . EOL . EOL . ($content['content'] ?? '');
}
if ($act->type === 'Reject') {
- $content['content'] = sprintf(t('Will not attend %s\'s event'), $mention) . EOL . EOL . $content['content'];
+ $content['content'] = sprintf(t('Will not attend %s\'s event'), $mention) . EOL . EOL . ($content['content'] ?? '');
}
if ($act->type === 'TentativeAccept') {
- $content['content'] = sprintf(t('May attend %s\'s event'), $mention) . EOL . EOL . $content['content'];
+ $content['content'] = sprintf(t('May attend %s\'s event'), $mention) . EOL . EOL . ($content['content'] ?? '');
}
if ($act->type === 'TentativeReject') {
- $content['content'] = sprintf(t('May not attend %s\'s event'), $mention) . EOL . EOL . $content['content'];
+ $content['content'] = sprintf(t('May not attend %s\'s event'), $mention) . EOL . EOL . ($content['content'] ?? '');
}
}
@@ -2907,6 +2900,10 @@ class Activity {
set_iconfig($s, 'activitypub', 'recips', $act->raw_recips);
}
+ if ($act->objprop('type') === 'Event' && $act->objprop('timezone')) {
+ set_iconfig($s, 'event', 'timezone', $act->objprop('timezone'), true);
+ }
+
$hookinfo = [
'act' => $act,
's' => $s
@@ -3265,7 +3262,12 @@ class Activity {
}
}
- if (is_array($x) && $x['item_id']) {
+ if ($x['success']) {
+
+ if (check_item_source($channel['channel_id'], $x['item']) && in_array($x['item']['obj_type'], ['Event', ACTIVITY_OBJ_EVENT])) {
+ event_addtocal($x['item_id'], $channel['channel_id']);
+ }
+
if ($is_child_node) {
if ($item['owner_xchan'] === $channel['channel_hash']) {
// We are the owner of this conversation, so send all received comments back downstream
@@ -3386,7 +3388,7 @@ class Activity {
}
if (is_array($a->actor) && array_key_exists('id', $a->actor)) {
- self::actor_store($a->actor['id'], $a->actor);
+ self::actor_store($a->actor);
}
$replies = null;
@@ -4037,7 +4039,8 @@ class Activity {
$cache_url = ((strpos($id, '#')) ? substr($id, 0, strpos($id, '#')) : $id);
$actor = XConfig::Get($cache_url, 'system', 'actor_record');
- if ($actor) {
+ if ($actor && isset($actor['actor_cache_date']) && $actor['actor_cache_date'] > datetime_convert('UTC', 'UTC', ' now - 3 days')) {
+ unset($actor['actor_cache_date']);
return $actor;
}
@@ -4052,6 +4055,25 @@ class Activity {
return $hookdata['actor'];
}
+ static function get_actor($actor_id) {
+ // remove fragment
+ $actor_id = ((strpos($actor_id, '#')) ? substr($actor_id, 0, strpos($actor_id, '#')) : $actor_id);
+
+ $actor = self::get_cached_actor($actor_id);
+
+ if ($actor) {
+ return $actor;
+ }
+
+ $actor = self::fetch($actor_id);
+
+ if ($actor) {
+ return $actor;
+ }
+
+ return null;
+ }
+
static function get_unknown_actor($act) {
// try other get_actor providers (e.g. diaspora)
diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php
index 8b8c95ad8..4c3e3d8f8 100644
--- a/Zotlabs/Lib/ActivityStreams.php
+++ b/Zotlabs/Lib/ActivityStreams.php
@@ -351,7 +351,7 @@ class ActivityStreams {
$x = $this->get_property_obj($property, $base, $namespace);
if ($this->is_url($x)) {
- $y = Activity::get_cached_actor($x);
+ $y = Activity::get_actor($x);
if ($y) {
return $y;
}
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php
index 497a9d299..00e65479e 100644
--- a/Zotlabs/Lib/Apps.php
+++ b/Zotlabs/Lib/Apps.php
@@ -419,11 +419,28 @@ class Apps {
static public function app_render($papp, $mode = 'view') {
$installed = false;
- if(! $papp)
+ if(!$papp) {
return;
+ }
+
+ /**
+ * @hooks app_render_before
+ * Hook to manipulate the papp array before rendering
+ */
- if(! $papp['photo'])
+ $hookinfo = [
+ 'name' => $papp['name'],
+ 'photo' => $papp['photo']
+ ];
+
+ call_hooks('app_render_manipulate_photo', $hookinfo);
+
+ // We will only allow to manipulate the photo
+ $papp['photo'] = $hookinfo['photo'];
+
+ if(!$papp['photo']) {
$papp['photo'] = 'icon:gear';
+ }
self::translate_system_apps($papp);
diff --git a/Zotlabs/Lib/Cache.php b/Zotlabs/Lib/Cache.php
index a5052a183..60bf64611 100644
--- a/Zotlabs/Lib/Cache.php
+++ b/Zotlabs/Lib/Cache.php
@@ -5,17 +5,17 @@ namespace Zotlabs\Lib;
/**
* cache api
*/
-
+
class Cache {
-
+
/**
* @brief Returns cached content
- *
+ *
* @param string $key
* @param string $age in SQL format, default is '30 DAY'
* @return string
*/
-
+
public static function get($key, $age = '') {
$hash = hash('whirlpool',$key);
@@ -25,12 +25,12 @@ class Cache {
db_utcnow(),
db_quoteinterval(($age ? $age : get_config('system','object_cache_days', '30') . ' DAY'))
);
-
+
if ($r)
return $r[0]['v'];
return null;
}
-
+
public static function set($key,$value) {
$hash = hash('whirlpool',$key);
@@ -45,7 +45,7 @@ class Cache {
dbesc($hash));
}
else {
- q("INSERT INTO cache ( k, v, updated) VALUES ('%s','%s','%s')",
+ q("INSERT INTO cache (k, v, updated) VALUES ('%s', '%s', '%s')",
dbesc($hash),
dbesc($value),
dbesc(datetime_convert()));
diff --git a/Zotlabs/Lib/JSalmon.php b/Zotlabs/Lib/JSalmon.php
index f9fe99706..5531f791f 100644
--- a/Zotlabs/Lib/JSalmon.php
+++ b/Zotlabs/Lib/JSalmon.php
@@ -52,7 +52,7 @@ class JSalmon {
. base64url_encode($x['alg'],true);
$key = HTTPSig::get_key(EMPTY_STR,'zot6',base64url_decode($x['sigs']['key_id']));
- logger('key: ' . print_r($key,true));
+ logger('key: ' . print_r($key,true), LOGGER_DATA);
if($key['portable_id'] && $key['public_key']) {
if(Crypto::verify($signed_data,base64url_decode($x['sigs']['value']),$key['public_key'])) {
logger('verified');
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 032fae3fc..e9cb2c35c 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -1114,6 +1114,7 @@ class Libzot {
*/
static function import($arr) {
+
$env = $arr;
$private = false;
$return = [];
@@ -1219,13 +1220,19 @@ class Libzot {
return;
}
- $r = Activity::get_actor_hublocs($AS->actor['id']);
+ $author_url = $AS->actor['id'];
+
+ if ($AS->type === 'Announce') {
+ $author_url = Activity::get_attributed_to_actor_url($AS);
+ }
+
+ $r = Activity::get_actor_hublocs($author_url);
- if (! $r) {
+ if (!$r) {
// Author is unknown to this site. Perform channel discovery and try again.
- $z = discover_by_webbie($AS->actor['id']);
+ $z = discover_by_webbie($author_url);
if ($z) {
- $r = Activity::get_actor_hublocs($AS->actor['id']);
+ $r = Activity::get_actor_hublocs($author_url);
}
}
@@ -1448,7 +1455,7 @@ class Libzot {
if ($act && $act->obj) {
if (isset($act->obj['tag']) && is_array($act->obj['tag']) && $act->obj['tag']) {
foreach ($act->obj['tag'] as $tag) {
- if ($tag['type'] === 'Mention' && (strpos($tag['href'], z_root()) !== false)) {
+ if (isset($tag['type'], $tag['href']) && $tag['type'] === 'Mention' && (strpos($tag['href'], z_root()) !== false)) {
$address = basename($tag['href']);
if ($address) {
$z = q("select channel_hash as hash from channel where channel_address = '%s' and channel_hash != '%s'
@@ -1509,11 +1516,9 @@ class Libzot {
*/
static function process_delivery($sender, $act, $arr, $deliveries, $relay, $public = false, $request = false, $force = false) {
-
$result = [];
// We've validated the sender. Now make sure that the sender is the owner or author
-
if (!$public) {
if ($sender != $arr['owner_xchan'] && $sender != $arr['author_xchan']) {
logger("Sender $sender is not owner {$arr['owner_xchan']} or author {$arr['author_xchan']} - mid {$arr['mid']}");
@@ -1634,6 +1639,13 @@ class Libzot {
if (!$allowed && $permit_mentions) {
$allowed = true;
}
+
+ if (!$allowed) {
+ if (PConfig::Get($channel['channel_id'], 'system', 'moderate_unsolicited_comments') && $arr['obj_type'] !== 'Answer') {
+ $arr['item_blocked'] = ITEM_MODERATED;
+ $allowed = true;
+ }
+ }
}
} elseif ($permit_mentions) {
@@ -1642,7 +1654,6 @@ class Libzot {
}
if ($request) {
-
// Conversation fetches (e.g. $request == true) take place for
// a) new comments on expired posts
// b) hyperdrive (friend-of-friend) conversations
@@ -1829,13 +1840,19 @@ class Libzot {
if ($r) {
// We already have this post.
+ // Dismiss its announce
+ if ($act->type === 'Announce') {
+ $DR->update('update ignored');
+ $result[] = $DR->get();
+ continue;
+ }
+
$item_id = $r[0]['id'];
if (intval($r[0]['item_deleted'])) {
// It was deleted locally.
$DR->update('update ignored');
$result[] = $DR->get();
-
continue;
}
// Maybe it has been edited?
@@ -1843,17 +1860,17 @@ class Libzot {
$arr['id'] = $r[0]['id'];
$arr['uid'] = $channel['channel_id'];
- if (post_is_importable($channel['channel_id'], $arr, $abook)) {
- $item_result = self::update_imported_item($sender, $arr, $r[0], $channel['channel_id'], $tag_delivery);
- $DR->update('updated');
- $result[] = $DR->get();
- if (!$relay) {
- add_source_route($item_id, $sender);
- }
- } else {
- $DR->update('update ignored');
- $result[] = $DR->get();
- }
+ if (post_is_importable($channel['channel_id'], $arr, $abook)) {
+ $item_result = self::update_imported_item($sender, $arr, $r[0], $channel['channel_id'], $tag_delivery);
+ $DR->update('updated');
+ $result[] = $DR->get();
+ if (!$relay) {
+ add_source_route($item_id, $sender);
+ }
+ } else {
+ $DR->update('update ignored');
+ $result[] = $DR->get();
+ }
}
else {
$DR->update('update ignored');
@@ -1871,8 +1888,9 @@ class Libzot {
// if it's a sourced post, call the post_local hooks as if it were
// posted locally so that crosspost connectors will be triggered.
+ $item_source = check_item_source($arr['uid'], $arr);
- if (check_item_source($arr['uid'], $arr) || ($channel['xchan_pubforum'] == 1)) {
+ if ($item_source || ($channel['xchan_pubforum'] == 1)) {
/**
* @hooks post_local
* Called when an item has been posted on this machine via mod/item.php (also via API).
@@ -1898,7 +1916,13 @@ class Libzot {
if (post_is_importable($arr['uid'], $arr, $abook)) {
$item_result = item_store($arr);
if ($item_result['success']) {
+
$item_id = $item_result['item_id'];
+
+ if ($item_source && in_array($item_result['item']['obj_type'], ['Event', ACTIVITY_OBJ_EVENT])) {
+ event_addtocal($item_id, $channel['channel_id']);
+ }
+
$parr = [
'item_id' => $item_id,
'item' => $arr,
@@ -1921,7 +1945,8 @@ class Libzot {
add_source_route($item_id, $sender);
}
}
- $DR->update(($item_id) ? 'posted' : 'storage failed: ' . $item_result['message']);
+
+ $DR->update(($item_id) ? (($item_result['item']['item_blocked'] === ITEM_MODERATED) ? 'accepted for moderation' : 'posted') : 'storage failed: ' . $item_result['message']);
$result[] = $DR->get();
} else {
$DR->update('post ignored');
@@ -1938,7 +1963,7 @@ class Libzot {
retain_item($stored['item']['parent']);
}
- if ($relay && $item_id) {
+ if ($relay && $item_id && $stored['item_blocked'] !== ITEM_MODERATED) {
logger('Invoking relay');
Master::Summon(['Notifier', 'relay', intval($item_id)]);
$DR->addto_update('relayed');
@@ -2006,7 +2031,7 @@ class Libzot {
// logger($AS->debug());
if(empty($AS->actor['id'])) {
- logger('No actor id!');
+ logger('No actor id: ' . print_r($AS, true));
continue;
}
diff --git a/Zotlabs/Lib/QueueWorker.php b/Zotlabs/Lib/QueueWorker.php
index 1c74b42d8..68e747b0f 100644
--- a/Zotlabs/Lib/QueueWorker.php
+++ b/Zotlabs/Lib/QueueWorker.php
@@ -63,6 +63,8 @@ class QueueWorker {
return;
}
+ logger('queueworker_stats_summon: cmd:' . $argv[0] . ' ' . 'timestamp:' . time());
+
self::qstart();
$r = q("INSERT INTO workerq (workerq_priority, workerq_data, workerq_uuid, workerq_cmd) VALUES (%d, '%s', '%s', '%s')",
intval($priority),
@@ -299,12 +301,16 @@ class QueueWorker {
$cls = '\\Zotlabs\\Daemon\\' . $argv[0];
$argv = flatten_array_recursive($argv);
$argc = count($argv);
- $rnd = random_string();
+ $rnd = random_string(16);
logger('PROCESSING: ' . $rnd . ' ' . print_r($argv[0], true));
+ $start_timestamp = microtime(true);
+
$cls::run($argc, $argv);
+ logger('logger_stats_data cmd:' . $argv[0] . ' start:' . $start_timestamp . ' ' . 'end:' . microtime(true) . ' meta:' . $rnd);
+
logger('COMPLETED: ' . $rnd);
// @FIXME: Right now we assume that if we get a return, everything is OK.
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index 14c9500ff..037ddb19e 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -101,7 +101,7 @@ class ThreadItem {
$conv = $this->get_conversation();
$observer = $conv->get_observer();
- $acl = new AccessList(false);
+ $acl = new AccessList([]);
$acl->set($item);
$lock = ((intval($item['item_private']) || ($item['uid'] == local_channel() && $acl->is_private()))
@@ -185,7 +185,7 @@ class ThreadItem {
$filer = ((($conv->get_profile_owner() == local_channel()) && (! array_key_exists('real_uid',$item))) ? t("Save to Folder") : false);
- $profile_avatar = $item['author']['xchan_photo_m'];
+ $profile_avatar = $item['author']['xchan_photo_s'];
$profile_link = chanlink_hash($item['author_xchan']);
$profile_name = $item['author']['xchan_name'];
@@ -506,7 +506,8 @@ class ThreadItem {
'contact_id' => (($contact) ? $contact['abook_id'] : ''),
'moderate' => ($item['item_blocked'] == ITEM_MODERATED),
'moderate_approve' => t('Approve'),
- 'moderate_delete' => t('Delete')
+ 'moderate_delete' => t('Delete'),
+ 'rtl' => in_array($item['lang'], rtl_languages())
);
@@ -873,7 +874,7 @@ class ThreadItem {
if($this->is_toplevel() && ($this->get_data_value('author_xchan') != $this->get_data_value('owner_xchan'))) {
$this->owner_url = chanlink_hash($this->data['owner']['xchan_hash']);
- $this->owner_photo = $this->data['owner']['xchan_photo_m'];
+ $this->owner_photo = $this->data['owner']['xchan_photo_s'];
$this->owner_name = $this->data['owner']['xchan_name'];
$this->wall_to_wall = true;
}
diff --git a/Zotlabs/Lib/Zotfinger.php b/Zotlabs/Lib/Zotfinger.php
index fa57ab56d..ccf64d6d1 100644
--- a/Zotlabs/Lib/Zotfinger.php
+++ b/Zotlabs/Lib/Zotfinger.php
@@ -35,9 +35,13 @@ class Zotfinger {
$result = [];
$redirects = 0;
+
+ $start_timestamp = microtime(true);
$x = z_post_url($resource,$data,$redirects, [ 'headers' => $h ] );
+ logger('logger_stats_data cmd:Zotfinger' . ' start:' . $start_timestamp . ' ' . 'end:' . microtime(true) . ' meta:' . $resource . '#' . random_string(16));
+ btlogger('Zotfinger');
- logger('fetch: ' . print_r($x,true));
+ logger('fetch: ' . print_r($x,true), LOGGER_DATA);
if (in_array(intval($x['return_code']), [ 404, 410 ]) && $recurse) {
@@ -74,7 +78,7 @@ class Zotfinger {
$result['data'] = json_decode(Crypto::unencapsulate($result['data'],get_config('system','prvkey')),true);
}
- logger('decrypted: ' . print_r($result,true));
+ logger('decrypted: ' . print_r($result,true), LOGGER_DATA);
return $result;
}