diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 534367a0..a8e5c31f 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -1168,7 +1168,11 @@ function pumpio_dopost(&$a, $client, $uid, $self, $post, $own_id, $threadcomplet $reply = new stdClass; $reply->verb = "note"; - $reply->cc = $post->cc; + + if (isset($post->cc)) { + $reply->cc = $post->cc; + } + $reply->to = $post->to; $reply->object = new stdClass; $reply->object->objectType = $post->object->inReplyTo->objectType; diff --git a/twitter/twitter.php b/twitter/twitter.php index e6c3e4a7..c106db88 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -422,6 +422,7 @@ function twitter_action(App $a, $uid, $pid, $action) switch ($action) { case "delete": // To-Do: $result = $connection->post('statuses/destroy', $post); + $result = []; break; case "like": $result = $connection->post('favorites/create', $post); @@ -429,6 +430,9 @@ function twitter_action(App $a, $uid, $pid, $action) case "unlike": $result = $connection->post('favorites/destroy', $post); break; + default: + logger('Unhandled action ' . $action, LOGGER_DEBUG); + $result = []; } 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); - if (count($posts)) { + if (!empty($posts)) { foreach ($posts as $post) { $postarray = twitter_createpost($a, $uid, $post, $self, false, false, false); - if (trim($postarray['body']) == "") { + if (emptx($postarray['body'])) { continue; }