aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-02-29 19:31:52 -0800
committerredmatrix <git@macgirvin.com>2016-02-29 19:31:52 -0800
commitbe2b7c0b5f7f9b8080affbb4bc44c5adda18e82f (patch)
tree6dde06168b0df62044a3fdeaf2b4b9b649165d7a /include/zot.php
parent44b2503572700ab24e7afad4637f62c413d3d489 (diff)
downloadvolse-hubzilla-be2b7c0b5f7f9b8080affbb4bc44c5adda18e82f.tar.gz
volse-hubzilla-be2b7c0b5f7f9b8080affbb4bc44c5adda18e82f.tar.bz2
volse-hubzilla-be2b7c0b5f7f9b8080affbb4bc44c5adda18e82f.zip
abconfig
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/zot.php b/include/zot.php
index 01dd06fda..a60a50d8f 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -522,6 +522,11 @@ function zot_refresh($them, $channel = null, $force = false) {
unset($new_connection[0]['abook_id']);
unset($new_connection[0]['abook_account']);
unset($new_connection[0]['abook_channel']);
+
+ $abconfig = load_abconfig($channel['channel_hash'],$new_connection['abook_xchan']);
+ if($abconfig)
+ $new_connection['abconfig'] = $abconfig;
+
build_sync_packet($channel['channel_id'], array('abook' => $new_connection));
}
}
@@ -3124,6 +3129,11 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
foreach($arr['abook'] as $abook) {
+ $abconfig = null;
+
+ if(array_key_exists('abconfig',$abook) && is_array($abook['abconfig']) && count($abook['abconfig']))
+ $abconfig = $abook['abconfig'];
+
if(! array_key_exists('abook_blocked',$abook)) {
// convert from redmatrix
$abook['abook_blocked'] = (($abook['abook_flags'] & 0x0001) ? 1 : 0);
@@ -3214,8 +3224,13 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
}
}
-
-
+ if($abconfig) {
+ // @fixme does not handle sync of del_abconfig
+ foreach($abconfig as $abc) {
+ if($abc['chan'] === $channel['channel_hash'])
+ set_abconfig($abc['chan'],$abc['xchan'],$abc['cat'],$abc['k'],$abc['v']);
+ }
+ }
}
}