aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Daemon/Xchan_photo.php9
-rw-r--r--Zotlabs/Lib/Activity.php19
-rw-r--r--Zotlabs/Lib/Config.php2
-rw-r--r--Zotlabs/Lib/Libsync.php2
-rw-r--r--Zotlabs/Lib/ThreadItem.php4
-rw-r--r--Zotlabs/Module/Hq.php20
-rw-r--r--Zotlabs/Module/Item.php2
-rw-r--r--Zotlabs/Render/SmartyInterface.php2
-rw-r--r--Zotlabs/Render/Theme.php6
9 files changed, 28 insertions, 38 deletions
diff --git a/Zotlabs/Daemon/Xchan_photo.php b/Zotlabs/Daemon/Xchan_photo.php
index f90d1d726..662fc967c 100644
--- a/Zotlabs/Daemon/Xchan_photo.php
+++ b/Zotlabs/Daemon/Xchan_photo.php
@@ -8,14 +8,15 @@ class Xchan_photo {
static public function run($argc, $argv) {
- if ($argc != 3) {
+ if ($argc < 3) {
return;
}
$url = hex2bin($argv[1]);
$xchan = hex2bin($argv[2]);
+ $force = $argv[3];
- $photos = import_xchan_photo($url, $xchan);
+ $photos = import_xchan_photo($url, $xchan, false, $force);
if ($photos) {
$result = 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()),
@@ -27,8 +28,10 @@ class Xchan_photo {
);
if (! $result) {
- logger("xchan update failed for $url");
+ logger("xchan photo update failed for $url");
}
}
+
+ return;
}
}
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index b819ef0f7..9178dac39 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -70,7 +70,7 @@ class Activity {
}
if ($items) {
- return self::encode_item(array_shift($items), true);
+ return self::encode_item(array_shift($items));
}
return null;
@@ -762,7 +762,12 @@ class Activity {
$ptr = [$ptr];
}
foreach ($ptr as $att) {
+ if (!is_array($att)) {
+ continue;
+ }
+
$entry = [];
+
if (array_key_exists('href', $att) && $att['href']) {
$entry['href'] = $att['href'];
} elseif (array_key_exists('url', $att) && $att['url']) {
@@ -1085,12 +1090,16 @@ class Activity {
static function encode_person($p, $extended = true) {
+ $ret = (($extended) ? [] : '');
+
+ if (!is_array($p)) {
+ return $ret;
+ }
+
$c = ((array_key_exists('channel_id', $p)) ? $p : channelx_by_hash($p['xchan_hash']));
$id = (($c) ? channel_url($c) : ((filter_var($p['xchan_hash'], FILTER_VALIDATE_URL)) ? $p['xchan_hash'] : $p['xchan_url']));
- $ret = (($extended) ? [] : '');
-
if (!$id) {
return $ret;
}
@@ -1866,7 +1875,7 @@ class Activity {
}
if ($icon) {
- Master::Summon(['Xchan_photo', bin2hex($icon), bin2hex($url)]);
+ Master::Summon(['Xchan_photo', bin2hex($icon), bin2hex($url), $force]);
}
}
@@ -2893,7 +2902,7 @@ class Activity {
if (intval($parent[0]['item_private'])) {
if (!intval($item['item_private'])) {
- $item['item_private'] = intval($parent_item['item_private']);
+ $item['item_private'] = intval($parent[0]['item_private']);
$item['allow_cid'] = '<' . $channel['channel_hash'] . '>';
$item['allow_gid'] = $item['deny_cid'] = $item['deny_gid'] = '';
}
diff --git a/Zotlabs/Lib/Config.php b/Zotlabs/Lib/Config.php
index 95df8ed6f..cd8b08991 100644
--- a/Zotlabs/Lib/Config.php
+++ b/Zotlabs/Lib/Config.php
@@ -115,7 +115,7 @@ class Config {
* The category of the configuration value
* @param string $key
* The configuration key to query
- * @param string $default (optional) default false
+ * @param mixed $default (optional) default false
* @return mixed Return value or false on error or if not set
*/
public static function Get($family, $key, $default = false) {
diff --git a/Zotlabs/Lib/Libsync.php b/Zotlabs/Lib/Libsync.php
index e68fd53f1..a7e33ba6b 100644
--- a/Zotlabs/Lib/Libsync.php
+++ b/Zotlabs/Lib/Libsync.php
@@ -267,7 +267,7 @@ class Libsync {
}
if ($cat !== 'hz_delpconfig') {
- set_pconfig($channel['channel_id'],$cat,$k,$v,$pconfig_updated[$k]);
+ set_pconfig($channel['channel_id'], $cat, $k, $v, $pconfig_updated[$k]);
}
}
}
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index 290a7b0c2..eb1020cd2 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -44,8 +44,6 @@ class ThreadItem {
$this->toplevel = ($this->get_id() == $this->get_data_value('parent'));
$this->threaded = Config::Get('system','thread_allow');
- $observer = \App::get_observer();
-
// Prepare the children
if(isset($data['children'])) {
@@ -875,7 +873,7 @@ class ThreadItem {
'$feature_encrypt' => ((feature_enabled($conv->get_profile_owner(),'content_encrypt')) ? true : false),
'$encrypt' => t('Encrypt text'),
'$cipher' => $conv->get_cipher(),
- '$sourceapp' => \App::$sourcename,
+ '$sourceapp' => App::$sourcename,
'$observer' => get_observer_hash(),
'$anoncomments' => ((in_array($conv->get_mode(), ['channel', 'display', 'cards', 'articles']) && perm_is_allowed($conv->get_profile_owner(),'','post_comments')) ? true : false),
'$anonname' => [ 'anonname', t('Your full name (required)') ],
diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php
index ae6a016fc..c8e6efe38 100644
--- a/Zotlabs/Module/Hq.php
+++ b/Zotlabs/Module/Hq.php
@@ -4,14 +4,6 @@ namespace Zotlabs\Module;
use App;
use Zotlabs\Widget\Messages;
-
-require_once("include/bbcode.php");
-require_once('include/security.php');
-require_once('include/conversation.php');
-require_once('include/acl_selectors.php');
-require_once('include/items.php');
-
-
class Hq extends \Zotlabs\Web\Controller {
function init() {
@@ -98,7 +90,6 @@ class Hq extends \Zotlabs\Web\Controller {
'permissions' => $channel_acl,
'bang' => '',
'visitor' => true,
- 'profile_uid' => local_channel(),
'return_path' => 'hq',
'expanded' => true,
'editor_autocomplete' => true,
@@ -117,17 +108,6 @@ class Hq extends \Zotlabs\Web\Controller {
nav_set_selected('HQ');
- if($target_item) {
- // if the target item is not a post (eg a like) we want to address its thread parent
- //$mid = ((($target_item['verb'] == ACTIVITY_LIKE) || ($target_item['verb'] == ACTIVITY_DISLIKE)) ? $target_item['thr_parent'] : $target_item['mid']);
-
- // if we got a decoded hash we must encode it again before handing to javascript
- // $mid = gen_link_id($target_item['mid']);
- }
- else {
- $mid = '';
- }
-
$o .= '<div id="live-hq"></div>' . "\r\n";
$o .= "<script> var profile_uid = " . local_channel()
. "; var netargs = '?f='; var profile_page = " . App::$pager['page'] . ";</script>\r\n";
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 0324bf662..0b46f2baf 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -1654,7 +1654,7 @@ class Item extends Controller {
$listener = Libzot::zot_record_preferred($listener);
$c = q("select abook_id from abook where abook_channel = %d and abook_xchan = '%s'",
- intval($profile_uid),
+ intval($item['uid']),
dbesc($listener['hubloc_hash'])
);
diff --git a/Zotlabs/Render/SmartyInterface.php b/Zotlabs/Render/SmartyInterface.php
index d80ea3f3a..64c6aa377 100644
--- a/Zotlabs/Render/SmartyInterface.php
+++ b/Zotlabs/Render/SmartyInterface.php
@@ -20,7 +20,7 @@ class SmartyInterface extends Smarty {
$template_dirs = array('theme' => "view/theme/$thname/tpl/");
if ( x(App::$theme_info,"extends") ) {
- $template_dirs = $template_dirs + array('extends' => "view/theme/" . \App::$theme_info["extends"] . "/tpl/");
+ $template_dirs = $template_dirs + array('extends' => "view/theme/" . App::$theme_info["extends"] . "/tpl/");
}
$template_dirs = $template_dirs + array('base' => 'view/tpl/');
$this->setTemplateDir($template_dirs);
diff --git a/Zotlabs/Render/Theme.php b/Zotlabs/Render/Theme.php
index 543bf7a3f..a42b65e03 100644
--- a/Zotlabs/Render/Theme.php
+++ b/Zotlabs/Render/Theme.php
@@ -24,7 +24,7 @@ class Theme {
*
* @return array
*/
- static public function current(){
+ static public function current() {
self::$system_theme = ((isset(App::$config['system']['theme']))
? App::$config['system']['theme'] : '');
@@ -37,7 +37,7 @@ class Theme {
if(App::$profile_uid) {
$r = q("select channel_theme from channel where channel_id = %d limit 1",
- intval(\App::$profile_uid)
+ intval(App::$profile_uid)
);
if($r) {
$page_theme = $r[0]['channel_theme'];
@@ -46,7 +46,7 @@ class Theme {
// Themes from Comanche layouts over-ride the channel theme
- if(array_key_exists('theme', \App::$layout) && \App::$layout['theme']) {
+ if(array_key_exists('theme', App::$layout) && App::$layout['theme']) {
$page_theme = App::$layout['theme'];
}