mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-08 16:36:25 +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() {
|
public function getContacts() {
|
||||||
// Only load contacts if they aren't in the buffer
|
// Only load contacts if they aren't in the buffer
|
||||||
if(count(self::$contacts) == 0) {
|
if(count(self::$contacts) == 0) {
|
||||||
|
self::$contacts = array();
|
||||||
$cm = $this->c['ContactsManager'];
|
$cm = $this->c['ContactsManager'];
|
||||||
$result = $cm->search('',array('FN'));
|
$result = $cm->search('',array('FN'));
|
||||||
foreach ($result as $r) {
|
foreach ($result as $r) {
|
||||||
if (isset ($r["phone"])) {
|
if (isset ($r["TEL"])) {
|
||||||
self::$contacts[$r["phone"]] = $r["FN"];
|
self::$contacts[$r["TEL"]] = $r["FN"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ class SmsController extends Controller {
|
|||||||
public function getConversation ($phoneNumber, $lastDate = 0) {
|
public function getConversation ($phoneNumber, $lastDate = 0) {
|
||||||
$messages = $this->smsMapper->getAllMessagesForPhoneNumber($this->userId, $phoneNumber, $lastDate);
|
$messages = $this->smsMapper->getAllMessagesForPhoneNumber($this->userId, $phoneNumber, $lastDate);
|
||||||
// @ TODO: filter correctly
|
// @ 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