mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-07 16:06:15 +00:00
Add a fix for duplicates messages in database with or without spaces
This commit is contained in:
parent
4a8562642b
commit
745d7092ad
@ -214,6 +214,10 @@ class SmsMapper extends Mapper {
|
|||||||
if (!in_array($phoneNumber, $phoneList)) {
|
if (!in_array($phoneNumber, $phoneList)) {
|
||||||
$phoneList[$phoneNumber] = $row["mx"];
|
$phoneList[$phoneNumber] = $row["mx"];
|
||||||
}
|
}
|
||||||
|
// Maybe duplicate due to spaces in database
|
||||||
|
else if ($phoneList[$phoneNumber] < $row["mx"]) {
|
||||||
|
$phoneList[$phoneNumber] = $row["mx"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $phoneList;
|
return $phoneList;
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile'
|
|||||||
var phoneNumberLabel = $scope.selectedContact.nav;
|
var phoneNumberLabel = $scope.selectedContact.nav;
|
||||||
|
|
||||||
if (typeof jsondata['phoneNumbers'] != 'undefined') {
|
if (typeof jsondata['phoneNumbers'] != 'undefined') {
|
||||||
phoneNumberList = arrayUnique(jsondata['phoneNumbers']);
|
var phoneNumberList = arrayUnique(jsondata['phoneNumbers']);
|
||||||
phoneNumberLabel = phoneNumberList.toString();
|
phoneNumberLabel = phoneNumberList.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -491,7 +491,6 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile'
|
|||||||
changeSelectedConversation($("a[mailbox-navigation='" + urlPhoneNumber + "']"));
|
changeSelectedConversation($("a[mailbox-navigation='" + urlPhoneNumber + "']"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
$scope.fetchInitialSettings();
|
$scope.fetchInitialSettings();
|
||||||
$scope.initDesktopNotifies();
|
$scope.initDesktopNotifies();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user