Update src/Module/Api/Friendica/DirectMessages/Setseen.php

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
Michael Vogel 2021-11-11 18:46:04 +01:00 committed by GitHub
parent 293775ab4a
commit 4587cef677
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}
}
}