]> git.mxchange.org Git - friendica-addons.git/blobdiff - pumpio/pumpio.php
Fix formatting
[friendica-addons.git] / pumpio / pumpio.php
index 3d3f5bf4d7dfcc3fbdccbb9edcfe8960c656b34b..96883826521d1e31b120be2c9dfa0903297a520e 100644 (file)
@@ -5,7 +5,6 @@
  * Version: 0.2
  * Author: Michael Vogel <http://pirati.ca/profile/heluecht>
  */
-
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Core\Worker;
@@ -15,7 +14,6 @@ use Friendica\Object\Contact;
 require 'addon/pumpio/oauth/http.php';
 require 'addon/pumpio/oauth/oauth_client.php';
 require_once 'include/enotify.php';
-require_once "include/Photo.php";
 require_once "mod/share.php";
 
 define('PUMPIO_DEFAULT_POLL_INTERVAL', 5); // given in minutes
@@ -415,6 +413,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) {
@@ -1039,8 +1044,7 @@ function pumpio_get_contact($uid, $contact, $no_insert = false) {
                */
        }
 
-       if (function_exists("update_contact_avatar"))
-               update_contact_avatar($contact->image->url, $uid, $contact_id);
+       Contact::updateAvatar($contact->image->url, $uid, $contact_id);
 
        return($contact_id);
 }