]> git.mxchange.org Git - friendica-addons.git/blobdiff - tumblr/tumblr.php
Fix formatting
[friendica-addons.git] / tumblr / tumblr.php
index 0a22d143a6ca25baade190ceb743ac03bfb1458d..c255f5a42a8089f5a4531274634af9cf356ccb33 100644 (file)
@@ -316,14 +316,24 @@ function tumblr_post_local(&$a, &$b) {
 
 function tumblr_send(&$a,&$b) {
 
-       if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited']))
+       if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
                return;
+       }
+
+       if(! strstr($b['postopts'],'tumblr')) {
+               return;
+       }
 
-       if(! strstr($b['postopts'],'tumblr'))
+       if($b['parent'] != $b['id']) {
                return;
+       }
 
-       if($b['parent'] != $b['id'])
+       // Dont't post if the post doesn't belong to us.
+       // This is a check for forum postings
+       $self = dba::selectOne('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
+       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");