From 4587cef677e7c5deb3563f7a77c2afc6244695c3 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 11 Nov 2021 18:46:04 +0100 Subject: [PATCH] Update src/Module/Api/Friendica/DirectMessages/Setseen.php Co-authored-by: Hypolite Petovan --- src/Module/Api/Friendica/DirectMessages/Setseen.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Module/Api/Friendica/DirectMessages/Setseen.php b/src/Module/Api/Friendica/DirectMessages/Setseen.php index 8d274ca66..334f4e295 100644 --- a/src/Module/Api/Friendica/DirectMessages/Setseen.php +++ b/src/Module/Api/Friendica/DirectMessages/Setseen.php @@ -51,15 +51,12 @@ class Setseen extends BaseApi } // update seen indicator - $result = DBA::update('mail', ['seen' => true], ['id' => $request['id']]); - - if ($result) { - // return success + if (DBA::update('mail', ['seen' => true], ['id' => $request['id']])) { $answer = ['result' => 'ok', 'message' => 'message set to seen']; - self::exit('direct_messages_setseen', ['$result' => $answer], $parameters['extension'] ?? null); } else { $answer = ['result' => 'error', 'message' => 'unknown error']; - self::exit('direct_messages_setseen', ['$result' => $answer], $parameters['extension'] ?? null); } + + self::exit('direct_messages_setseen', ['$result' => $answer], $parameters['extension'] ?? null); } }