aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-12-18 09:59:34 +0100
committerMario Vavti <mario@mariovavti.com>2018-12-18 09:59:34 +0100
commit63b205c601c8ff567407155c327515bb0c5165b3 (patch)
treeedd456a39ad0daf12d6cc4409a99477f4fb38d82
parentd190b1995b0886b430beb5dac1a1e72582b9ad2b (diff)
parent8d70b919551f6f6462e639f7cfffda9825344e43 (diff)
downloadvolse-hubzilla-63b205c601c8ff567407155c327515bb0c5165b3.tar.gz
volse-hubzilla-63b205c601c8ff567407155c327515bb0c5165b3.tar.bz2
volse-hubzilla-63b205c601c8ff567407155c327515bb0c5165b3.zip
Merge remote-tracking branch 'mike/master' into dev
-rw-r--r--Zotlabs/Daemon/Notifier.php7
-rw-r--r--Zotlabs/Lib/Libzot.php4
-rw-r--r--Zotlabs/Module/Connedit.php27
-rw-r--r--Zotlabs/Update/_1230.php12
-rwxr-xr-xboot.php2
-rw-r--r--include/follow.php4
-rw-r--r--include/zot.php2
7 files changed, 42 insertions, 16 deletions
diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php
index 8b81c49da..beb30ed96 100644
--- a/Zotlabs/Daemon/Notifier.php
+++ b/Zotlabs/Daemon/Notifier.php
@@ -625,7 +625,12 @@ class Notifier {
continue;
}
- $hash = new_uuid();
+ // Do not change this to a uuid as long as we have traditional zot servers
+ // in the loop. The signature verification step can't handle dashes in the
+ // hashes.
+
+ $hash = random_string(48);
+
$packet = null;
$pmsg = '';
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 0fbde9765..87a5126f4 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -397,9 +397,7 @@ logger('4');
}
}
- $closeness = get_pconfig($channel['channel_id'],'system','new_abook_closeness');
- if($closeness === false)
- $closeness = 80;
+ $closeness = get_pconfig($channel['channel_id'],'system','new_abook_closeness',80);
$y = abook_store_lowlevel(
[
diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php
index a9f643306..c14bcd0dd 100644
--- a/Zotlabs/Module/Connedit.php
+++ b/Zotlabs/Module/Connedit.php
@@ -101,7 +101,8 @@ class Connedit extends \Zotlabs\Web\Controller {
}
- $profile_id = $_POST['profile_assign'];
+ $profile_id = ((array_key_exists('profile_assign',$_POST)) ? $_POST['profile_assign'] : $orig_record[0]['abook_profile']);
+
if($profile_id) {
$r = q("SELECT profile_guid FROM profile WHERE profile_guid = '%s' AND uid = %d LIMIT 1",
dbesc($profile_id),
@@ -113,18 +114,23 @@ class Connedit extends \Zotlabs\Web\Controller {
}
}
- $abook_incl = escape_tags($_POST['abook_incl']);
- $abook_excl = escape_tags($_POST['abook_excl']);
-
+ $abook_incl = ((array_key_exists('abook_incl',$_POST)) ? escape_tags($_POST['abook_incl']) : $orig_record[0]['abook_incl']);
+ $abook_excl = ((array_key_exists('abook_excl',$_POST)) ? escape_tags($_POST['abook_excl']) : $orig_record[0]['abook_excl']);
+
+
$hidden = intval($_POST['hidden']);
$priority = intval($_POST['poll']);
if($priority > 5 || $priority < 0)
$priority = 0;
+ if(! array_key_exists('closeness',$_POST)) {
+ $_POST['closeness'] = 80;
+ }
$closeness = intval($_POST['closeness']);
- if($closeness < 0)
- $closeness = 99;
+ if($closeness < 0 || $closeness > 99) {
+ $closeness = 80;
+ }
$rating = intval($_POST['rating']);
if($rating < (-10))
@@ -231,6 +237,8 @@ class Connedit extends \Zotlabs\Web\Controller {
}
$abook_pending = (($new_friend) ? 0 : $orig_record[0]['abook_pending']);
+
+
$r = q("UPDATE abook SET abook_profile = '%s', abook_closeness = %d, abook_pending = %d,
abook_incl = '%s', abook_excl = '%s'
@@ -733,9 +741,12 @@ class Connedit extends \Zotlabs\Web\Controller {
}
$slider_tpl = get_markup_template('contact_slider.tpl');
+
+ $slideval = intval($contact['abook_closeness']);
+
$slide = replace_macros($slider_tpl,array(
'$min' => 1,
- '$val' => (($contact['abook_closeness']) ? $contact['abook_closeness'] : 99),
+ '$val' => $slideval,
'$labels' => $label_str,
));
}
@@ -892,7 +903,7 @@ class Connedit extends \Zotlabs\Web\Controller {
'$inherited' => t('inherited'),
'$submit' => t('Submit'),
'$lbl_vis2' => sprintf( t('Please choose the profile you would like to display to %s when viewing your profile securely.'), $contact['xchan_name']),
- '$close' => $contact['abook_closeness'],
+ '$close' => (($contact['abook_closeness']) ? $contact['abook_closeness'] : 80),
'$them' => t('Their Settings'),
'$me' => t('My Settings'),
'$perms' => $perms,
diff --git a/Zotlabs/Update/_1230.php b/Zotlabs/Update/_1230.php
new file mode 100644
index 000000000..fe59f2e08
--- /dev/null
+++ b/Zotlabs/Update/_1230.php
@@ -0,0 +1,12 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1230 {
+
+ function run() {
+ q("update abook set abook_closeness = 80 where abook_closeness = 0 and abook_self = 0");
+ return UPDATE_SUCCESS;
+
+ }
+} \ No newline at end of file
diff --git a/boot.php b/boot.php
index 1d3897114..410aa91b1 100755
--- a/boot.php
+++ b/boot.php
@@ -53,7 +53,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '3.9.5' );
define ( 'ZOT_REVISION', '6.0a' );
-define ( 'DB_UPDATE_VERSION', 1229 );
+define ( 'DB_UPDATE_VERSION', 1230 );
define ( 'PROJECT_BASE', __DIR__ );
diff --git a/include/follow.php b/include/follow.php
index 964c43ff2..038e6e9c0 100644
--- a/include/follow.php
+++ b/include/follow.php
@@ -266,9 +266,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
}
}
else {
- $closeness = get_pconfig($uid,'system','new_abook_closeness');
- if($closeness === false)
- $closeness = 80;
+ $closeness = get_pconfig($uid,'system','new_abook_closeness',80);
$r = abook_store_lowlevel(
[
diff --git a/include/zot.php b/include/zot.php
index d031b4a96..9934dae07 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -1232,6 +1232,7 @@ function zot_fetch($arr) {
$datatosend = json_encode(crypto_encapsulate(json_encode($data),$hub['hubloc_sitekey'], $algorithm));
$import = zot_zot($url,$datatosend);
+
}
else {
$algorithm = zot_best_algorithm($hub['site_crypto']);
@@ -4913,6 +4914,7 @@ function zot_reply_pickup($data) {
dbesc($data['secret']),
dbesc($data['callback'])
);
+
if(! $r) {
$ret['message'] = 'nothing to pick up';
logger('mod_zot: pickup: ' . $ret['message']);