aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2016-02-12 06:28:40 +0100
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2016-02-12 06:28:40 +0100
commitac4a8fde3a662f4f8918177ae4e5decefdc2ad11 (patch)
treed8929c45e08c903ae92366756ce408d01a676e29
parent95c686de6edd5d5e6b85a5f283770441fb7852ea (diff)
parent31aaf40ade183c91e8691ef7361237f87d713fd2 (diff)
downloadvolse-hubzilla-ac4a8fde3a662f4f8918177ae4e5decefdc2ad11.tar.gz
volse-hubzilla-ac4a8fde3a662f4f8918177ae4e5decefdc2ad11.tar.bz2
volse-hubzilla-ac4a8fde3a662f4f8918177ae4e5decefdc2ad11.zip
Merge remote-tracking branch 'upstream/master'
-rwxr-xr-xboot.php3
-rwxr-xr-xinclude/dba/dba_driver.php1
-rwxr-xr-xinclude/items.php17
-rw-r--r--include/notifier.php34
-rwxr-xr-xinclude/plugin.php2
-rw-r--r--include/queue_fn.php2
-rw-r--r--library/readmore.js/readmore.js168
-rw-r--r--mod/feed.php2
-rw-r--r--mod/photos.php8
-rwxr-xr-xmod/setup.php2
-rw-r--r--version.inc2
11 files changed, 154 insertions, 87 deletions
diff --git a/boot.php b/boot.php
index cc46cf870..9729939e1 100755
--- a/boot.php
+++ b/boot.php
@@ -48,7 +48,7 @@ require_once('include/AccessList.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')));
-define ( 'STD_VERSION', '1.2.1' );
+define ( 'STD_VERSION', '1.2.2' );
define ( 'ZOT_REVISION', 1 );
define ( 'DB_UPDATE_VERSION', 1161 );
@@ -85,6 +85,7 @@ $DIRECTORY_FALLBACK_SERVERS = array(
'https://hubzilla.zottel.net',
'https://hub.pixelbits.de',
'https://my.federated.social',
+ 'https://blablanet.es',
'https://hubzilla.nl'
);
diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php
index 1fb3d5c00..2219b43cb 100755
--- a/include/dba/dba_driver.php
+++ b/include/dba/dba_driver.php
@@ -388,3 +388,4 @@ function db_getfunc($f) {
logger('Unable to abstract DB function "'. $f . '" for dbtype ' . ACTIVE_DBTYPE, LOGGER_DEBUG);
return $f;
}
+
diff --git a/include/items.php b/include/items.php
index 5361a5fde..1231b6209 100755
--- a/include/items.php
+++ b/include/items.php
@@ -552,6 +552,12 @@ function get_public_feed($channel, $params) {
$params['top'] = ((x($params,'top')) ? intval($params['top']) : 0);
$params['cat'] = ((x($params,'cat')) ? $params['cat'] : '');
+
+ // put a sane lower limit on feed requests if not specified
+
+ if($params['begin'] === NULL_DATE)
+ $params['begin'] = datetime_convert('UTC','UTC','now - 1 month');
+
switch($params['type']) {
case 'json':
header("Content-type: application/atom+json");
@@ -587,8 +593,8 @@ function get_feed_for($channel, $observer_hash, $params) {
}
$items = items_fetch(array(
'wall' => '1',
- 'datequery' => $params['begin'],
- 'datequery2' => $params['end'],
+ 'datequery' => $params['end'],
+ 'datequery2' => $params['begin'],
'start' => $params['start'], // FIXME
'records' => $params['records'], // FIXME
'direction' => $params['direction'], // FIXME
@@ -623,6 +629,7 @@ function get_feed_for($channel, $observer_hash, $params) {
'$community' => '',
));
+
call_hooks('atom_feed', $atom);
if($items) {
@@ -4901,15 +4908,15 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
}
if ($arr['datequery']) {
- $sql_extra3 .= protect_sprintf(sprintf(" AND item.created <= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$arr['datequery']))));
+ $sql_extra3 .= protect_sprintf(sprintf(" AND item.created <= '%s' ", dbesc(datetime_convert('UTC','UTC',$arr['datequery']))));
}
if ($arr['datequery2']) {
- $sql_extra3 .= protect_sprintf(sprintf(" AND item.created >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$arr['datequery2']))));
+ $sql_extra3 .= protect_sprintf(sprintf(" AND item.created >= '%s' ", dbesc(datetime_convert('UTC','UTC',$arr['datequery2']))));
}
if(! array_key_exists('nouveau',$arr)) {
$sql_extra2 = " AND item.parent = item.id ";
- $sql_extra3 = '';
+// $sql_extra3 = '';
}
if($arr['search']) {
diff --git a/include/notifier.php b/include/notifier.php
index 5260e629f..93cc77a1c 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -423,6 +423,7 @@ function notifier_run($argv, $argc){
$details = q("select xchan_hash, xchan_instance_url, xchan_network, xchan_addr, xchan_guid, xchan_guid_sig from xchan where xchan_hash in (" . implode(',',$recipients) . ")");
+
$recip_list = array();
if($details) {
@@ -437,12 +438,39 @@ function notifier_run($argv, $argc){
if(! $delivery_options)
format_and_send_email($channel,$d,$target_item);
}
+ }
+ }
-
- }
+ $narr = array(
+ 'channel' => $channel,
+ 'env_recips' => $env_recips,
+ 'packet_recips' => $packet_recips,
+ 'recipients' => $recipients,
+ 'item' => $item,
+ 'target_item' => $target_item,
+ 'top_level_post' => $top_level_post,
+ 'private' => $private,
+ 'followup' => $followup,
+ 'relay_to_owner' => $relay_to_owner,
+ 'uplink' => $uplink,
+ 'cmd' => $cmd,
+ 'mail' => $mail,
+ 'location' => $location,
+ 'request' => $request,
+ 'normal_mode' => $normal_mode,
+ 'packet_type' => $packet_type,
+ 'walltowall' => $walltowall,
+ 'queued' => array()
+ );
+
+ call_hooks('notifier_process', $narr);
+ if($narr['queued']) {
+ foreach($narr['queued'] as $pq)
+ $deliveries[] = $pq;
}
+
if(($private) && (! $env_recips)) {
// shouldn't happen
logger('notifier: private message with no envelope recipients.' . print_r($argv,true), LOGGER_NORMAL, LOG_NOTICE);
@@ -504,7 +532,7 @@ function notifier_run($argv, $argc){
}
logger('notifier: will notify/deliver to these hubs: ' . print_r($hublist,true), LOGGER_DEBUG, LOG_DEBUG);
-
+
foreach($dhubs as $hub) {
diff --git a/include/plugin.php b/include/plugin.php
index a47558b63..da4568ad7 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -291,7 +291,7 @@ function call_hooks($name, &$data = null) {
$func = $hook[1];
$func($a, $data);
} else {
- // remove orphan hooks
+
q("DELETE FROM hook WHERE hook = '%s' AND file = '%s' AND function = '%s'",
dbesc($name),
dbesc($hook[0]),
diff --git a/include/queue_fn.php b/include/queue_fn.php
index 0708aab56..3112a832b 100644
--- a/include/queue_fn.php
+++ b/include/queue_fn.php
@@ -101,7 +101,7 @@ function queue_deliver($outq, $immediate = false) {
}
}
- $arr = array('outq' => $outq, 'handled' => false, 'immediate' => $immediate);
+ $arr = array('outq' => $outq, 'base' => $base, 'handled' => false, 'immediate' => $immediate);
call_hooks('queue_deliver',$arr);
if($arr['handled'])
return;
diff --git a/library/readmore.js/readmore.js b/library/readmore.js/readmore.js
index d4c1cf723..fb5a0e0f9 100644
--- a/library/readmore.js/readmore.js
+++ b/library/readmore.js/readmore.js
@@ -11,7 +11,18 @@
/* global jQuery */
-(function($) {
+(function(factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD
+ define(['jquery'], factory);
+ } else if (typeof exports === 'object') {
+ // CommonJS
+ module.exports = factory(require('jquery'));
+ } else {
+ // Browser globals
+ factory(jQuery);
+ }
+}(function($) {
'use strict';
var readmore = 'readmore',
@@ -61,20 +72,19 @@
}
function setBoxHeights(element) {
- var el = element,
- expandedHeight = el.outerHeight(true),
+ var el = element.clone().css({
+ height: 'auto',
+ width: element.width(),
+ maxHeight: 'none',
+ overflow: 'hidden'
+ }).insertAfter(element),
+ expandedHeight = el.outerHeight(),
cssMaxHeight = parseInt(el.css({maxHeight: ''}).css('max-height').replace(/[^-\d\.]/g, ''), 10),
defaultHeight = element.data('defaultHeight');
-console.log("el height: " + expandedHeight);
- var collapsedHeight = element.data('collapsedHeight') || defaultHeight;
+ el.remove();
- if (!cssMaxHeight) {
- collapsedHeight = defaultHeight;
- }
- else if (cssMaxHeight > collapsedHeight) {
- collapsedHeight = cssMaxHeight;
- }
+ var collapsedHeight = cssMaxHeight || element.data('collapsedHeight') || defaultHeight;
// Store our measurements.
element.data({
@@ -137,69 +147,75 @@ console.log("el height: " + expandedHeight);
}
function Readmore(element, options) {
- var $this = this;
-
this.element = element;
this.options = $.extend({}, defaults, options);
- $(this.element).data({
- defaultHeight: this.options.collapsedHeight,
- heightMargin: this.options.heightMargin
- });
embedCSS(this.options);
this._defaults = defaults;
this._name = readmore;
- // Waiting for the page to load doesn't work when there is dynamic content
- // But usually we already have the content, so no need to wait
- //window.addEventListener('load', function() {
- $this.init();
- //});
+ this.init();
+
+ // IE8 chokes on `window.addEventListener`, so need to test for support.
+ if (window.addEventListener) {
+ // Need to resize boxes when the page has fully loaded.
+ window.addEventListener('load', resizeBoxes);
+ window.addEventListener('resize', resizeBoxes);
+ }
+ else {
+ window.attachEvent('load', resizeBoxes);
+ window.attachEvent('resize', resizeBoxes);
+ }
}
Readmore.prototype = {
init: function() {
- var $this = this;
+ var current = $(this.element);
- $(this.element).each(function() {
- var current = $(this);
+ current.data({
+ defaultHeight: this.options.collapsedHeight,
+ heightMargin: this.options.heightMargin
+ });
- setBoxHeights(current);
+ setBoxHeights(current);
- var collapsedHeight = current.data('collapsedHeight'),
- heightMargin = current.data('heightMargin');
+ var collapsedHeight = current.data('collapsedHeight'),
+ heightMargin = current.data('heightMargin');
- if (current.outerHeight(true) <= collapsedHeight + heightMargin) {
- // The block is shorter than the limit, so there's no need to truncate it.
- return true;
- }
- else {
- var id = current.attr('id') || uniqueId(),
- useLink = $this.options.startOpen ? $this.options.lessLink : $this.options.moreLink;
+ if (current.outerHeight(true) <= collapsedHeight + heightMargin) {
+ // The block is shorter than the limit, so there's no need to truncate it.
+ return true;
+ }
+ else {
+ var id = current.attr('id') || uniqueId(),
+ useLink = this.options.startOpen ? this.options.lessLink : this.options.moreLink;
- current.attr({
- 'data-readmore': '',
- 'aria-expanded': false,
- 'id': id
- });
+ current.attr({
+ 'data-readmore': '',
+ 'aria-expanded': this.options.startOpen,
+ 'id': id
+ });
+
+ current.after($(useLink)
+ .on('click', (function(_this) {
+ return function(event) {
+ _this.toggle(this, current[0], event);
+ };
+ })(this))
+ .attr({
+ 'data-readmore-toggle': '',
+ 'aria-controls': id
+ }));
- current.after($(useLink)
- .on('click', function(event) { $this.toggle(this, current[0], event); })
- .attr({
- 'data-readmore-toggle': '',
- 'aria-controls': id
- }));
-
- if (! $this.options.startOpen) {
- current.css({
- height: collapsedHeight
- });
- }
+ if (! this.options.startOpen) {
+ current.css({
+ height: collapsedHeight
+ });
}
- });
+ }
},
toggle: function(trigger, element, event) {
@@ -208,22 +224,21 @@ console.log("el height: " + expandedHeight);
}
if (! trigger) {
- trigger = $('[aria-controls="' + this.element.id + '"]')[0];
+ trigger = $('[aria-controls="' + _this.element.id + '"]')[0];
}
if (! element) {
- element = this.element;
+ element = _this.element;
}
- var $this = this,
- $element = $(element),
+ var $element = $(element),
newHeight = '',
newLink = '',
expanded = false,
collapsedHeight = $element.data('collapsedHeight');
if ($element.height() <= collapsedHeight) {
- newHeight = $element.data('expandedHeight') + 'px';
+ newHeight = 100 + '%';
newLink = 'lessLink';
expanded = true;
}
@@ -235,25 +250,31 @@ console.log("el height: " + expandedHeight);
// Fire beforeToggle callback
// Since we determined the new "expanded" state above we're now out of sync
// with our true current state, so we need to flip the value of `expanded`
- $this.options.beforeToggle(trigger, element, ! expanded);
+ this.options.beforeToggle(trigger, $element, ! expanded);
$element.css({'height': newHeight});
// Fire afterToggle callback
- $element.on('transitionend', function() {
- $this.options.afterToggle(trigger, element, expanded);
+ $element.on('transitionend', (function(_this) {
+ return function() {
+ _this.options.afterToggle(trigger, $element, expanded);
- $(this).attr({
- 'aria-expanded': expanded
- }).off('transitionend');
- });
-
- $(trigger).replaceWith($($this.options[newLink])
- .on('click', function(event) { $this.toggle(this, element, event); })
- .attr({
- 'data-readmore-toggle': '',
- 'aria-controls': $element.attr('id')
- }));
+ $(this).attr({
+ 'aria-expanded': expanded
+ }).off('transitionend');
+ }
+ })(this));
+
+ $(trigger).replaceWith($(this.options[newLink])
+ .on('click', (function(_this) {
+ return function(event) {
+ _this.toggle(this, element, event);
+ };
+ })(this))
+ .attr({
+ 'data-readmore-toggle': '',
+ 'aria-controls': $element.attr('id')
+ }));
},
destroy: function() {
@@ -305,6 +326,5 @@ console.log("el height: " + expandedHeight);
}
};
-})(jQuery);
-
+}));
diff --git a/mod/feed.php b/mod/feed.php
index eb72af9cf..087d3f827 100644
--- a/mod/feed.php
+++ b/mod/feed.php
@@ -31,7 +31,9 @@ function feed_init(&$a) {
killme();
logger('mod_feed: public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $channel['channel_address']);
+
echo get_public_feed($channel,$params);
+
killme();
}
diff --git a/mod/photos.php b/mod/photos.php
index d6105c580..944686637 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -603,6 +603,14 @@ function photos_content(&$a) {
$aclselect = (($_is_owner) ? populate_acl($channel_acl,false) : '');
+ // this is wrong but is to work around an issue with js_upload wherein it chokes if these variables
+ // don't exist. They really should be set to a parseable representation of the channel's default permissions
+ // which can be processed by getSelected()
+
+ if(! $aclselect) {
+ $aclselect = '<input id="group_allow" type="hidden" name="allow_gid[]" value="" /><input id="contact_allow" type="hidden" name="allow_cid[]" value="" /><input id="group_deny" type="hidden" name="deny_gid[]" value="" /><input id="contact_deny" type="hidden" name="deny_cid[]" value="" />';
+ }
+
$selname = (($datum) ? hex2bin($datum) : '');
$albums = ((array_key_exists('albums', $a->data)) ? $a->data['albums'] : photos_albums_list($a->data['channel'],$a->data['observer']));
diff --git a/mod/setup.php b/mod/setup.php
index 9bcbabbc5..6dc141702 100755
--- a/mod/setup.php
+++ b/mod/setup.php
@@ -365,7 +365,7 @@ function setup_content(&$a) {
'$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.')),
'$siteurl' => array('siteurl', t('Website URL'), z_root(), t('Please use SSL (https) URL if available.')),
- '$advanced' => array('advanced', t('Enable $Projectname <strong>advanced</strong> features?'), 0, t('Some advanced features, while useful - may be best suited for technically proficient audiences')),
+ '$advanced' => array('advanced', t('Enable $Projectname <strong>advanced</strong> features?'), 1, t('Some advanced features, while useful - may be best suited for technically proficient audiences')),
'$timezone' => array('timezone', t('Please select a default timezone for your website'), $timezone, '', get_timezones()),
diff --git a/version.inc b/version.inc
index edcf6442a..a656e3cbe 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2016-02-07.1302H
+2016-02-11.1306H