fix errors in pumpio addon

This commit is contained in:
Art4 2024-11-30 20:12:23 +00:00 committed by Hypolite Petovan
parent 7fa2dfc608
commit bda683c56b

View file

@ -6,7 +6,6 @@
* Author: Michael Vogel <http://pirati.ca/profile/heluecht> * Author: Michael Vogel <http://pirati.ca/profile/heluecht>
*/ */
use Friendica\App;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML; use Friendica\Content\Text\HTML;
use Friendica\Core\Addon; use Friendica\Core\Addon;
@ -582,6 +581,8 @@ function pumpio_action(int $uid, string $uri, string $action, string $content =
$uri = $orig_post['uri']; $uri = $orig_post['uri'];
} }
$objectType = '';
if (($orig_post['object-type'] != '') && (strstr($orig_post['object-type'], ActivityNamespace::ACTIVITY_SCHEMA))) { if (($orig_post['object-type'] != '') && (strstr($orig_post['object-type'], ActivityNamespace::ACTIVITY_SCHEMA))) {
$objectType = str_replace(ActivityNamespace::ACTIVITY_SCHEMA, '', $orig_post['object-type']); $objectType = str_replace(ActivityNamespace::ACTIVITY_SCHEMA, '', $orig_post['object-type']);
} elseif (strstr($uri, '/api/comment/')) { } elseif (strstr($uri, '/api/comment/')) {
@ -827,6 +828,7 @@ function pumpio_dounlike(int $uid, array $self, $post, string $own_id)
} }
$contactid = 0; $contactid = 0;
$contact = [];
if (Strings::compareLink($post->actor->url, $own_id)) { if (Strings::compareLink($post->actor->url, $own_id)) {
$contactid = $self['id']; $contactid = $self['id'];
@ -1430,6 +1432,8 @@ function pumpio_fetchallcomments($uid, $id)
Logger::notice('pumpio_fetchallcomments: fetching comment for user ' . $uid . ', URL ' . $url); Logger::notice('pumpio_fetchallcomments: fetching comment for user ' . $uid . ', URL ' . $url);
$item = new \stdClass();
if (pumpio_reachable($url)) { if (pumpio_reachable($url)) {
$success = $client->CallAPI($url, 'GET', [], ['FailOnAccessError' => true], $item); $success = $client->CallAPI($url, 'GET', [], ['FailOnAccessError' => true], $item);
} else { } else {