mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-07 16:06:15 +00:00
Try to cleanup check_new_messages
This commit is contained in:
parent
631640c5bb
commit
b84ff1088f
@ -215,19 +215,13 @@ class SmsController extends Controller {
|
|||||||
$photos = array();
|
$photos = array();
|
||||||
|
|
||||||
foreach ($phoneList as $number => $ts) {
|
foreach ($phoneList as $number => $ts) {
|
||||||
$fmtPN = preg_replace("#[ ]#","/", $number);
|
$fmtPN = preg_replace("#[ ]#","", $number);
|
||||||
if (isset($contactsSrc[$fmtPN])) {
|
if (isset($contactsSrc[$fmtPN])) {
|
||||||
$fmtPN2 = preg_replace("#[/]#","", $fmtPN);
|
|
||||||
$contacts[$fmtPN] = $contactsSrc[$fmtPN];
|
$contacts[$fmtPN] = $contactsSrc[$fmtPN];
|
||||||
$contacts[$fmtPN2] = $contactsSrc[$fmtPN];
|
|
||||||
|
|
||||||
if (isset($photosSrc[$contacts[$fmtPN]])) {
|
if (isset($photosSrc[$contacts[$fmtPN]])) {
|
||||||
$photos[$contacts[$fmtPN]] = $photosSrc[$contacts[$fmtPN]];
|
$photos[$contacts[$fmtPN]] = $photosSrc[$contacts[$fmtPN]];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($photosSrc[$contacts[$fmtPN2]])) {
|
|
||||||
$photos[$contacts[$fmtPN2]] = $photosSrc[$contacts[$fmtPN2]];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,9 +204,8 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile'
|
|||||||
var bufferedContacts = [];
|
var bufferedContacts = [];
|
||||||
|
|
||||||
$.each(jsondata['phonelist'], function(id, val) {
|
$.each(jsondata['phonelist'], function(id, val) {
|
||||||
var fn, peerLabel, idxVal, idxVal2;
|
var fn, peerLabel, idxVal;
|
||||||
idxVal = id.replace(/\//g,' ');
|
idxVal = id.replace(/\//g,'');
|
||||||
idxVal2 = idxVal.replace('/ /g','');
|
|
||||||
if (typeof jsondata['contacts'][id] == 'undefined') {
|
if (typeof jsondata['contacts'][id] == 'undefined') {
|
||||||
peerLabel = idxVal;
|
peerLabel = idxVal;
|
||||||
}
|
}
|
||||||
@ -218,7 +217,7 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile'
|
|||||||
if (!inArray(peerLabel, bufferedContacts)) {
|
if (!inArray(peerLabel, bufferedContacts)) {
|
||||||
var contactObj = {
|
var contactObj = {
|
||||||
'label': peerLabel,
|
'label': peerLabel,
|
||||||
'nav': idxVal2,
|
'nav': idxVal,
|
||||||
'unread': val
|
'unread': val
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user