aboutsummaryrefslogtreecommitdiffstats
path: root/addon
diff options
context:
space:
mode:
Diffstat (limited to 'addon')
-rw-r--r--addon/facebook/facebook.php7
-rw-r--r--addon/statusnet/statusnet.php3
-rw-r--r--addon/twitter/twitter.php4
3 files changed, 14 insertions, 0 deletions
diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php
index af9829834..47e7691e4 100644
--- a/addon/facebook/facebook.php
+++ b/addon/facebook/facebook.php
@@ -530,6 +530,13 @@ function facebook_post_hook(&$a,&$b) {
$fb_enable = (($fb_post && x($_POST,'facebook_enable')) ? intval($_POST['facebook_enable']) : 0);
$fb_token = get_pconfig(local_user(),'facebook','access_token');
+ // if API is used, default to the chosen settings
+ if($_POST['api_source'] && intval(get_pconfig(local_user(),'facebook','post_by_default')))
+ $fb_enable = 1;
+
+
+
+
logger('facebook: $fb_post: ' . $fb_post . ' $fb_enable: ' . $fb_enable . ' $fb_token: ' . $fb_token,LOGGER_DEBUG);
// post to facebook if it's a public post and we've ticked the 'post to Facebook' box,
diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php
index b18eac2b8..2ce4b7eab 100644
--- a/addon/statusnet/statusnet.php
+++ b/addon/statusnet/statusnet.php
@@ -374,6 +374,9 @@ function statusnet_post_hook(&$a,&$b) {
$statusnet_post = get_pconfig(local_user(),'statusnet','post');
$statusnet_enable = (($statusnet_post && x($_POST,'statusnet_enable')) ? intval($_POST['statusnet_enable']) : 0);
+ // if API is used, default to the chosen settings
+ if($_POST['api_source'] && intval(get_pconfig(local_user(),'statusnet','post_by_default')))
+ $statusnet_enable = 1;
if($statusnet_enable && $statusnet_post) {
require_once('include/bbcode.php');
diff --git a/addon/twitter/twitter.php b/addon/twitter/twitter.php
index c3fbc3e64..b1c8a0a89 100644
--- a/addon/twitter/twitter.php
+++ b/addon/twitter/twitter.php
@@ -225,6 +225,10 @@ function twitter_post_hook(&$a,&$b) {
$twitter_post = intval(get_pconfig(local_user(),'twitter','post'));
$twitter_enable = (($twitter_post && x($_POST,'twitter_enable')) ? intval($_POST['twitter_enable']) : 0);
+ // if API is used, default to the chosen settings
+ if($_POST['api_source'] && intval(get_pconfig(local_user(),'twitter','post_by_default')))
+ $twitter_enable = 1;
+
if($twitter_post && $twitter_enable) {
logger('Posting to Twitter', LOGGER_DEBUG);
require_once('library/twitteroauth.php');