@@ 145-154 (lines=10) @@ | ||
142 | return new JsonResponse($response, 200); |
|
143 | } |
|
144 | ||
145 | public function load() |
|
146 | { |
|
147 | $friend_id = $this->request->variable('friend_id', 0); |
|
148 | ||
149 | if ($friend_id > 0) { |
|
150 | $messages = $this->model->getMessages($friend_id); |
|
151 | return new JsonResponse($messages, 200); |
|
152 | } |
|
153 | return new JsonResponse(array('success' => false, 'error' => 'The request is invalid'), 200); |
|
154 | } |
|
155 | ||
156 | public function updateMessages() |
|
157 | { |
|
@@ 156-164 (lines=9) @@ | ||
153 | return new JsonResponse(array('success' => false, 'error' => 'The request is invalid'), 200); |
|
154 | } |
|
155 | ||
156 | public function updateMessages() |
|
157 | { |
|
158 | $friend_id = $this->request->variable('friend_id', 0); |
|
159 | if ($friend_id > 0) { |
|
160 | $newVal = $this->model->updateMessagesStatus($friend_id); |
|
161 | return new JsonResponse(array('success' => true, 'newVal' => $newVal), 200); |
|
162 | } |
|
163 | return new JsonResponse(array('success' => false), 200); |
|
164 | } |
|
165 | ||
166 | public function checkForNewMessages() |
|
167 | { |
|
@@ 166-174 (lines=9) @@ | ||
163 | return new JsonResponse(array('success' => false), 200); |
|
164 | } |
|
165 | ||
166 | public function checkForNewMessages() |
|
167 | { |
|
168 | $friend_id = $this->request->variable('friend_id', 0); |
|
169 | if ($friend_id > 0) { |
|
170 | $messages = $this->model->getInboxFromId($friend_id); |
|
171 | return new JsonResponse(array('success' => true, 'messages' => $messages), 200); |
|
172 | } |
|
173 | return new JsonResponse(array('success' => false), 200); |
|
174 | } |
|
175 | ||
176 | public function getFriends() |
|
177 | { |