From: Zach Prezkuta Date: Tue, 5 Feb 2013 03:34:42 +0000 (-0700) Subject: add 'quiet' paramter to redir and dfrn_poll to allow calls that don't produce a Welco... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cc38986c2031a262720a26b8022626f5f439b808;p=friendica.git add 'quiet' paramter to redir and dfrn_poll to allow calls that don't produce a Welcome info --- diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php index 1d3bbd4420..bcb3fb3d7c 100644 --- a/mod/dfrn_poll.php +++ b/mod/dfrn_poll.php @@ -17,6 +17,7 @@ function dfrn_poll_init(&$a) { $sec = ((x($_GET,'sec')) ? $_GET['sec'] : ''); $dfrn_version = ((x($_GET,'dfrn_version')) ? (float) $_GET['dfrn_version'] : 2.0); $perm = ((x($_GET,'perm')) ? $_GET['perm'] : 'r'); + $quiet = ((x($_GET,'quiet')) ? true : false); $direction = (-1); @@ -96,7 +97,8 @@ function dfrn_poll_init(&$a) { $_SESSION['visitor_home'] = $r[0]['url']; $_SESSION['visitor_handle'] = $r[0]['addr']; $_SESSION['visitor_visiting'] = $r[0]['uid']; - info( sprintf(t('%1$s welcomes %2$s'), $r[0]['username'] , $r[0]['name']) . EOL); + if(!$quiet) + info( sprintf(t('%1$s welcomes %2$s'), $r[0]['username'] , $r[0]['name']) . EOL); // Visitors get 1 day session. $session_id = session_id(); $expire = time() + 86400; @@ -385,6 +387,7 @@ function dfrn_poll_content(&$a) { $sec = ((x($_GET,'sec')) ? $_GET['sec'] : ''); $dfrn_version = ((x($_GET,'dfrn_version')) ? (float) $_GET['dfrn_version'] : 2.0); $perm = ((x($_GET,'perm')) ? $_GET['perm'] : 'r'); + $quiet = ((x($_GET,'quiet')) ? true : false); $direction = (-1); if(strpos($dfrn_id,':') == 1) { @@ -527,7 +530,8 @@ function dfrn_poll_content(&$a) { $_SESSION['visitor_id'] = $r[0]['id']; $_SESSION['visitor_home'] = $r[0]['url']; $_SESSION['visitor_visiting'] = $r[0]['uid']; - info( sprintf(t('%1$s welcomes %2$s'), $r[0]['username'] , $r[0]['name']) . EOL); + if(!$quiet) + info( sprintf(t('%1$s welcomes %2$s'), $r[0]['username'] , $r[0]['name']) . EOL); // Visitors get 1 day session. $session_id = session_id(); $expire = time() + 86400; diff --git a/mod/redir.php b/mod/redir.php index 0f7b5cc23f..7687bfbe70 100644 --- a/mod/redir.php +++ b/mod/redir.php @@ -3,6 +3,7 @@ function redir_init(&$a) { $url = ((x($_GET,'url')) ? $_GET['url'] : ''); + $quiet = ((x($_GET,'quiet')) ? '&quiet=1' : ''); // traditional DFRN @@ -43,7 +44,7 @@ function redir_init(&$a) { logger('mod_redir: ' . $r[0]['name'] . ' ' . $sec, LOGGER_DEBUG); $dest = (($url) ? '&destination_url=' . $url : ''); goaway ($r[0]['poll'] . '?dfrn_id=' . $dfrn_id - . '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec . $dest ); + . '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec . $dest . $quiet ); } if(local_user())