From f5674558caf888fc8bdbad5fbb6c9b54868c1bb3 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 24 Jan 2011 18:18:47 -0800 Subject: propagate name changes to 'self' contact record --- mod/settings.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/settings.php b/mod/settings.php index 1923c58da..32906d86e 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -87,11 +87,14 @@ function settings_post(&$a) { $err = ''; + $name_change = false; + if($username != $a->user['username']) { - if(strlen($username) > 40) - $err .= t(' Please use a shorter name.'); - if(strlen($username) < 3) - $err .= t(' Name too short.'); + $name_change = true; + if(strlen($username) > 40) + $err .= t(' Please use a shorter name.'); + if(strlen($username) < 3) + $err .= t(' Name too short.'); } if($email != $a->user['email']) { @@ -165,6 +168,15 @@ function settings_post(&$a) { intval(local_user()) ); + + if($name_change) { + q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `self` = 1 LIMIT 1", + dbesc($username), + dbesc(datetime_convert()), + intval(local_user()) + ); + } + if($old_visibility != $net_publish) { // Update global directory in background $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); -- cgit v1.2.3 From 08d6fe5ae74cc223e4385344f8e0edfde4208a23 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 24 Jan 2011 19:36:20 -0800 Subject: allow RSS for feed contacts, but no comments --- mod/follow.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/follow.php b/mod/follow.php index e5eb7763b..bad2e74f9 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -74,8 +74,8 @@ function follow_post(&$a) { $ret = scrape_feed($url); - if(count($ret) && $ret['feed_atom']) { - $poll = $ret['feed_atom']; + if(count($ret) && ($ret['feed_atom'] || $ret['feed_rss'])) { + $poll = ((x($ret,'feed_atom')) ? $ret['feed_atom'] : $ret['feed_rss']); $vcard = array(); require_once('simplepie/simplepie.inc'); $feed = new SimplePie(); @@ -115,7 +115,6 @@ function follow_post(&$a) { logger('follow: poll=' . $poll . ' notify=' . $notify . ' profile=' . $profile . ' vcard=' . print_r($vcard,true)); - // do we have enough information? if(! ((x($vcard['fn'])) && ($poll) && ($profile))) { -- cgit v1.2.3