]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Saved incoming activites for Favorite as wrong profile
authorMikael Nordfeldth <mmn@hethane.se>
Thu, 3 Jul 2014 12:08:26 +0000 (14:08 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 3 Jul 2014 12:08:26 +0000 (14:08 +0200)
also removed some debugging lines

Now we have to get rid of OStatus dependency in lib/activityhandlerplugin.php

classes/Notice.php
lib/activityhandlerplugin.php

index 74f2f6aa912d20ce4a4e1af8a4314936385f5903..4bd117b8375fbff470bf5405a837fe2e1aafeaf4 100644 (file)
@@ -901,7 +901,6 @@ class Notice extends Managed_DataObject
             }
         }
 
-        common_debug(get_called_class().' looking up mentions metadata etc.');
         // Save per-notice metadata...
         $mentions = array();
         $groups   = array();
@@ -939,8 +938,6 @@ class Notice extends Managed_DataObject
             $stored->distribute();
         }
         
-        common_debug(get_called_class().' returning stored activity - success!');
-
         return $stored;
     }
 
index 113b7eab1e0255b40ea9171d01ec3d65b5374fd0..b94385b4472e0920ca9a3c79f75b96e6cd49003c 100644 (file)
@@ -351,7 +351,6 @@ abstract class ActivityHandlerPlugin extends Plugin
                 throw new ClientException(_('Object not posted to this group.'));
             }
         } elseif ($target instanceof Profile && $target->isLocal()) {
-            common_debug(get_called_class() . ' got a salmon slap against target profile ID: '.$target->id);
             $original = null;
             // FIXME: Shouldn't favorites show up with a 'target' activityobject?
             if (!ActivityUtils::compareTypes($activity->verb, array(ActivityVerb::POST)) && isset($activity->objects[0])) {
@@ -374,8 +373,8 @@ abstract class ActivityHandlerPlugin extends Plugin
             throw new ServerException(_('Do not know how to handle this kind of target.'));
         }
 
-        common_debug(get_called_class() . ' ensuring ActivityObject profile for '.$activity->actor->id);
-        $actor = Ostatus_profile::ensureActivityObjectProfile($activity->actor);
+        $oactor = Ostatus_profile::ensureActivityObjectProfile($activity->actor);
+        $actor = $oactor->localProfile();
 
         // FIXME: will this work in all cases? I made it work for Favorite...
         if (ActivityUtils::compareTypes($activity->verb, array(ActivityVerb::POST))) {
@@ -389,12 +388,10 @@ abstract class ActivityHandlerPlugin extends Plugin
                          'is_local' => Notice::REMOTE,
                          'source' => 'ostatus');
 
-        // $actor is an ostatus_profile
-        common_debug(get_called_class() . ' going to save notice from activity!');
         if (!isset($this->oldSaveNew)) {
-            $notice = Notice::saveActivity($activity, $target, $options);
+            $notice = Notice::saveActivity($activity, $actor, $options);
         } else {
-            $notice = $this->saveNoticeFromActivity($activity, $target, $options);
+            $notice = $this->saveNoticeFromActivity($activity, $actor, $options);
         }
 
         return false;