aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authormarijus <mario@mariovavti.com>2014-03-05 17:03:38 +0100
committermarijus <mario@mariovavti.com>2014-03-05 17:03:38 +0100
commit6cdc25ade96c4451e87af475a6e4f0490b591c36 (patch)
tree474ebb0f31063805d8b95dcddc22d4345c989936 /include/zot.php
parentffb791968e48b5699dc99fffccc562f198f86c5d (diff)
parentd58abc0230e07663ce543088c186639d36f82f02 (diff)
downloadvolse-hubzilla-6cdc25ade96c4451e87af475a6e4f0490b591c36.tar.gz
volse-hubzilla-6cdc25ade96c4451e87af475a6e4f0490b591c36.tar.bz2
volse-hubzilla-6cdc25ade96c4451e87af475a6e4f0490b591c36.zip
Merge branch 'master' of https://github.com/friendica/red
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/zot.php b/include/zot.php
index e80dabed9..cfabbae2e 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -351,7 +351,10 @@ function zot_refresh($them,$channel = null, $force = false) {
intval(ABOOK_FLAG_SELF)
);
- if($r) {
+ if($r) {
+
+ $current_abook_connected = (($r[0]['abook_flags'] & ABOOK_FLAG_UNCONNECTED) ? 0 : 1);
+
$y = q("update abook set abook_their_perms = %d
where abook_xchan = '%s' and abook_channel = %d
and not (abook_flags & %d) limit 1",
@@ -360,14 +363,16 @@ function zot_refresh($them,$channel = null, $force = false) {
intval($channel['channel_id']),
intval(ABOOK_FLAG_SELF)
);
- if($connected_set === 0) {
- // if they are in your address book but you aren't in theirs, mark their address book entry hidden.
+ if(($connected_set === 0 || $connected_set === 1) && ($connected_set !== $current_abook_unconnected)) {
+
+ // if they are in your address book but you aren't in theirs, and/or this does not
+ // match your current connected state setting, toggle it.
- $y1 = q("update abook set abook_flags = (abook_flags | %d)
+ $y1 = q("update abook set abook_flags = (abook_flags ^ %d)
where abook_xchan = '%s' and abook_channel = %d
and not (abook_flags & %d) limit 1",
- intval(ABOOK_FLAG_HIDDEN),
+ intval(ABOOK_FLAG_UNCONNECTED),
dbesc($x['hash']),
intval($channel['channel_id']),
intval(ABOOK_FLAG_SELF)