From 8da548344be6493aeedc7d9896bc784880dff3fe Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 5 Aug 2014 17:47:17 -0700 Subject: clone sync of "unfriend" actions --- include/zot.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/zot.php') 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 -- cgit v1.2.3