Avoid warnings in addons #639
2 changed files with 11 additions and 3 deletions
|
@ -1168,7 +1168,11 @@ function pumpio_dopost(&$a, $client, $uid, $self, $post, $own_id, $threadcomplet
|
||||||
|
|
||||||
$reply = new stdClass;
|
$reply = new stdClass;
|
||||||
$reply->verb = "note";
|
$reply->verb = "note";
|
||||||
$reply->cc = $post->cc;
|
|
||||||
|
if (isset($post->cc)) {
|
||||||
|
$reply->cc = $post->cc;
|
||||||
|
}
|
||||||
|
|
||||||
$reply->to = $post->to;
|
$reply->to = $post->to;
|
||||||
$reply->object = new stdClass;
|
$reply->object = new stdClass;
|
||||||
$reply->object->objectType = $post->object->inReplyTo->objectType;
|
$reply->object->objectType = $post->object->inReplyTo->objectType;
|
||||||
|
|
|
@ -422,6 +422,7 @@ function twitter_action(App $a, $uid, $pid, $action)
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case "delete":
|
case "delete":
|
||||||
// To-Do: $result = $connection->post('statuses/destroy', $post);
|
// To-Do: $result = $connection->post('statuses/destroy', $post);
|
||||||
|
$result = [];
|
||||||
break;
|
break;
|
||||||
case "like":
|
case "like":
|
||||||
$result = $connection->post('favorites/create', $post);
|
$result = $connection->post('favorites/create', $post);
|
||||||
|
@ -429,6 +430,9 @@ function twitter_action(App $a, $uid, $pid, $action)
|
||||||
case "unlike":
|
case "unlike":
|
||||||
$result = $connection->post('favorites/destroy', $post);
|
$result = $connection->post('favorites/destroy', $post);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
logger('Unhandled action ' . $action, LOGGER_DEBUG);
|
||||||
|
$result = [];
|
||||||
}
|
}
|
||||||
logger("twitter_action '" . $action . "' send, result: " . print_r($result, true), LOGGER_DEBUG);
|
logger("twitter_action '" . $action . "' send, result: " . print_r($result, true), LOGGER_DEBUG);
|
||||||
}
|
}
|
||||||
|
@ -1508,11 +1512,11 @@ function twitter_fetchparentposts(App $a, $uid, $post, TwitterOAuth $connection,
|
||||||
|
|
||||||
$posts = array_reverse($posts);
|
$posts = array_reverse($posts);
|
||||||
|
|
||||||
if (count($posts)) {
|
if (!empty($posts)) {
|
||||||
foreach ($posts as $post) {
|
foreach ($posts as $post) {
|
||||||
$postarray = twitter_createpost($a, $uid, $post, $self, false, false, false);
|
$postarray = twitter_createpost($a, $uid, $post, $self, false, false, false);
|
||||||
|
|
||||||
if (trim($postarray['body']) == "") {
|
if (emptx($postarray['body'])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue