use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Module\BaseApi;
+use Friendica\Network\HTTPException\NotFoundException;
/**
* @see https://docs.joinmastodon.org/methods/timelines/conversations/
{
protected function delete(array $request = [])
{
- self::checkAllowedScope(self::SCOPE_WRITE);
+ $this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (!empty($this->parameters['id'])) {
*/
protected function rawContent(array $request = [])
{
- self::checkAllowedScope(self::SCOPE_READ);
+ $this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$request = $this->getRequest([
$conversations = [];
- while ($conv = DBA::fetch($convs)) {
- self::setBoundaries($conv['id']);
- $conversations[] = DI::mstdnConversation()->createFromConvId($conv['id']);
+ try {
+ while ($conv = DBA::fetch($convs)) {
+ self::setBoundaries($conv['id']);
+ $conversations[] = DI::mstdnConversation()->createFromConvId($conv['id']);
+ }
+ } catch (NotFoundException $e) {
+ $this->logErrorAndJsonExit(404, $this->errorFactory->RecordNotFound());
}
DBA::close($convs);