mirror of
				https://github.com/nerzhul/ocsms.git
				synced 2025-10-28 00:49:11 +00:00 
			
		
		
		
	Spaces
This commit is contained in:
		
							parent
							
								
									b8d0e66a9d
								
							
						
					
					
						commit
						0a70084de8
					
				| @ -112,19 +112,19 @@ class SmsController extends Controller { | |||||||
| 		if (isset($contacts[$phoneNumber])) { | 		if (isset($contacts[$phoneNumber])) { | ||||||
| 			$contactName = $contacts[$phoneNumber]; | 			$contactName = $contacts[$phoneNumber]; | ||||||
| 		} | 		} | ||||||
| 		 | 
 | ||||||
| 		$messages = array(); | 		$messages = array(); | ||||||
| 		$phoneNumbers = array(); | 		$phoneNumbers = array(); | ||||||
| 		 | 
 | ||||||
| 		// Contact resolved
 | 		// Contact resolved
 | ||||||
| 		if ($contactName != "") { | 		if ($contactName != "") { | ||||||
| 			$iContacts = $this->app->getInvertedContacts(); | 			$iContacts = $this->app->getInvertedContacts(); | ||||||
| 			$messages = array(); | 			$messages = array(); | ||||||
| 			 | 
 | ||||||
| 			// If there is iContacts (this must be)
 | 			// If there is iContacts (this must be)
 | ||||||
| 			if (isset($iContacts[$contactName])) { | 			if (isset($iContacts[$contactName])) { | ||||||
| 				$ctPn = count($iContacts[$contactName]); | 				$ctPn = count($iContacts[$contactName]); | ||||||
| 				 | 
 | ||||||
| 				// We merge each message list into global messagelist
 | 				// We merge each message list into global messagelist
 | ||||||
| 				for ($i=0; $i < $ctPn; $i++) { | 				for ($i=0; $i < $ctPn; $i++) { | ||||||
| 					$messages = $messages + | 					$messages = $messages + | ||||||
| @ -142,10 +142,10 @@ class SmsController extends Controller { | |||||||
| 			$messages = $this->smsMapper->getAllMessagesForPhoneNumber($this->userId, $phoneNumber, $lastDate); | 			$messages = $this->smsMapper->getAllMessagesForPhoneNumber($this->userId, $phoneNumber, $lastDate); | ||||||
| 			$phoneNumbers[] = $phoneNumber; | 			$phoneNumbers[] = $phoneNumber; | ||||||
| 		} | 		} | ||||||
| 		 | 
 | ||||||
| 		// Order by id (date)
 | 		// Order by id (date)
 | ||||||
| 		ksort($messages); | 		ksort($messages); | ||||||
| 		 | 
 | ||||||
| 		// @ TODO: filter correctly
 | 		// @ TODO: filter correctly
 | ||||||
| 		return new JSONResponse(array("conversation" => $messages, "contactName" => $contactName, "phoneNumbers" => $phoneNumbers)); | 		return new JSONResponse(array("conversation" => $messages, "contactName" => $contactName, "phoneNumbers" => $phoneNumbers)); | ||||||
| 	} | 	} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user