aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-08-05 17:47:17 -0700
committerfriendica <info@friendica.com>2014-08-05 17:47:17 -0700
commit8da548344be6493aeedc7d9896bc784880dff3fe (patch)
tree86eaa2b5201ee539c67e03153a970e8a24d567cd /include/zot.php
parent8b1f9b14254794e4e247ba008a70e053d017bb5f (diff)
downloadvolse-hubzilla-8da548344be6493aeedc7d9896bc784880dff3fe.tar.gz
volse-hubzilla-8da548344be6493aeedc7d9896bc784880dff3fe.tar.bz2
volse-hubzilla-8da548344be6493aeedc7d9896bc784880dff3fe.zip
clone sync of "unfriend" actions
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/zot.php b/include/zot.php
index 5df217c03..971f91a3c 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -2230,6 +2230,21 @@ function process_channel_sync_delivery($sender,$arr,$deliveries) {
$clean = array();
foreach($arr['abook'] as $abook) {
+ if($abook['abook_xchan'] && $abook['entry_deleted']) {
+ logger('process_channel_sync_delivery: removing abook entry for ' . $abook['abook_xchan']);
+ require_once('include/Contact.php');
+
+ $r = q("select abook_id from abook where abook_xchan = '%s' and abook_channel = %d and not ( abook_flags & %d ) limit 1",
+ dbesc($abook['abook_xchan']),
+ intval($channel['channel_id']),
+ intval(ABOOK_FLAG_SELF)
+ );
+ if($r)
+ contact_remove($channel['channel_id'],$r[0]['abook_id']);
+
+ continue;
+ }
+
// Perform discovery if the referenced xchan hasn't ever been seen on this hub.
// This relies on the undocumented behaviour that red sites send xchan info with the abook