From 59ace4f4d7413f76c59e57e88047f6c8e3580c82 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sat, 29 Sep 2012 17:48:56 -0600 Subject: [PATCH] look for DFRN contacts as well --- include/diaspora.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/diaspora.php b/include/diaspora.php index 497bc7f39f..c5b724509c 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -141,6 +141,17 @@ function diaspora_get_contact_by_handle($uid,$handle) { ); if($r && count($r)) return $r[0]; + + $handle_parts = explode("@", $handle); + $nurl_sql = '%%://' . $handle_parts[1] . '%%/profile/' . $handle_parts[0]; + $r = q("SELECT * FROM contact WHERE network = '%s' AND uid = %d AND nurl LIKE '%s' LIMIT 1", + dbesc(NETWORK_DFRN), + intval($uid), + dbesc($nurl_sql) + ); + if($r && count($r)) + return $r[0]; + return false; } @@ -1949,7 +1960,7 @@ function diaspora_signed_retraction($importer,$xml,$msg) { $contact = diaspora_get_contact_by_handle($importer['uid'],$diaspora_handle); if(! $contact) { - logger('diaspora_signed_retraction: no contact'); + logger('diaspora_signed_retraction: no contact ' . $diaspora_handle . ' for ' . $importer['uid']); return; }