From f84b99c8623bc793883106a0ef62b8f16b41f24a Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Fri, 7 Mar 2014 15:31:19 +0400 Subject: [PATCH] check userpost existence instead of error code --- twisterpost.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twisterpost.php b/twisterpost.php index 5783955..c10bb83 100644 --- a/twisterpost.php +++ b/twisterpost.php @@ -101,7 +101,7 @@ class TwisterPost $k = $this->maxId + 1; $text = escapeshellarg($text); $result = $this->runRpcCommand('newpostmsg', "{$this->user} $k $text"); - if (isset($result->code) && $result->code < 0) { + if (!isset($result->userpost) || !isset($result->userpost->k) || ($result->userpost->k != $k)) { $this->maxId = -1; $this->lastError = $result; return false;