X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Ftwitapistatuses.php;h=1f3c53beffd72c652d6ba6a6c102f79436a80b7a;hb=b2664e1ae2e2cf66585cdd8696d88efdd053eb3b;hp=185129d5eee91f2634a8d613f29da8f80066ad70;hpb=9f07921b45190b462e1a798622068e24ef31e124;p=quix0rs-gnu-social.git diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index 185129d5ee..1f3c53beff 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -242,14 +242,15 @@ class TwitapistatusesAction extends TwitterapiAction $status_shortened = common_shorten_links($status); - if (mb_strlen($status_shortened) > 140) { + if (Notice::contentTooLong($status_shortened)) { // XXX: Twitter truncates anything over 140, flags the status // as "truncated." Sending this error may screw up some clients // that assume Twitter will truncate for them. Should we just // truncate too? -- Zach - $this->clientError(_('That\'s too long. Max notice size is 140 chars.'), - $code = 406, $apidata['content-type']); + $this->clientError(sprintf(_('That\'s too long. Max notice size is %d chars.'), + Notice::maxContent()), + $code = 406, $apidata['content-type']); return; } } @@ -396,8 +397,14 @@ class TwitapistatusesAction extends TwitterapiAction } else { // XXX: Twitter just sets a 404 header and doens't bother // to return an err msg - $this->clientError(_('No status with that ID found.'), - 404, $apidata['content-type']); + $deleted = Deleted_notice::staticGet($notice_id); + if (!empty($deleted)) { + $this->clientError(_('Status deleted.'), + 410, $apidata['content-type']); + } else { + $this->clientError(_('No status with that ID found.'), + 404, $apidata['content-type']); + } } }