From 87668f7fa8b22526918463bda7602d138385cc35 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 3 Jul 2019 22:13:14 +0200 Subject: fix typo --- Zotlabs/Module/Dirsearch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Dirsearch.php b/Zotlabs/Module/Dirsearch.php index 26cb82044..92b33df0c 100644 --- a/Zotlabs/Module/Dirsearch.php +++ b/Zotlabs/Module/Dirsearch.php @@ -394,7 +394,7 @@ class Dirsearch extends \Zotlabs\Web\Controller { $quoted_string = false; } else - $curr['value'] .= ' ' . trim(q); + $curr['value'] .= ' ' . trim($q); } } } -- cgit v1.2.3 From 407b02bde8cc8492eefc9260c8ae6becfee2211a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 11 Jul 2019 11:12:27 +0200 Subject: calendar: revert back to UTC strings for dates due to better legibility. Strip timezone info from UTC string and always treat values as UTC. --- Zotlabs/Module/Cdav.php | 12 ++++++------ Zotlabs/Module/Channel_calendar.php | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Cdav.php b/Zotlabs/Module/Cdav.php index b199019c1..e2855d2b6 100644 --- a/Zotlabs/Module/Cdav.php +++ b/Zotlabs/Module/Cdav.php @@ -278,11 +278,11 @@ class Cdav extends Controller { $allday = $_REQUEST['allday']; $title = $_REQUEST['title']; - $start = datetime_convert($tz, 'UTC', $_REQUEST['dtstart']); + $start = datetime_convert('UTC', 'UTC', $_REQUEST['dtstart']); $dtstart = new \DateTime($start); if($_REQUEST['dtend']) { - $end = datetime_convert($tz, 'UTC', $_REQUEST['dtend']); + $end = datetime_convert('UTC', 'UTC', $_REQUEST['dtend']); $dtend = new \DateTime($end); } $description = $_REQUEST['description']; @@ -369,10 +369,10 @@ class Cdav extends Controller { $uri = $_REQUEST['uri']; $title = $_REQUEST['title']; - $start = datetime_convert($tz, 'UTC', $_REQUEST['dtstart']); + $start = datetime_convert('UTC', 'UTC', $_REQUEST['dtstart']); $dtstart = new \DateTime($start); if($_REQUEST['dtend']) { - $end = datetime_convert($tz, 'UTC', $_REQUEST['dtend']); + $end = datetime_convert('UTC', 'UTC', $_REQUEST['dtend']); $dtend = new \DateTime($end); } $description = $_REQUEST['description']; @@ -442,10 +442,10 @@ class Cdav extends Controller { $allday = $_REQUEST['allday']; $uri = $_REQUEST['uri']; - $start = datetime_convert($tz, 'UTC', $_REQUEST['dtstart']); + $start = datetime_convert('UTC', 'UTC', $_REQUEST['dtstart']); $dtstart = new \DateTime($start); if($_REQUEST['dtend']) { - $end = datetime_convert($tz, 'UTC', $_REQUEST['dtend']); + $end = datetime_convert('UTC', 'UTC', $_REQUEST['dtend']); $dtend = new \DateTime($end); } diff --git a/Zotlabs/Module/Channel_calendar.php b/Zotlabs/Module/Channel_calendar.php index 109b18f37..7d75a7e41 100644 --- a/Zotlabs/Module/Channel_calendar.php +++ b/Zotlabs/Module/Channel_calendar.php @@ -21,7 +21,7 @@ class Channel_calendar extends \Zotlabs\Web\Controller { $event_hash = ((x($_POST,'event_hash')) ? $_POST['event_hash'] : ''); $xchan = ((x($_POST,'xchan')) ? dbesc($_POST['xchan']) : ''); - $uid = local_channel(); + $uid = local_channel(); // only allow editing your own events. if(($xchan) && ($xchan !== get_observer_hash())) @@ -34,8 +34,8 @@ class Channel_calendar extends \Zotlabs\Web\Controller { $adjust = intval($_POST['adjust']); - $start = (($adjust) ? datetime_convert($tz, 'UTC', escape_tags($_REQUEST['dtstart'])) : datetime_convert('UTC', 'UTC', escape_tags($_REQUEST['dtstart']))); - $finish = (($adjust) ? datetime_convert($tz, 'UTC', escape_tags($_REQUEST['dtend'])) : datetime_convert('UTC', 'UTC', escape_tags($_REQUEST['dtend']))); + $start = datetime_convert('UTC', 'UTC', escape_tags($_REQUEST['dtstart'])); + $finish = datetime_convert('UTC', 'UTC', escape_tags($_REQUEST['dtend'])); $summary = escape_tags(trim($_POST['summary'])); $desc = escape_tags(trim($_POST['desc'])); -- cgit v1.2.3 From dde7144f5acdebf2dfee18ba2848594d33e9d12b Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Mon, 15 Jul 2019 00:25:19 -0400 Subject: Hookify Zotlabs\Daemon\Master::Summon --- Zotlabs/Daemon/Master.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Daemon/Master.php b/Zotlabs/Daemon/Master.php index 857d47243..67a3acc0a 100644 --- a/Zotlabs/Daemon/Master.php +++ b/Zotlabs/Daemon/Master.php @@ -17,7 +17,22 @@ if(array_search( __file__ , get_included_files()) === 0) { class Master { static public function Summon($arr) { - proc_run('php','Zotlabs/Daemon/Master.php',$arr); + $hookinfo = [ + 'argv'=>$arr + ]; + + call_hooks ('daemon_master_summon',$hookinfo); + + $arr = $hookinfo['argv']; + $argc = count($arr); + + if ((!is_array($arr) || (count($arr) < 1))) { + logger("Summon handled by hook.",LOGGER_DEBUG); + return; + } + + $phpbin = get_config('system','phpbin','php'); + proc_run($phpbin,'Zotlabs/Daemon/Master.php',$arr); } static public function Release($argc,$argv) { @@ -33,6 +48,7 @@ class Master { $argc = count($argv); if ((!is_array($argv) || (count($argv) < 1))) { + logger("Release handled by hook.",LOGGER_DEBUG); return; } -- cgit v1.2.3 From a6f06c2d943cabc4475fa8de67e0cd03725d475e Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 15 Jul 2019 10:57:04 +0200 Subject: Fix ETag quotes --- Zotlabs/Module/Photo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index a53b00282..59dc709e1 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -222,7 +222,7 @@ class Photo extends \Zotlabs\Web\Controller { if(! $data) killme(); - $etag = md5($data . $modified); + $etag = '"' . md5($data . $modified) . '"'; if($modified == 0) $modified = time(); -- cgit v1.2.3 From f94faeeace0df51b223f7a6da164071affc3ea37 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 17 Jul 2019 23:36:41 +0200 Subject: streamline keyId and creator/actor --- Zotlabs/Lib/LDSignatures.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/LDSignatures.php b/Zotlabs/Lib/LDSignatures.php index 6d7127cde..b13c4cf4a 100644 --- a/Zotlabs/Lib/LDSignatures.php +++ b/Zotlabs/Lib/LDSignatures.php @@ -29,7 +29,7 @@ class LDSignatures { $options = [ 'type' => 'RsaSignature2017', 'nonce' => random_string(64), - 'creator' => z_root() . '/channel/' . $channel['channel_address'] . '/public_key_pem', + 'creator' => z_root() . '/channel/' . $channel['channel_address'], 'created' => datetime_convert('UTC','UTC', 'now', 'Y-m-d\Th:i:s\Z') ]; @@ -124,7 +124,7 @@ class LDSignatures { 'meDataType' => $data_type, 'meEncoding' => $encoding, 'meAlgorithm' => $algorithm, - 'meCreator' => z_root() . '/channel/' . $channel['channel_address'] . '/public_key_pem', + 'meCreator' => z_root() . '/channel/' . $channel['channel_address'], 'meSignatureValue' => $signature ]); @@ -132,4 +132,4 @@ class LDSignatures { -} \ No newline at end of file +} -- cgit v1.2.3 From 71056e1db11caf7b30627bbdc5c44c21405966ae Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 18 Jul 2019 13:02:19 +0200 Subject: fix issue with encoding hashtags and silence parent fetch logging --- Zotlabs/Lib/Activity.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 8168e7354..bd84d877e 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -392,9 +392,9 @@ class Activity { foreach($item['term'] as $t) { switch($t['ttype']) { case TERM_HASHTAG: - // An id is required so if we don't have a url in the taxonomy, ignore it and keep going. + // href is required so if we don't have a url in the taxonomy, ignore it and keep going. if($t['url']) { - $ret[] = [ 'id' => $t['url'], 'name' => '#' . $t['term'] ]; + $ret[] = [ 'type' => 'Hashtag', 'href' => $t['url'], 'name' => '#' . $t['term'] ]; } break; @@ -2025,7 +2025,7 @@ class Activity { } $a = new ActivityStreams($n); - logger($a->debug()); + //logger($a->debug()); if(! $a->is_valid()) { break; -- cgit v1.2.3 From 8ced3699c21bd76f1a1f3c08b97dd7bf41d3e88a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 18 Jul 2019 13:52:39 +0200 Subject: fallback to id if href is not available --- Zotlabs/Lib/Activity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index bd84d877e..520c456cc 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -361,7 +361,7 @@ class Activity { switch($t['type']) { case 'Hashtag': - $ret[] = [ 'ttype' => TERM_HASHTAG, 'url' => $t['href'], 'term' => escape_tags((substr($t['name'],0,1) === '#') ? substr($t['name'],1) : $t['name']) ]; + $ret[] = [ 'ttype' => TERM_HASHTAG, 'url' => ((isset($t['href'])) ? $t['href'] : $t['id']), 'term' => escape_tags((substr($t['name'],0,1) === '#') ? substr($t['name'],1) : $t['name']) ]; break; case 'Mention': -- cgit v1.2.3 From 6ca7527ec9043571525187c0d33e75f03c5a8e1b Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 18 Jul 2019 14:19:32 +0200 Subject: add hashtag to appschema and bump appschema rev --- Zotlabs/Module/Apschema.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Apschema.php b/Zotlabs/Module/Apschema.php index 12cc0e00a..756057a8a 100644 --- a/Zotlabs/Module/Apschema.php +++ b/Zotlabs/Module/Apschema.php @@ -44,7 +44,9 @@ class Apschema extends \Zotlabs\Web\Controller { 'conversation' => 'ostatus:conversation', 'diaspora' => 'https://diasporafoundation.org/ns/', - 'guid' => 'diaspora:guid' + 'guid' => 'diaspora:guid', + + 'Hashtag' => 'as:Hashtag' ] ]; @@ -58,4 +60,4 @@ class Apschema extends \Zotlabs\Web\Controller { -} \ No newline at end of file +} -- cgit v1.2.3 From ad58697521dcdca8f4f38db9f69588d7d27df486 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 19 Jul 2019 18:45:34 +0200 Subject: move image attachments to the top --- Zotlabs/Lib/Activity.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 520c456cc..0808228a6 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -1769,14 +1769,14 @@ class Activity { } foreach($ptr as $vurl) { if(strpos($s['body'],$vurl['href']) === false) { - $s['body'] .= "\n\n" . '[zmg]' . $vurl['href'] . '[/zmg]'; + $s['body'] .= '[zmg]' . $vurl['href'] . '[/zmg]' . "\n\n" . $s['body']; break; } } } elseif(is_string($act->obj['url'])) { if(strpos($s['body'],$act->obj['url']) === false) { - $s['body'] .= "\n\n" . '[zmg]' . $act->obj['url'] . '[/zmg]'; + $s['body'] .= '[zmg]' . $act->obj['url'] . '[/zmg]' . "\n\n" . $s['body']; } } } -- cgit v1.2.3 From 81ecea29c839c8f914be59acbddd4955673ee2f6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 22 Jul 2019 19:11:52 +0200 Subject: reflect repeats in notifications, use force flag for import_xchan_photo() in cron --- Zotlabs/Daemon/Cron.php | 2 +- Zotlabs/Lib/Enotify.php | 17 ++++++++++++----- Zotlabs/Module/Share.php | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php index c99892ffb..fe356bcbf 100644 --- a/Zotlabs/Daemon/Cron.php +++ b/Zotlabs/Daemon/Cron.php @@ -188,7 +188,7 @@ class Cron { if($r) { require_once('include/photo/photo_driver.php'); foreach($r as $rr) { - $photos = import_xchan_photo($rr['xchan_photo_l'],$rr['xchan_hash']); + $photos = import_xchan_photo($rr['xchan_photo_l'], $rr['xchan_hash'], false, true); $x = q("update xchan set xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s' where xchan_hash = '%s'", dbesc($photos[0]), diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index a7082f45a..92a488f67 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -807,6 +807,11 @@ class Enotify { $itemem_text = (($item['item_thread_top']) ? t('created a new post') : sprintf( t('commented on %s\'s post'), $item['owner']['xchan_name'])); + + if($item['verb'] === ACTIVITY_SHARE) { + $itemem_text = sprintf( t('repeated %s\'s post'), $item['author']['xchan_name']); + } + } $edit = false; @@ -825,12 +830,14 @@ class Enotify { // convert this logic into a json array just like the system notifications + $who = (($item['verb'] === ACTIVITY_SHARE) ? 'owner' : 'author'); + $x = array( 'notify_link' => $item['llink'], - 'name' => $item['author']['xchan_name'], - 'addr' => (($item['author']['xchan_addr']) ? $item['author']['xchan_addr'] : $item['author']['xchan_url']), - 'url' => $item['author']['xchan_url'], - 'photo' => $item['author']['xchan_photo_s'], + 'name' => $item[$who]['xchan_name'], + 'addr' => (($item[$who]['xchan_addr']) ? $item[$who]['xchan_addr'] : $item[$who]['xchan_url']), + 'url' => $item[$who]['xchan_url'], + 'photo' => $item[$who]['xchan_photo_s'], 'when' => relative_date(($edit)? $item['edited'] : $item['created']), 'class' => (intval($item['item_unseen']) ? 'notify-unseen' : 'notify-seen'), 'b64mid' => ((in_array($item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) ? 'b64.' . base64url_encode($item['thr_parent']) : 'b64.' . base64url_encode($item['mid'])), @@ -838,7 +845,7 @@ class Enotify { 'thread_top' => (($item['item_thread_top']) ? true : false), 'message' => strip_tags(bbcode($itemem_text)), // these are for the superblock addon - 'hash' => $item['author']['xchan_hash'], + 'hash' => $item[$who]['xchan_hash'], 'uid' => local_channel(), 'display' => true ); diff --git a/Zotlabs/Module/Share.php b/Zotlabs/Module/Share.php index 53a06b072..a18a81937 100644 --- a/Zotlabs/Module/Share.php +++ b/Zotlabs/Module/Share.php @@ -106,7 +106,7 @@ class Share extends \Zotlabs\Web\Controller { $arr['owner_xchan'] = $item['author_xchan']; $arr['obj'] = Activity::encode_item($item); $arr['obj_type'] = $item['obj_type']; - $arr['verb'] = 'Announce'; + $arr['verb'] = ACTIVITY_SHARE; $post = item_store($arr); -- cgit v1.2.3