mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-09 00:46:17 +00:00
Little fix for contact load, but this isn't working yet
This commit is contained in:
parent
b17cf11020
commit
b75a8b3547
@ -82,11 +82,12 @@ class Application extends App {
|
||||
public function getContacts() {
|
||||
// Only load contacts if they aren't in the buffer
|
||||
if(count(self::$contacts) == 0) {
|
||||
self::$contacts = array();
|
||||
$cm = $this->c['ContactsManager'];
|
||||
$result = $cm->search('',array('FN'));
|
||||
foreach ($result as $r) {
|
||||
if (isset ($r["phone"])) {
|
||||
self::$contacts[$r["phone"]] = $r["FN"];
|
||||
if (isset ($r["TEL"])) {
|
||||
self::$contacts[$r["TEL"]] = $r["FN"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ class SmsController extends Controller {
|
||||
public function getConversation ($phoneNumber, $lastDate = 0) {
|
||||
$messages = $this->smsMapper->getAllMessagesForPhoneNumber($this->userId, $phoneNumber, $lastDate);
|
||||
// @ TODO: filter correctly
|
||||
return new JSONResponse(array("conversation" => $messages, $contacts => $this->app->getContacts()));
|
||||
return new JSONResponse(array("conversation" => $messages, "contacts" => $this->app->getContacts()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user