aboutsummaryrefslogtreecommitdiffstats
path: root/include/diaspora.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-12-20 17:18:19 +0100
committerFabio Comuni <fabrix.xm@gmail.com>2011-12-20 17:18:19 +0100
commitba732c97c10a1f6f712f78c97d7d9bd51c104160 (patch)
tree2e590cb581be00c29d1ef5914a8d6d9bd924b910 /include/diaspora.php
parentf3b499f1192a3cc2386aa639d2f0d2fa147e911a (diff)
parentc0c4c46874ed7e1798900422112ca643c1bb3cc0 (diff)
downloadvolse-hubzilla-ba732c97c10a1f6f712f78c97d7d9bd51c104160.tar.gz
volse-hubzilla-ba732c97c10a1f6f712f78c97d7d9bd51c104160.tar.bz2
volse-hubzilla-ba732c97c10a1f6f712f78c97d7d9bd51c104160.zip
Merge remote-tracking branch 'friendica/master'
Diffstat (limited to 'include/diaspora.php')
-rw-r--r--include/diaspora.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index 7f1e4a8e3..fdf756610 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -188,6 +188,13 @@ function diaspora_msg_build($msg,$user,$contact,$prvkey,$pubkey,$public = false)
logger('diaspora_msg_build: ' . $msg, LOGGER_DATA);
+ // without a public key nothing will work
+
+ if(! $pubkey) {
+ logger('diaspora_msg_build: pubkey missing: contact id: ' . $contact['id']);
+ return '';
+ }
+
$inner_aes_key = random_string(32);
$b_inner_aes_key = base64_encode($inner_aes_key);
$inner_iv = random_string(16);
@@ -1672,6 +1679,12 @@ function diaspora_profile($importer,$xml) {
$birthday = datetime_convert('UTC','UTC',$birthday,'Y-m-d');
+ // this is to prevent multiple birthday notifications in a single year
+ // if we already have a stored birthday and the 'm-d' part hasn't changed, preserve the entry, which will preserve the notify year
+
+ if(substr($birthday,5) === substr($contact['bd'],5))
+ $birthday = $contact['bd'];
+
$r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s', `avatar-date` = '%s' , `bd` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1",
dbesc($name),
dbesc(datetime_convert()),