From a0a59e0518459076079e904cd257dd9608b9bd37 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 17 May 2011 18:25:18 -0700 Subject: statusnet post by default --- addon/statusnet/statusnet.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'addon/statusnet/statusnet.php') diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php index 5ed92d13a..ad992f979 100644 --- a/addon/statusnet/statusnet.php +++ b/addon/statusnet/statusnet.php @@ -90,10 +90,11 @@ function statusnet_settings_post ($a,$post) { * if the statusnet-disconnect checkbox is set, clear the statusnet configuration * TODO can we revoke the access tokens at Twitter and do we need to do so? */ - del_pconfig( local_user(), 'statusnet', 'consumerkey' ); - del_pconfig( local_user(), 'statusnet', 'consumersecret' ); - del_pconfig( local_user(), 'statusnet', 'post' ); - del_pconfig( local_user(), 'statusnet', 'oauthtoken' ); + del_pconfig( local_user(), 'statusnet', 'consumerkey' ); + del_pconfig( local_user(), 'statusnet', 'consumersecret' ); + del_pconfig( local_user(), 'statusnet', 'post' ); + del_pconfig( local_user(), 'statusnet', 'post_by_default' ); + del_pconfig( local_user(), 'statusnet', 'oauthtoken' ); del_pconfig( local_user(), 'statusnet', 'oauthsecret' ); del_pconfig( local_user(), 'statusnet', 'baseapi' ); } else { @@ -149,6 +150,8 @@ function statusnet_settings_post ($a,$post) { // if no PIN is supplied in the POST variables, the user has changed the setting // to post a tweet for every new __public__ posting to the wall set_pconfig(local_user(),'statusnet','post',intval($_POST['statusnet-enable'])); + set_pconfig(local_user(),'statusnet','post_by_default',intval($_POST['statusnet-default'])); + notice( t('StatusNet settings updated.') . EOL); }}} } function statusnet_settings(&$a,&$s) { @@ -166,8 +169,10 @@ function statusnet_settings(&$a,&$s) { $csecret = get_pconfig(local_user(), 'statusnet', 'consumersecret' ); $otoken = get_pconfig(local_user(), 'statusnet', 'oauthtoken' ); $osecret = get_pconfig(local_user(), 'statusnet', 'oauthsecret' ); - $enabled = get_pconfig(local_user(), 'statusnet', 'post'); + $enabled = get_pconfig(local_user(), 'statusnet', 'post'); $checked = (($enabled) ? ' checked="checked" ' : ''); + $defenabled = get_pconfig(local_user(),'statusnet','post_by_default'); + $defchecked = (($defenabled) ? ' checked="checked" ' : ''); $s .= '
'; $s .= '

'. t('StatusNet Posting Settings').'

'; @@ -228,11 +233,15 @@ function statusnet_settings(&$a,&$s) { $connection = new StatusNetOAuth($api,$ckey,$csecret,$otoken,$osecret); $details = $connection->get('account/verify_credentials'); $s .= '

'. t('Currently connected to: ') .''.$details->screen_name.'
'.$details->description.'

'; - $s .= '

'. t('If enabled all your public postings will be posted to the associated StatusNet account as well.') .'

'; + $s .= '

'. t('If enabled all your public postings will be posted to the associated StatusNet account.') .'

'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; + $s .= '
'; + $s .= ''; + $s .= ''; $s .= '
'; + $s .= '
'; $s .= ''; $s .= ''; -- cgit v1.2.3