clone sync of "unfriend" actions

This commit is contained in:
friendica
2014-08-05 17:47:17 -07:00
parent 8b1f9b1425
commit 8da548344b
3 changed files with 27 additions and 69 deletions

View File

@@ -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