diff options
-rw-r--r-- | CHANGELOG | 12 | ||||
-rw-r--r-- | Zotlabs/Identity/OAuth2Storage.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Articles.php | 12 | ||||
-rw-r--r-- | Zotlabs/Module/Network.php | 7 | ||||
-rw-r--r-- | Zotlabs/Module/Photo.php | 11 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Featured.php | 8 | ||||
-rw-r--r-- | Zotlabs/Module/Wiki.php | 4 | ||||
-rw-r--r-- | Zotlabs/Widget/Affinity.php | 9 | ||||
-rwxr-xr-x | boot.php | 2 | ||||
-rw-r--r-- | doc/hook/item_custom.bb | 24 | ||||
-rw-r--r-- | doc/hook/item_stored.bb | 18 | ||||
-rw-r--r-- | doc/hook/item_stored_update.bb | 15 | ||||
-rw-r--r-- | doc/hooklist.bb | 9 | ||||
-rwxr-xr-x | include/items.php | 30 | ||||
-rwxr-xr-x | include/plugin.php | 4 | ||||
-rwxr-xr-x | util/udall | 2 | ||||
-rwxr-xr-x | view/tpl/jot-header.tpl | 4 |
17 files changed, 156 insertions, 17 deletions
@@ -1,3 +1,15 @@ +Hubzilla 3.8.7 (2018-12-14) + - Fix issue with linkdropper in comment area + - Fix regression wit app ordering + - Fix return if readImnageBlob() throws an exception + - Introduce photo_view_filter hook + - Fix home notifications not expanding in certain situations + - Fix for dark schema + - Fix total identities restriction + - Fix article page title not updating if article has no title + - Gallery: the gallery app will now act as the full-size photo viewer in /photos if installed + + Hubzilla 3.8.6 (2018-12-03) - Prevent incompatible export files (osada/zap) from being imported - Catch exception if readImageBlob() receives bogus data diff --git a/Zotlabs/Identity/OAuth2Storage.php b/Zotlabs/Identity/OAuth2Storage.php index bbf61cf2b..a4ba9c526 100644 --- a/Zotlabs/Identity/OAuth2Storage.php +++ b/Zotlabs/Identity/OAuth2Storage.php @@ -64,7 +64,7 @@ class OAuth2Storage extends \OAuth2\Storage\Pdo { return( [ 'webfinger' => channel_reddress($x), 'portable_id' => $x['channel_hash'], - 'email' => $a['account_email'], + 'email' => $a[0]['account_email'], 'username' => $x['channel_address'], 'user_id' => $x['channel_id'], 'name' => $x['channel_name'], diff --git a/Zotlabs/Module/Articles.php b/Zotlabs/Module/Articles.php index 58c16be45..ca132c01e 100644 --- a/Zotlabs/Module/Articles.php +++ b/Zotlabs/Module/Articles.php @@ -17,8 +17,16 @@ class Articles extends Controller { if(argc() > 1) $which = argv(1); - else - return; + + if(! $which) { + if(local_channel()) { + $channel = App::get_channel(); + if($channel && $channel['channel_address']) + $which = $channel['channel_address']; + } else { + return; + } + } profile_load($which); diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index b93faa612..d5cc06d09 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -132,6 +132,13 @@ class Network extends \Zotlabs\Web\Controller { $deftag = ''; + if (feature_enabled(local_channel(),'affinity')) { + $affinity_locked = intval(get_pconfig(local_channel(),'affinity','lock',1)); + if ($affinity_locked) { + set_pconfig(local_channel(),'affinity','cmin',$cmin); + set_pconfig(local_channel(),'affinity','cmax',$cmax); + } + } if(x($_GET,'search') || $file || (!$pf && $cid) || $hashtags || $verb || $category || $conv || $unseen) $nouveau = true; diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index ddff3a68e..e236cc5f4 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -32,7 +32,7 @@ class Photo extends \Zotlabs\Web\Controller { } $cache_mode = array( - 'on' => get_config('system','photo_cache_enable', 0), + 'on' => false, 'age' => 86400, 'exp' => true, 'leak' => false @@ -159,13 +159,14 @@ class Photo extends \Zotlabs\Web\Controller { // Validate cache $cache = array( 'resid' => $photo, - 'uid' => $r[0]['uid'], - 'status' => false + 'url' => htmlspecialchars_decode($r[0]['display_path']) ); if($cache_mode['on']) call_hooks('cache_url_hook', $cache); - if(! $cache['status']) { - header("Location: " . htmlspecialchars_decode($r[0]['display_path'])); + if($cache['url'] != '') { + if(strpos(z_root(),'https:') !== false && strpos($cache['url'],'https:') === false) + $cache['url'] = z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($cache['url']); + header("Location: " . $cache['url']); killme(); } } diff --git a/Zotlabs/Module/Settings/Featured.php b/Zotlabs/Module/Settings/Featured.php index 542a05363..1d903fcf7 100644 --- a/Zotlabs/Module/Settings/Featured.php +++ b/Zotlabs/Module/Settings/Featured.php @@ -17,8 +17,12 @@ class Featured { $cmin = intval($_POST['affinity_cmin']); if($cmin < 0 || $cmin > 99) $cmin = 0; + + $lock = ($_POST['affinity_lock']) ? intval($_POST['affinity_lock']) : 1; + set_pconfig(local_channel(),'affinity','cmin',$cmin); set_pconfig(local_channel(),'affinity','cmax',$cmax); + set_pconfig(local_channel(),'affinity','lock',$lock); info( t('Affinity Slider settings updated.') . EOL); @@ -49,6 +53,10 @@ class Featured { $setting_fields .= replace_macros(get_markup_template('field_input.tpl'), array( '$field' => array('affinity_cmin', t('Default minimum affinity level'), $cmin, t('0-99 - default 0')) )); + $lock = intval(get_pconfig(local_channel(),'affinity','lock',1)); + $setting_fields .= replace_macros(get_markup_template('field_checkbox.tpl'), array( + '$field' => array('affinity_lock', t('Always reset on new page visit.'), $lock, t('default: yes'), Array('No','Yes')) + )); $settings_addons .= replace_macros(get_markup_template('generic_addon_settings.tpl'), array( '$addon' => array('affinity_slider', '' . t('Affinity Slider Settings'), '', t('Submit')), diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index 892810241..502f96a62 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -442,8 +442,8 @@ class Wiki extends Controller { $mimeType = $_POST['mimetype']; if($mimeType === 'text/bbcode') { - $linkconverted = NativeWikiPage::convert_links($content,$wikiURL); - $html = zidify_links(smilies(bbcode($linkconverted))); + $html = zidify_links(smilies(bbcode($content))); + $html = NativeWikiPage::convert_links($html,$wikiURL); } elseif($mimeType === 'text/markdown') { $linkconverted = NativeWikiPage::convert_links($content,$wikiURL); diff --git a/Zotlabs/Widget/Affinity.php b/Zotlabs/Widget/Affinity.php index 4fb2874ae..28190e187 100644 --- a/Zotlabs/Widget/Affinity.php +++ b/Zotlabs/Widget/Affinity.php @@ -15,9 +15,14 @@ class Affinity { $cmin = ((x($_REQUEST,'cmin')) ? intval($_REQUEST['cmin']) : $default_cmin); $cmax = ((x($_REQUEST,'cmax')) ? intval($_REQUEST['cmax']) : $default_cmax); - if(feature_enabled(local_channel(),'affinity')) { + $affinity_locked = intval(get_pconfig(local_channel(),'affinity','lock',1)); + if ($affinity_locked) { + set_pconfig(local_channel(),'affinity','cmin',$cmin); + set_pconfig(local_channel(),'affinity','cmax',$cmax); + } + $labels = array( t('Me'), t('Family'), @@ -53,4 +58,4 @@ class Affinity { return ''; } } -
\ No newline at end of file + @@ -576,6 +576,8 @@ define ( 'ITEM_TYPE_BUG', 4 ); define ( 'ITEM_TYPE_DOC', 5 ); define ( 'ITEM_TYPE_CARD', 6 ); define ( 'ITEM_TYPE_ARTICLE', 7 ); +//OSADA ITEM_TYPE_MAIL = 8 +define ( 'ITEM_TYPE_CUSTOM', 9 ); define ( 'ITEM_IS_STICKY', 1000 ); diff --git a/doc/hook/item_custom.bb b/doc/hook/item_custom.bb new file mode 100644 index 000000000..d20c7d76c --- /dev/null +++ b/doc/hook/item_custom.bb @@ -0,0 +1,24 @@ +[h2]item_custom[/h2] + +Allow addons to create and process custom item types. + +Addon authors will need to use iconfig meta data (with sharing on) or some other method +to specify and determine whether the custom item is destined for their addon. + +It is fed an array of ['item' => ${item_array}, 'allow_exec' => {true/false}] + +By default $arr['item']['cancel'] is set to TRUE which will abort storage of the +custom item in the item table unless the addon unsets it or sets it to false. + +[code] + if ($arr['item_type']==ITEM_TYPE_CUSTOM) { + /* Custom items are not stored by default + because they require an addon to process. */ + $d['item']['cancel']=true; + + call_hooks('item_custom',$d); + } + +[/code] + +see: include/items.php diff --git a/doc/hook/item_stored.bb b/doc/hook/item_stored.bb new file mode 100644 index 000000000..8d706cb4e --- /dev/null +++ b/doc/hook/item_stored.bb @@ -0,0 +1,18 @@ +[h2]item_stored[/h2] + +Allow addons to continue processing after an item has been stored in the event +that they need access to the item_id or other data that gets assigned during +the storage process. + +It is fed an array of type item (including terms and iconfig data). + +[code] + /** + * @hooks item_stored + * Called after new item is stored in the database. + * (By this time we have an item_id and other frequently needed info.) + */ + call_hooks('item_stored',$arr); +[/code] + +see: include/items.php diff --git a/doc/hook/item_stored_update.bb b/doc/hook/item_stored_update.bb new file mode 100644 index 000000000..4532a347c --- /dev/null +++ b/doc/hook/item_stored_update.bb @@ -0,0 +1,15 @@ +[h2]item_stored_update[/h2] + +Allow addons to continue processing after an item update has been stored + +It is fed an array of type item (including terms and iconfig data). + +[code] + /** + * @hooks item_stored_update + * Called after updated item is stored in the database. + */ + call_hooks('item_stored_update',$arr); +[/code] + +see: include/items.php diff --git a/doc/hooklist.bb b/doc/hooklist.bb index 5d12a139e..08fc587e2 100644 --- a/doc/hooklist.bb +++ b/doc/hooklist.bb @@ -343,9 +343,18 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the [zrl=[baseurl]/help/hook/item_store]item_store[/zrl] Called when item_store() stores a record of type item +[zrl=[baseurl]/help/hook/item_stored]item_stored[/zrl] + Called after item_store() has stored a record of type item in the database. + +[zrl=[baseurl]/help/hook/item_custom]item_custom[/zrl] + Called before item_store() stores a record of type item (allowing addons to process ITEM_TYPE_CUSTOM items). + [zrl=[baseurl]/help/hook/item_store_update]item_store_update[/zrl] Called when item_store_update() is called to update a stored item. +[zrl=[baseurl]/help/hook/item_stored_update]item_stored_update[/zrl] + Called after item_store_update() has updated a stored item. + [zrl=[baseurl]/help/hook/item_translate]item_translate[/zrl] Called from item_store and item_store_update after the post language has been autodetected diff --git a/include/items.php b/include/items.php index 0cbca23fc..02d31fcb5 100755 --- a/include/items.php +++ b/include/items.php @@ -1591,6 +1591,14 @@ function item_store($arr, $allow_exec = false, $deliver = true) { 'item' => $arr, 'allow_exec' => $allow_exec ]; + + if ($arr['item_type']==ITEM_TYPE_CUSTOM) { + /* Custom items are not stored by default + because they require an addon to process. */ + $d['item']['cancel']=true; + + call_hooks('item_custom',$d); + } /** * @hooks item_store * Called when item_store() stores a record of type item. @@ -2016,6 +2024,13 @@ function item_store($arr, $allow_exec = false, $deliver = true) { */ call_hooks('post_remote_end', $arr); + /** + * @hooks item_stored + * Called after new item is stored in the database. + * (By this time we have an item_id and other frequently needed info.) + */ + call_hooks('item_stored',$arr); + item_update_parent_commented($arr); // If _creating_ a deleted item, don't propagate it further or send out notifications. @@ -2049,6 +2064,15 @@ function item_store_update($arr, $allow_exec = false, $deliver = true) { 'item' => $arr, 'allow_exec' => $allow_exec ]; + + if ($arr['item_type']==ITEM_TYPE_CUSTOM) { + /* Custom items are not stored by default + because they require an addon to process. */ + $d['item']['cancel']=true; + + call_hooks('item_custom_update',$d); + } + /** * @hooks item_store_update * Called when item_store_update() is called to update a stored item. It @@ -2339,6 +2363,12 @@ function item_store_update($arr, $allow_exec = false, $deliver = true) { */ call_hooks('post_remote_update_end', $arr); + /** + * @hooks item_stored_update + * Called after updated item is stored in the database. + */ + call_hooks('item_stored_update',$arr); + if($deliver) { send_status_notifications($orig_post_id,$arr); tag_deliver($uid,$orig_post_id); diff --git a/include/plugin.php b/include/plugin.php index 8ceb6417e..7eeb39ce8 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -736,8 +736,8 @@ function get_theme_info($theme){ 'description' => '', 'author' => array(), 'version' => '', - 'minversion' => '', - 'maxversion' => '', + 'minversion' => STD_VERSION, + 'maxversion' => STD_VERSION, 'compat' => '', 'credits' => '', 'maintainer' => array(), diff --git a/util/udall b/util/udall index f1d52a1d1..44f37e86e 100755 --- a/util/udall +++ b/util/udall @@ -7,7 +7,7 @@ git pull if [ -d extend ] ; then for a in theme addon widget ; do - if [ -d $a ]; then + if [ -d extend/$a ]; then for b in `ls extend/$a` ; do echo Updating $b 'util/update_'$a'_repo' $b diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 2670ba9e7..b286b6071 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -219,7 +219,7 @@ var activeCommentText = ''; } function linkdropper(event) { - var linkFound = event.dataTransfer.types.contains("text/uri-list"); + var linkFound = ((event.dataTransfer.types.indexOf("text/uri-list") > -1) ? true : false); if(linkFound) { event.preventDefault(); var editwin = '#' + event.target.id; @@ -256,7 +256,7 @@ var activeCommentText = ''; commentwin = ((editwin.indexOf('comment') >= 0) ? true : false); if(commentwin) { var commentid = editwin.substring(editwin.lastIndexOf('-') + 1); - commentOpen(document.getElementById(event.target.id),commentid); + $("#comment-edit-text-" + commentid).addClass("expanded"); } } |