1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-07 16:06:15 +00:00

Conversation header CSS fix & unicity fixes for unread messages & peerlist last messages

Note: for unread message count we need one more fix
This commit is contained in:
Loic Blot 2016-09-22 23:06:22 +02:00
parent 745d7092ad
commit 010acd7adc
2 changed files with 7 additions and 4 deletions

View File

@ -54,7 +54,7 @@
#app-content-wrapper {
padding: 15px;
margin-top: 80px;
margin-top: 100px;
min-height: auto !important;
}

View File

@ -211,7 +211,7 @@ class SmsMapper extends Mapper {
$phoneList = array();
while ($row = $result->fetchRow()) {
$phoneNumber = preg_replace("#[ ]#", "", $row["sms_address"]);
if (!in_array($phoneNumber, $phoneList)) {
if (!array_key_exists($phoneNumber, $phoneList)) {
$phoneList[$phoneNumber] = $row["mx"];
}
// Maybe duplicate due to spaces in database
@ -235,10 +235,13 @@ class SmsMapper extends Mapper {
$phoneList = array();
while ($row = $result->fetchRow()) {
$phoneNumber = preg_replace("#[ ]#", "", $row["sms_address"]);
if (!in_array($phoneNumber, $phoneList)) {
if ($this->getLastReadDateForPhoneNumber($userId, $phoneNumber) < $lastDate) {
if ($this->getLastReadDateForPhoneNumber($userId, $row["sms_address"]) < $lastDate) {
if (!array_key_exists($phoneNumber, $phoneList)) {
$phoneList[$phoneNumber] = $row["ct"];
}
else {
$phoneList[$phoneNumber] += $row["ct"];
}
}
}
return $phoneList;