Publiv forum posts aren't transmitted via the connectors anymore
authorMichael <heluecht@pirati.ca>
Sat, 25 Nov 2017 23:56:18 +0000 (23:56 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 25 Nov 2017 23:56:18 +0000 (23:56 +0000)
buffer/buffer.php
diaspora/diaspora.php
libertree/libertree.php
pumpio/pumpio.php
statusnet/statusnet.php
tumblr/tumblr.php
twitter/twitter.php
wppost/wppost.php

index f5f88e10658f27fd0de508e30df93cac24a94f89..131574819cdf74d2a3e20d442cf9ec31a8fc98b0 100644 (file)
@@ -247,6 +247,13 @@ function buffer_send(&$a,&$b) {
        if($b['parent'] != $b['id'])
                return;
 
+       // Dont't post if the post doesn't belong to us.
+       // This is a check for forum postings
+       $self = dba::select('contact', array('id'), array('uid' => $b['uid'], 'self' => true), array('limit' => 1));
+       if ($b['contact-id'] != $self['id']) {
+               return;
+       }
+
        // if post comes from buffer don't send it back
        //if($b['app'] == "Buffer")
        //      return;
index 64388bbd225eba760ef1673c1e5cf79852d0a6f0..04ed24ca84b42d12d5f3dfed190a3e3fecaacdf3 100755 (executable)
@@ -284,6 +284,13 @@ function diaspora_send(&$a,&$b) {
        if($b['parent'] != $b['id'])
                return;
 
+       // Dont't post if the post doesn't belong to us.
+       // This is a check for forum postings
+       $self = dba::select('contact', array('id'), array('uid' => $b['uid'], 'self' => true), array('limit' => 1));
+       if ($b['contact-id'] != $self['id']) {
+               return;
+       }
+
        logger('diaspora_send: prepare posting', LOGGER_DEBUG);
 
        $handle = PConfig::get($b['uid'],'diaspora','handle');
index 0ff512cf232febc9e67e0b3b5fc1984f6130b806..95def07a0b01dfd5dd0119bc74cf0e5f671f7ebf 100755 (executable)
@@ -155,15 +155,21 @@ function libertree_send(&$a,&$b) {
 
        logger('libertree_send: invoked');
 
-    if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited']))
-        return;
+       if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited']))
+               return;
 
-    if(! strstr($b['postopts'],'libertree'))
-        return;
+       if (! strstr($b['postopts'],'libertree'))
+               return;
 
-    if($b['parent'] != $b['id'])
-        return;
+       if ($b['parent'] != $b['id'])
+               return;
 
+       // Dont't post if the post doesn't belong to us.
+       // This is a check for forum postings
+       $self = dba::select('contact', array('id'), array('uid' => $b['uid'], 'self' => true), array('limit' => 1));
+       if ($b['contact-id'] != $self['id']) {
+               return;
+       }
 
        $ltree_api_token = PConfig::get($b['uid'],'libertree','libertree_api_token');
        $ltree_url = PConfig::get($b['uid'],'libertree','libertree_url');
index 3d3f5bf4d7dfcc3fbdccbb9edcfe8960c656b34b..358a2257163e92a5fd0a07ce54644117016d9a62 100644 (file)
@@ -415,6 +415,13 @@ function pumpio_send(&$a,&$b) {
 
                if (!count($receiver) && ($b['private'] || !strstr($b['postopts'],'pumpio')))
                        return;
+
+               // Dont't post if the post doesn't belong to us.
+               // This is a check for forum postings
+               $self = dba::select('contact', array('id'), array('uid' => $b['uid'], 'self' => true), array('limit' => 1));
+               if ($b['contact-id'] != $self['id']) {
+                       return;
+               }
        }
 
        if($b['verb'] == ACTIVITY_LIKE) {
index 5f3e83ca1c90667298d06ae779a13f9f0e67a3e8..94393313e6a440228a97506649a14389e1da03b4 100644 (file)
@@ -541,6 +541,13 @@ function statusnet_post_hook(&$a,&$b) {
 
                if($b['private'] || !strstr($b['postopts'],'statusnet'))
                        return;
+
+               // Dont't post if the post doesn't belong to us.
+               // This is a check for forum postings
+               $self = dba::select('contact', array('id'), array('uid' => $b['uid'], 'self' => true), array('limit' => 1));
+               if ($b['contact-id'] != $self['id']) {
+                       return;
+               }
        }
 
        if (($b['verb'] == ACTIVITY_POST) && $b['deleted'])
index 0a22d143a6ca25baade190ceb743ac03bfb1458d..77d98aca704493fa05dbf5ba28627f018a2c0866 100644 (file)
@@ -325,6 +325,13 @@ function tumblr_send(&$a,&$b) {
        if($b['parent'] != $b['id'])
                return;
 
+       // Dont't post if the post doesn't belong to us.
+       // This is a check for forum postings
+       $self = dba::select('contact', array('id'), array('uid' => $b['uid'], 'self' => true), array('limit' => 1));
+       if ($b['contact-id'] != $self['id']) {
+               return;
+       }
+
        $oauth_token = PConfig::get($b['uid'], "tumblr", "oauth_token");
        $oauth_token_secret = PConfig::get($b['uid'], "tumblr", "oauth_token_secret");
        $page = PConfig::get($b['uid'], "tumblr", "page");
index f8c6aec9a7e6c213ed45572a28847f62507d40c4..f0c71cf41b78eaca2efa7562818fe67d4a0569c5 100644 (file)
@@ -171,7 +171,7 @@ function twitter_jot_nets(&$a,&$b) {
        }
 }
 
-function twitter_settings_post ($a,$post) {
+function twitter_settings_post($a,$post) {
        if(! local_user())
                return;
        // don't check twitter settings if twitter submit button is not clicked
@@ -412,7 +412,7 @@ function twitter_post_hook(&$a,&$b) {
                        return;
        }
 
-       if($b['parent'] != $b['id']) {
+       if ($b['parent'] != $b['id']) {
                logger("twitter_post_hook: parameter ".print_r($b, true), LOGGER_DATA);
 
                // Looking if its a reply to a twitter post
@@ -446,8 +446,16 @@ function twitter_post_hook(&$a,&$b) {
        } else {
                $iscomment = false;
 
-               if($b['private'] || !strstr($b['postopts'],'twitter'))
+               if ($b['private'] || !strstr($b['postopts'],'twitter')) {
                        return;
+               }
+
+               // Dont't post if the post doesn't belong to us.
+               // This is a check for forum postings
+               $self = dba::select('contact', array('id'), array('uid' => $b['uid'], 'self' => true), array('limit' => 1));
+               if ($b['contact-id'] != $self['id']) {
+                       return;
+               }
        }
 
        if (($b['verb'] == ACTIVITY_POST) && $b['deleted'])
index f148310187c52aebab76d2493b460ba48a8dc5b7..ea26ae45340a7070de9e0d4fdb0bf772fecd96fb 100755 (executable)
@@ -200,6 +200,12 @@ function wppost_send(&$a,&$b) {
        if($b['parent'] != $b['id'])
                return;
 
+       // Dont't post if the post doesn't belong to us.
+       // This is a check for forum postings
+       $self = dba::select('contact', array('id'), array('uid' => $b['uid'], 'self' => true), array('limit' => 1));
+       if ($b['contact-id'] != $self['id']) {
+               return;
+       }
 
        $wp_username = xmlify(PConfig::get($b['uid'],'wppost','wp_username'));
        $wp_password = xmlify(PConfig::get($b['uid'],'wppost','wp_password'));