aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-08-16 00:52:34 -0700
committerFriendika <info@friendika.com>2011-08-16 00:52:34 -0700
commit2c0404fdc88081f68af18a788d2f285e5c059f47 (patch)
tree5e6cb9a21193744fa4a39fd5fb93ed72dca218c0 /include
parentc7197b99f919bee81fa2a8f46a3ef744c76bec6c (diff)
downloadvolse-hubzilla-2c0404fdc88081f68af18a788d2f285e5c059f47.tar.gz
volse-hubzilla-2c0404fdc88081f68af18a788d2f285e5c059f47.tar.bz2
volse-hubzilla-2c0404fdc88081f68af18a788d2f285e5c059f47.zip
cleanup after refactor
Diffstat (limited to 'include')
-rw-r--r--include/diaspora.php23
1 files changed, 5 insertions, 18 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index 95673996f..69d2dff19 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -257,8 +257,8 @@ function diaspora_get_contact_by_handle($uid,$handle) {
function diaspora_request($importer,$xml) {
- $sender_handle = $xml->sender_handle;
- $recipient_handle = $xml->recipient_handle;
+ $sender_handle = unxmlify($xml->sender_handle);
+ $recipient_handle = unxmlify($xml->recipient_handle);
if(! $sender_handle || ! $recipient_handle)
return;
@@ -303,21 +303,12 @@ function diaspora_request($importer,$xml) {
);
// find the contact record we just created
- $contact_record = null;
- if($r) {
- $r = q("SELECT `id` FROM `contact`
- WHERE `uid` = %d AND `addr` = '%s' AND `poll` = '%s' LIMIT 1",
- intval($importer['uid']),
- $ret['addr'],
- $ret['poll']
- );
- if(count($r))
- $contact_record = $r[0];
- }
+
+ $contact_record = diaspora_get_contact_by_handle($importer['uid'],$sender_handle);
$hash = random_string() . (string) time(); // Generate a confirm_key
- if(is_array($contact_record)) {
+ if($contact_record) {
$ret = q("INSERT INTO `intro` ( `uid`, `contact-id`, `blocked`, `knowyou`, `note`, `hash`, `datetime`,`blocked`)
VALUES ( %d, %d, 1, %d, '%s', '%s', '%s', 0 )",
intval($importer['uid']),
@@ -328,10 +319,8 @@ function diaspora_request($importer,$xml) {
dbesc(datetime_convert())
);
}
-
return;
-
}
function diaspora_post($importer,$xml) {
@@ -370,7 +359,6 @@ function diaspora_post($importer,$xml) {
);
}
-
$created = unxmlify($xml->created_at);
$private = ((unxmlify($xml->public) == 'false') ? 1 : 0);
@@ -422,7 +410,6 @@ function diaspora_post($importer,$xml) {
return;
-
}
function diaspora_comment($importer,$xml) {