mirror of
https://github.com/friendica/friendica
synced 2024-12-23 12:40:17 +00:00
Merge pull request #2489 from annando/1604-unseen
Check before doing the database update
This commit is contained in:
commit
1644919880
1 changed files with 5 additions and 2 deletions
|
@ -1335,9 +1335,12 @@
|
|||
|
||||
$idlist = implode(",", $idarray);
|
||||
|
||||
if ($idlist != "")
|
||||
$r = q("UPDATE `item` SET `unseen` = 0 WHERE `unseen` AND `id` IN (%s)", $idlist);
|
||||
if ($idlist != "") {
|
||||
$unseen = q("SELECT `id` FROM `item` WHERE `unseen` AND `id` IN (%s)", $idlist);
|
||||
|
||||
if ($unseen)
|
||||
$r = q("UPDATE `item` SET `unseen` = 0 WHERE `unseen` AND `id` IN (%s)", $idlist);
|
||||
}
|
||||
|
||||
$data = array('$statuses' => $ret);
|
||||
switch($type){
|
||||
|
|
Loading…
Reference in a new issue