Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ocsms.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2017-01-03 13:22:05 +0300
committerNer'zhul <nerzhul@users.noreply.github.com>2017-01-03 13:22:05 +0300
commit8296cdca78e9ecba1e9e609a6496a84f709bc91a (patch)
tree31c74843fbc2b6b204bfa6cd30526751049c9b97 /controller
parent3a669de20131e0954a60f657af55ba9ffed049cb (diff)
Set contact colours on uids (#152)
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'controller')
-rw-r--r--controller/smscontroller.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/controller/smscontroller.php b/controller/smscontroller.php
index 889b285..4eecc46 100644
--- a/controller/smscontroller.php
+++ b/controller/smscontroller.php
@@ -92,6 +92,7 @@ class SmsController extends Controller {
$contactsSrc = $this->contactCache->getContacts();
$contacts = array();
$photos = $this->contactCache->getContactPhotos();
+ $uids = $this->contactCache->getContactUids();
// Cache country because of loops
$configuredCountry = $this->configMapper->getCountry();
@@ -115,7 +116,7 @@ class SmsController extends Controller {
$photoversion = 2;
}
- return new JSONResponse(array("phonelist" => $phoneList, "contacts" => $contacts, "lastRead" => $lastRead, "photos" => $photos, "photo_version" => $photoversion));
+ return new JSONResponse(array("phonelist" => $phoneList, "contacts" => $contacts, "lastRead" => $lastRead, "photos" => $photos, "uids" => $uids, "photo_version" => $photoversion));
}
/**
@@ -216,13 +217,16 @@ class SmsController extends Controller {
$phoneList = $this->smsMapper->getNewMessagesCountForAllPhonesNumbers($this->userId, $lastDate);
$contactsSrc = $this->contactCache->getContacts();
$photosSrc = $this->contactCache->getContactPhotos();
+ $uidsSrc = $this->contactCache->getContactUids();
$contacts = array();
$photos = array();
+ $uids = array();
foreach ($phoneList as $number => $ts) {
$fmtPN = preg_replace("#[ ]#","", $number);
if (isset($contactsSrc[$fmtPN])) {
$contacts[$fmtPN] = $contactsSrc[$fmtPN];
+ $uids[$fmtPN] = $uidsSrc[$fmtPN];
if (isset($photosSrc[$contacts[$fmtPN]])) {
$photos[$contacts[$fmtPN]] = $photosSrc[$contacts[$fmtPN]];
@@ -230,7 +234,7 @@ class SmsController extends Controller {
}
}
- return new JSONResponse(array("phonelist" => $phoneList, "contacts" => $contacts, "photos" => $photos));
+ return new JSONResponse(array("phonelist" => $phoneList, "contacts" => $contacts, "photos" => $photos, "uids" => $uids));
}
/**