diff --git a/db/smsmapper.php b/db/smsmapper.php index 657f617..bef1710 100644 --- a/db/smsmapper.php +++ b/db/smsmapper.php @@ -214,6 +214,10 @@ class SmsMapper extends Mapper { if (!in_array($phoneNumber, $phoneList)) { $phoneList[$phoneNumber] = $row["mx"]; } + // Maybe duplicate due to spaces in database + else if ($phoneList[$phoneNumber] < $row["mx"]) { + $phoneList[$phoneNumber] = $row["mx"]; + } } return $phoneList; } diff --git a/js/public/app.js b/js/public/app.js index 78d3076..6901e49 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -155,7 +155,7 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile' var phoneNumberLabel = $scope.selectedContact.nav; if (typeof jsondata['phoneNumbers'] != 'undefined') { - phoneNumberList = arrayUnique(jsondata['phoneNumbers']); + var phoneNumberList = arrayUnique(jsondata['phoneNumbers']); phoneNumberLabel = phoneNumberList.toString(); } @@ -491,7 +491,6 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile' changeSelectedConversation($("a[mailbox-navigation='" + urlPhoneNumber + "']")); } } - }); $scope.fetchInitialSettings(); $scope.initDesktopNotifies();