From: Mikael Nordfeldth Date: Thu, 3 Jul 2014 12:08:26 +0000 (+0200) Subject: Saved incoming activites for Favorite as wrong profile X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=53b794342cc3ccfa07757c58cd3651e68c3c5080;p=quix0rs-gnu-social.git Saved incoming activites for Favorite as wrong profile also removed some debugging lines Now we have to get rid of OStatus dependency in lib/activityhandlerplugin.php --- diff --git a/classes/Notice.php b/classes/Notice.php index 74f2f6aa91..4bd117b837 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -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; } diff --git a/lib/activityhandlerplugin.php b/lib/activityhandlerplugin.php index 113b7eab1e..b94385b447 100644 --- a/lib/activityhandlerplugin.php +++ b/lib/activityhandlerplugin.php @@ -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;