aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Channel.php2
-rw-r--r--Zotlabs/Module/Display.php2
-rw-r--r--Zotlabs/Module/Item.php6
-rw-r--r--Zotlabs/Module/Nojs.php8
-rw-r--r--Zotlabs/Web/CheckJS.php13
-rwxr-xr-xboot.php2
-rw-r--r--include/bb2diaspora.php34
-rw-r--r--include/notifier.php2
-rwxr-xr-xinclude/plugin.php16
9 files changed, 61 insertions, 24 deletions
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php
index cae561266..36f13e775 100644
--- a/Zotlabs/Module/Channel.php
+++ b/Zotlabs/Module/Channel.php
@@ -57,7 +57,7 @@ function get($update = 0, $load = false) {
if($load)
$_SESSION['loadtime'] = datetime_convert();
- $checkjs = new \Zotlabs\Web\CheckJS();
+ $checkjs = new \Zotlabs\Web\CheckJS(1);
$category = $datequery = $datequery2 = '';
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index 3d24c6c9a..2a5a04a2a 100644
--- a/Zotlabs/Module/Display.php
+++ b/Zotlabs/Module/Display.php
@@ -10,7 +10,7 @@ class Display extends \Zotlabs\Web\Controller {
// logger("mod-display: update = $update load = $load");
- $checkjs = new \Zotlabs\Web\CheckJS();
+ $checkjs = new \Zotlabs\Web\CheckJS(1);
if($load)
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 58660a839..74fbeed67 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -984,9 +984,9 @@ class Item extends \Zotlabs\Web\Controller {
if(($parent) && ($parent != $post_id)) {
// Store the comment signature information in case we need to relay to Diaspora
- $ditem = $datarray;
- $ditem['author'] = $observer;
- store_diaspora_comment_sig($ditem,$channel,$parent_item, $post_id, (($walltowall_comment) ? 1 : 0));
+ //$ditem = $datarray;
+ //$ditem['author'] = $observer;
+ //store_diaspora_comment_sig($ditem,$channel,$parent_item, $post_id, (($walltowall_comment) ? 1 : 0));
}
else {
$r = q("select * from item where id = %d",
diff --git a/Zotlabs/Module/Nojs.php b/Zotlabs/Module/Nojs.php
index 5e48c5b5f..6fd6d8106 100644
--- a/Zotlabs/Module/Nojs.php
+++ b/Zotlabs/Module/Nojs.php
@@ -5,11 +5,11 @@ namespace Zotlabs\Module;
class Nojs extends \Zotlabs\Web\Controller {
function init() {
-
- setcookie('jsdisabled', 1, 0);
- $p = $_GET['query'];
+ $n = ((argc() > 1) ? intval(argv(1)) : 1);
+ setcookie('jsdisabled', $n, 0, '/');
+ $p = $_GET['redir'];
$hasq = strpos($p,'?');
- goaway(z_root() . (($p) ? '/' . $p : '') . (($hasq) ? '' : '?f=' ) . '&jsdisabled=1');
+ goaway(z_root() . (($p) ? '/' . $p : '') . (($hasq) ? '' : '?f=' ) . '&jsdisabled=' . $n);
}
}
diff --git a/Zotlabs/Web/CheckJS.php b/Zotlabs/Web/CheckJS.php
index 3ad5fc1ed..5f9856a8c 100644
--- a/Zotlabs/Web/CheckJS.php
+++ b/Zotlabs/Web/CheckJS.php
@@ -10,14 +10,25 @@ class CheckJS {
function __construct($test = 0) {
if(intval($_REQUEST['jsdisabled']))
$this->jsdisabled = 1;
+ else
+ $this->jsdisabled = 0;
if(intval($_COOKIE['jsdisabled']))
$this->jsdisabled = 1;
+ else
+ $this->jsdisabled = 0;
if(! $this->jsdisabled) {
$page = urlencode(\App::$query_string);
if($test) {
- \App::$page['htmlhead'] .= "\r\n" . '<meta http-equiv="refresh" content="0; url=' . z_root() . '/nojs?f=&redir=' . $page . '">' . "\r\n";
+
+ if(! array_key_exists('jsdisabled',$_COOKIE)) {
+ \App::$page['htmlhead'] .= "\r\n" . '<script>document.cookie="jsdisabled=0; path=/"; var jsMatch = /\&jsdisabled=0/; if (!jsMatch.exec(location.href)) { location.href = "' . z_root() . '/nojs/0?f=&redir=' . $page . '" ; }</script>' . "\r\n";
+ /* emulate JS cookie if cookies are not accepted */
+ if (array_key_exists('jsdisabled',$_GET)) {
+ $_COOKIE['jsdisabled'] = $_GET['jsdisabled'];
+ }
+ }
}
else {
\App::$page['htmlhead'] .= "\r\n" . '<noscript><meta http-equiv="refresh" content="0; url=' . z_root() . '/nojs?f=&redir=' . $page . '"></noscript>' . "\r\n";
diff --git a/boot.php b/boot.php
index 385115be4..674e3731e 100755
--- a/boot.php
+++ b/boot.php
@@ -47,7 +47,7 @@ require_once('include/account.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')));
-define ( 'STD_VERSION', '1.4' );
+define ( 'STD_VERSION', '1.4.1' );
define ( 'ZOT_REVISION', 1 );
define ( 'DB_UPDATE_VERSION', 1165 );
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 1ed57bfd4..9167cb5ad 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -270,7 +270,14 @@ function bb2dmention_callback($match) {
function bb2diaspora_itemwallwall(&$item) {
+ // We will provide wallwall (embedded author on the Diaspora side) if
+ // 1. It is a wall-to-wall post
+ // 2. A comment arrived which has no Diaspora signature info
+
+
+ $wallwall = false;
$author_exists = true;
+
if(! array_key_exists('author',$item)) {
$author_exists = false;
logger('bb2diaspora_itemwallwall: no author');
@@ -281,11 +288,21 @@ function bb2diaspora_itemwallwall(&$item) {
$item['author'] = $r[0];
}
- if(($item['mid'] == $item['parent_mid']) && ($item['author_xchan'] != $item['owner_xchan']) && (is_array($item['author']))) {
- logger('bb2diaspora_itemwallwall: author: ' . print_r($item['author'],true), LOGGER_DATA);
+ $has_meta = false;
+ if($item['diaspora_meta'] || get_iconfig($item,'diaspora','fields'))
+ $has_meta = true;
+
+ if($item['author_xchan'] != $item['owner_xchan']) {
+ if($item['mid'] == $item['parent_mid'])
+ $wallwall = true;
+ else {
+ if(! $has_meta) {
+ $wallwall = true;
+ }
+ }
}
- if(($item['mid'] == $item['parent_mid']) && ($item['author_xchan'] != $item['owner_xchan']) && (is_array($item['author'])) && $item['author']['xchan_url'] && $item['author']['xchan_name'] && $item['author']['xchan_photo_m']) {
+ if(($wallwall) && (is_array($item['author'])) && $item['author']['xchan_url'] && $item['author']['xchan_name'] && $item['author']['xchan_photo_m']) {
logger('bb2diaspora_itemwallwall: wall to wall post',LOGGER_DEBUG);
// post will come across with the owner's identity. Throw a preamble onto the post to indicate the true author.
$item['body'] = "\n\n"
@@ -301,7 +318,12 @@ function bb2diaspora_itemwallwall(&$item) {
}
-function bb2diaspora_itembody($item, $force_update = false) {
+function bb2diaspora_itembody($item, $force_update = false, $have_channel = false) {
+
+
+ if(! get_iconfig($item,'diaspora','fields')) {
+ $force_update = true;
+ }
$matches = array();
@@ -339,8 +361,8 @@ function bb2diaspora_itembody($item, $force_update = false) {
}
}
-
- bb2diaspora_itemwallwall($newitem);
+ if(! $have_channel)
+ bb2diaspora_itemwallwall($newitem);
$title = $newitem['title'];
$body = preg_replace('/\#\^http/i', 'http', $newitem['body']);
diff --git a/include/notifier.php b/include/notifier.php
index 628847d54..4435c7497 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -450,7 +450,6 @@ function notifier_run($argv, $argc){
'target_item' => $target_item,
'top_level_post' => $top_level_post,
'private' => $private,
- 'followup' => $followup,
'relay_to_owner' => $relay_to_owner,
'uplink' => $uplink,
'cmd' => $cmd,
@@ -547,7 +546,6 @@ function notifier_run($argv, $argc){
'hub' => $hub,
'top_level_post' => $top_level_post,
'private' => $private,
- 'followup' => $followup,
'relay_to_owner' => $relay_to_owner,
'uplink' => $uplink,
'cmd' => $cmd,
diff --git a/include/plugin.php b/include/plugin.php
index 8dceb8fb1..7df3e302c 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -535,8 +535,11 @@ function format_css_if_exists($source) {
else
$path = theme_include($source[0]);
- if($path)
- return '<link rel="stylesheet" href="' . script_path() . '/' . $path . '" type="text/css" media="' . $source[1] . '">' . "\r\n";
+ if($path) {
+ $path = script_path() . '/' . $path;
+ $qstring = ((parse_url($path, PHP_URL_QUERY)) ? '&' : '?') . 'v=' . STD_VERSION;
+ return '<link rel="stylesheet" href="' . $path . $qstring . '" type="text/css" media="' . $source[1] . '">' . "\r\n";
+ }
}
/*
@@ -612,8 +615,11 @@ function format_js_if_exists($source) {
$path = $source;
else
$path = theme_include($source);
- if($path)
- return '<script src="' . script_path() . '/' . $path . '" ></script>' . "\r\n" ;
+ if($path) {
+ $path = script_path() . '/' . $path;
+ $qstring = ((parse_url($path, PHP_URL_QUERY)) ? '&' : '?') . 'v=' . STD_VERSION;
+ return '<script src="' . $path . $qstring . '" ></script>' . "\r\n" ;
+ }
}
@@ -678,4 +684,4 @@ function folder_exists($folder)
// If it exist, check if it's a directory
return (($path !== false) && is_dir($path)) ? $path : false;
-} \ No newline at end of file
+}