From: Roland Haeder Date: Thu, 18 Sep 2014 22:43:52 +0000 (+0200) Subject: Fixed: X-Git-Url: https://git.mxchange.org/?p=quix0rs-gnu-social.git;a=commitdiff_plain;h=846a4b7816bf7f61a4e3a487d613785d5dd018fb Fixed: ----------------------------- Argument 2 passed to Ostatus_profile::notifyDeferred() must be an instance of Profile, instance of User given, called in /var/www/htdocs/plugins/OStatus/lib/ostatusqueuehandler.php on line 156 and defined (/var/www/htdocs/plugins/OStatus/classes/Ostatus_profile.php:363) [ABORT] ----------------------------- getProfile() must be called on this->user Plus fixed/added some type-hints. Signed-off-by: Roland Haeder --- diff --git a/classes/Avatar.php b/classes/Avatar.php index 6a58c74559..d86ffdfcdb 100644 --- a/classes/Avatar.php +++ b/classes/Avatar.php @@ -230,6 +230,12 @@ class Avatar extends Managed_DataObject try { return self::byProfile($target, $width, $height)->displayUrl(); } catch (Exception $e) { + common_debug(sprintf('target=>id=%s,width=%s,height=%s,message=%s', + $target->id, + $width, + $height, + $e->getMessage() + )); return self::defaultImage($width); } } diff --git a/lib/activityutils.php b/lib/activityutils.php index d4c01232ec..a0fc487232 100644 --- a/lib/activityutils.php +++ b/lib/activityutils.php @@ -300,7 +300,7 @@ class ActivityUtils return false; } - static function getFeedAuthor($feedEl) + static function getFeedAuthor(DOMElement $feedEl) { // Try old and deprecated activity:subject @@ -347,10 +347,10 @@ class ActivityUtils return null; } - static function compareTypes($type, $objects) // this does verbs too! + static function compareTypes($type, array $objects) // this does verbs too! { $type = self::resolveUri($type); - foreach ((array)$objects as $object) { + foreach ($objects as $object) { if ($type === self::resolveUri($object)) { return true; } diff --git a/plugins/OStatus/lib/ostatusqueuehandler.php b/plugins/OStatus/lib/ostatusqueuehandler.php index 3e9c4828fb..964580cf49 100644 --- a/plugins/OStatus/lib/ostatusqueuehandler.php +++ b/plugins/OStatus/lib/ostatusqueuehandler.php @@ -146,14 +146,14 @@ class OStatusQueueHandler extends QueueHandler $this->pushFeed($feed, array($this, 'peopletagFeedForNotice'), $ptag); } - function pingReply($oprofile) + function pingReply(OStatus_profile $oprofile) { if ($this->user) { // For local posts, send a Salmon ping to the mentioned // remote user or group. // @fixme as an optimization we can skip this if the // remote profile is subscribed to the author. - $oprofile->notifyDeferred($this->notice, $this->user); + $oprofile->notifyDeferred($this->notice, $this->user->getProfile()); } } diff --git a/plugins/OStatus/scripts/update_ostatus_profiles.php b/plugins/OStatus/scripts/update_ostatus_profiles.php index 01116bb6f4..9102a0a2cb 100644 --- a/plugins/OStatus/scripts/update_ostatus_profiles.php +++ b/plugins/OStatus/scripts/update_ostatus_profiles.php @@ -118,7 +118,7 @@ class LooseOstatusProfile extends Ostatus_profile * @throws Exception on various error conditions * @throws OStatusShadowException if this reference would obscure a local user/group */ - public static function updateProfileURL($profile_url, $hints=array()) + public static function updateProfileURL($profile_url, array $hints=array()) { $oprofile = null;