aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2011-12-19 19:06:25 -0800
committerfriendica <info@friendica.com>2011-12-19 19:06:25 -0800
commit63f66a5a93661cfc327449561a2150aa8187a228 (patch)
tree2db275059113e5a29e13e657f342af8f88516504 /include
parent79f3bbbf2b0e41db2653f9d0fd4eb7520ba58a25 (diff)
downloadvolse-hubzilla-63f66a5a93661cfc327449561a2150aa8187a228.tar.gz
volse-hubzilla-63f66a5a93661cfc327449561a2150aa8187a228.tar.bz2
volse-hubzilla-63f66a5a93661cfc327449561a2150aa8187a228.zip
bug 244 multiple birthday reminders from Diaspora if profile changed repeatedly
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php2
-rw-r--r--include/diaspora.php6
2 files changed, 7 insertions, 1 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index a8e3bed70..5218a06e8 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -11,7 +11,7 @@ function stripcode_br_cb($s) {
function tryoembed($match){
$url = ((count($match)==2)?$match[1]:$match[2]);
- logger('tryoembed: $url');
+ logger("tryoembed: $url");
$o = oembed_fetch_url($url);
diff --git a/include/diaspora.php b/include/diaspora.php
index 3ab454246..fdf756610 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -1679,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()),