diff options
-rw-r--r-- | Zotlabs/Module/Display.php | 3 | ||||
-rw-r--r-- | Zotlabs/Module/New_channel.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Photos.php | 13 | ||||
-rw-r--r-- | Zotlabs/Module/Ping.php | 6 | ||||
-rw-r--r-- | Zotlabs/Module/Rmagic.php | 18 | ||||
-rwxr-xr-x | boot.php | 1 | ||||
-rw-r--r-- | doc/hook/photo_view_filter.bb | 1 | ||||
-rw-r--r-- | doc/hooklist.bb | 3 | ||||
-rw-r--r-- | include/network.php | 29 | ||||
-rw-r--r-- | include/photo/photo_imagick.php | 1 | ||||
-rw-r--r-- | view/theme/redbasic/schema/dark.css | 19 | ||||
-rwxr-xr-x | view/tpl/photo_view.tpl | 2 |
12 files changed, 90 insertions, 8 deletions
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index d1755c183..e3691702d 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -375,8 +375,7 @@ class Display extends \Zotlabs\Web\Controller { } $o .= '</noscript>'; - if ($items[0]['title']) - \App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title']; + \App::$page['title'] = (($items[0]['title']) ? $items[0]['title'] . " - " . \App::$page['title'] : \App::$page['title']); $o .= conversation($items, 'display', $update, 'client'); } diff --git a/Zotlabs/Module/New_channel.php b/Zotlabs/Module/New_channel.php index a9022a03a..73cdf4c8c 100644 --- a/Zotlabs/Module/New_channel.php +++ b/Zotlabs/Module/New_channel.php @@ -145,7 +145,7 @@ class New_channel extends \Zotlabs\Web\Controller { $canadd = true; if($r && ($limit !== false)) { $channel_usage_message = sprintf( t("You have created %1$.0f of %2$.0f allowed channels."), $r[0]['total'], $limit); - if ($r[0]['total'] >= $limit) { + if ($r[0]['total'] > $limit) { $canadd = false; } } diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index 21f6293ef..b87c586da 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -1122,6 +1122,7 @@ class Photos extends \Zotlabs\Web\Controller { $comments = ''; if(! $r) { if($observer && ($can_post || $can_comment)) { + $feature_auto_save_draft = ((feature_enabled($owner_uid, 'auto_save_draft')) ? "true" : "false"); $commentbox = replace_macros($cmnt_tpl,array( '$return_path' => '', '$mode' => 'photos', @@ -1137,7 +1138,8 @@ class Photos extends \Zotlabs\Web\Controller { '$submit' => t('Submit'), '$preview' => t('Preview'), '$ww' => '', - '$feature_encrypt' => false + '$feature_encrypt' => false, + '$auto_save_draft' => $feature_auto_save_draft )); } } @@ -1270,8 +1272,14 @@ class Photos extends \Zotlabs\Web\Controller { if(feature_enabled($owner_uid,'dislike')) $response_verbs[] = 'dislike'; - $responses = get_responses($conv_responses,$response_verbs,'',$link_item); + + $hookdata = [ + 'onclick' => '$.colorbox({href: \'' . $photo['href'] . '\'}); return false;', + 'raw_photo' => $ph[0], + 'nickname' => \App::$data['channel']['channel_address'] + ]; + call_hooks('photo_view_filter', $hookdata); $photo_tpl = get_markup_template('photo_view.tpl'); $o .= replace_macros($photo_tpl, array( @@ -1309,6 +1317,7 @@ class Photos extends \Zotlabs\Web\Controller { '$comments' => $comments, '$commentbox' => $commentbox, '$paginate' => $paginate, + '$onclick' => $hookdata['onclick'] )); \App::$data['photo_html'] = $o; diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php index 12244d88c..a367b1062 100644 --- a/Zotlabs/Module/Ping.php +++ b/Zotlabs/Module/Ping.php @@ -347,6 +347,10 @@ class Ping extends \Zotlabs\Web\Controller { if(argc() > 1 && (argv(1) === 'network' || argv(1) === 'home')) { $result = array(); + if(argv(1) === 'home') { + $sql_extra .= ' and item_wall = 1 '; + } + $r = q("SELECT * FROM item WHERE uid = %d AND item_unseen = 1 @@ -362,8 +366,6 @@ class Ping extends \Zotlabs\Web\Controller { if($r) { xchan_query($r); foreach($r as $item) { - if((argv(1) === 'home') && (! intval($item['item_wall']))) - continue; $result[] = \Zotlabs\Lib\Enotify::format($item); } } diff --git a/Zotlabs/Module/Rmagic.php b/Zotlabs/Module/Rmagic.php index 33a6689ca..8c1e5cdab 100644 --- a/Zotlabs/Module/Rmagic.php +++ b/Zotlabs/Module/Rmagic.php @@ -14,6 +14,15 @@ class Rmagic extends \Zotlabs\Web\Controller { $r = q("select hubloc_url from hubloc where hubloc_addr = '%s' limit 1", dbesc($me) ); + if(! $r) { + $w = discover_by_webbie($me); + if($w) { + $r = q("select hubloc_url from hubloc where hubloc_addr = '%s' limit 1", + dbesc($me) + ); + } + } + if($r) { if($r[0]['hubloc_url'] === z_root()) goaway(z_root() . '/login'); @@ -49,7 +58,16 @@ class Rmagic extends \Zotlabs\Web\Controller { $r = q("select hubloc_url from hubloc where hubloc_addr = '%s' limit 1", dbesc($address) ); + if(! $r) { + $w = discover_by_webbie($address); + if($w) { + $r = q("select hubloc_url from hubloc where hubloc_addr = '%s' limit 1", + dbesc($address) + ); + } + } } + if($r) { $url = $r[0]['hubloc_url']; } @@ -439,6 +439,7 @@ define ( 'TERM_OBJ_APP', 7 ); * various namespaces we may need to parse */ define ( 'PROTOCOL_ZOT', 'http://purl.org/zot/protocol' ); +define ( 'PROTOCOL_ZOT6', 'http://purl.org/zot/protocol/6.0' ); define ( 'NAMESPACE_ZOT', 'http://purl.org/zot' ); define ( 'NAMESPACE_DFRN' , 'http://purl.org/macgirvin/dfrn/1.0' ); define ( 'NAMESPACE_THREAD' , 'http://purl.org/syndication/thread/1.0' ); diff --git a/doc/hook/photo_view_filter.bb b/doc/hook/photo_view_filter.bb new file mode 100644 index 000000000..0780c1edc --- /dev/null +++ b/doc/hook/photo_view_filter.bb @@ -0,0 +1 @@ +[h2]photo_view_filter[/h2] diff --git a/doc/hooklist.bb b/doc/hooklist.bb index d104df380..5d12a139e 100644 --- a/doc/hooklist.bb +++ b/doc/hooklist.bb @@ -502,6 +502,9 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the [zrl=[baseurl]/help/hook/photo_upload_form]photo_upload_form[/zrl] Called when generating a photo upload form +[zrl=[baseurl]/help/hook/photo_view_filter]photo_view_filter[/zrl] + Called before the data is handed over to the photo_view template + [zrl=[baseurl]/help/hook/poke_verbs]poke_verbs[/zrl] Called when generating the list of actions for "poke" module diff --git a/include/network.php b/include/network.php index 183a47105..cd352e7db 100644 --- a/include/network.php +++ b/include/network.php @@ -1,4 +1,8 @@ <?php + +use Zotlabs\Lib\Zotfinger; +use Zotlabs\Lib\Libzot; + /** * @file include/network.php * @brief Network related functions. @@ -1196,6 +1200,31 @@ function discover_by_webbie($webbie, $protocol = '') { } } } + + foreach($x['links'] as $link) { + if(array_key_exists('rel',$link)) { + if($link['rel'] === PROTOCOL_ZOT6 && ((! $protocol) || (strtolower($protocol) === 'zot6'))) { + logger('zot6 found for ' . $webbie, LOGGER_DEBUG); + $record = Zotfinger::exec($link['href']); + + // Check the HTTP signature + + $hsig = $record['signature']; + if($hsig && ($hsig['signer'] === $url || $hsig['signer'] === $link['href']) && $hsig['header_valid'] === true && $hsig['content_valid'] === true) + $hsig_valid = true; + + if(! $hsig_valid) { + logger('http signature not valid: ' . print_r($hsig,true)); + continue; + } + + $x = Libzot::import_xchan($record['data']); + if($x['success']) { + return $x['hash']; + } + } + } + } } logger('webfinger: ' . print_r($x,true), LOGGER_DATA, LOG_INFO); diff --git a/include/photo/photo_imagick.php b/include/photo/photo_imagick.php index f04c00245..cb3ad27fb 100644 --- a/include/photo/photo_imagick.php +++ b/include/photo/photo_imagick.php @@ -36,6 +36,7 @@ class photo_imagick extends photo_driver { } catch (Exception $e) { logger('imagick readImageBlob() exception:' . print_r($e,true)); + return; } /** diff --git a/view/theme/redbasic/schema/dark.css b/view/theme/redbasic/schema/dark.css index 71f7bc393..e958d9ee7 100644 --- a/view/theme/redbasic/schema/dark.css +++ b/view/theme/redbasic/schema/dark.css @@ -326,6 +326,17 @@ a.text-dark:focus, a.text-dark:hover { color: #ddd !important; } +.badge-warning { + background-color: #ffc927; +} +.badge-warning a.text-dark { + color: #333 !important; +} +.badge-warning a.text-dark:focus, .badge-warning a.text-dark:hover { + color: red !important; + text-decoration: none; +} + .group-selected, .fileas-selected, .categories-selected, .search-selected, a.active { color: #fff !important; text-decoration: underline !important; @@ -480,3 +491,11 @@ pre { .widget-nav-pills-checkbox:hover + a { background-color: #222; } + +/* change color of [hl] tag: */ +div.wall-item-body span /*strong:only-of-type */{ + color: #1212b6; + padding: 2px 3px; +/* font-weight: 500; */ + white-space: nowrap; +} diff --git a/view/tpl/photo_view.tpl b/view/tpl/photo_view.tpl index 105cf0ac8..6d566cab9 100755 --- a/view/tpl/photo_view.tpl +++ b/view/tpl/photo_view.tpl @@ -99,7 +99,7 @@ <div id="photo-edit-end" class="clear"></div> </div> <div id="photo-view-wrapper"> - <div id="photo-photo"><a href="{{$photo.href}}" title="{{$photo.title}}" onclick="$.colorbox({href: '{{$photo.href}}'}); return false;"><img style="width: 100%;" src="{{$photo.src}}"></a></div> + <div id="photo-photo"><a href="{{$photo.href}}" title="{{$photo.title}}" onclick="{{$onclick}}"><img style="width: 100%;" src="{{$photo.src}}"></a></div> <div id="photo-photo-end" class="clear"></div> {{if $tags}} <div class="photo-item-tools-left" id="in-this-photo"> |