| Línea 371... |
Línea 371... |
| 371 |
}
|
371 |
}
|
| Línea 372... |
Línea 372... |
| 372 |
|
372 |
|
| 373 |
$conversationMapper = ConversationMapper::getInstance($this->adapter);
|
373 |
$conversationMapper = ConversationMapper::getInstance($this->adapter);
|
| Línea 374... |
Línea -... |
| 374 |
$conversation = $conversationMapper->fetchOneByUserId1AndUserId2($currentUser->id, $user->id);
|
- |
|
| 375 |
|
374 |
$conversation = $conversationMapper->fetchOneByUserId1AndUserId2($currentUser->id, $user->id);
|
| 376 |
|
375 |
|
| 377 |
$messages = [];
|
376 |
$messages = [];
|
| 378 |
if($conversation) {
|
377 |
if($conversation) {
|
| 379 |
$records = $messageMapper->getAllMessagesPaginatorByConversationId($conversation->id, $page);
|
378 |
$records = $messageMapper->getAllMessagesPaginatorByConversationId($conversation->id, $page);
|
| Línea 383... |
Línea 382... |
| 383 |
$dt = \DateTime::createFromFormat('Y-m-d H:i:s', $record->added_on);
|
382 |
$dt = \DateTime::createFromFormat('Y-m-d H:i:s', $record->added_on);
|
| 384 |
if($dt) {
|
383 |
if($dt) {
|
| 385 |
$timeElapsedString = Functions::timeElapsedString( $dt->getTimestamp() );
|
384 |
$timeElapsedString = Functions::timeElapsedString( $dt->getTimestamp() );
|
| 386 |
}
|
385 |
}
|
| Línea 387... |
Línea -... |
| 387 |
|
- |
|
| 388 |
|
386 |
|
| 389 |
if($record->sender_id == $currentUser->id) {
|
387 |
if($record->sender_id == $currentUser->id) {
|
| 390 |
array_push($messages, [
|
388 |
array_push($messages, [
|
| 391 |
'sender_name' => trim($currentUser->first_name . ' ' . $currentUser->last_name),
|
389 |
'sender_name' => trim($currentUser->first_name . ' ' . $currentUser->last_name),
|
| 392 |
'sender_image' => $this->url()->fromRoute('storage', ['type' => 'user', 'filename' => $currentUser->image, 'code' => $currentUser->uuid]),
|
390 |
'sender_image' => $this->url()->fromRoute('storage', ['type' => 'user', 'filename' => $currentUser->image, 'code' => $currentUser->uuid]),
|
| Línea 399... |
Línea 397... |
| 399 |
'type' => $record->type,
|
397 |
'type' => $record->type,
|
| 400 |
'filename' => $record->filename,
|
398 |
'filename' => $record->filename,
|
| 401 |
'date' => $timeElapsedString
|
399 |
'date' => $timeElapsedString
|
| 402 |
]);
|
400 |
]);
|
| 403 |
} else {
|
401 |
} else {
|
| - |
|
402 |
|
| - |
|
403 |
|
| - |
|
404 |
|
| 404 |
array_push($messages, [
|
405 |
array_push($messages, [
|
| 405 |
'sender_name' => trim($user->first_name . ' ' . $user->last_name),
|
406 |
'sender_name' => trim($user->first_name . ' ' . $user->last_name),
|
| 406 |
'sender_image' => $this->url()->fromRoute('storage', ['type' => 'user', 'filename' => $user->image, 'code' => $currentUser->uuid]),
|
407 |
'sender_image' => $this->url()->fromRoute('storage', ['type' => 'user', 'filename' => $user->image, 'code' => $user->uuid]),
|
| 407 |
'sender_profile' => $this->url()->fromRoute('profile/view', ['id' => $user->uuid]),
|
408 |
'sender_profile' => $this->url()->fromRoute('profile/view', ['id' => $user->uuid]),
|
| 408 |
'receiver_name' => trim($currentUser->first_name . ' ' . $currentUser->last_name),
|
409 |
'receiver_name' => trim($currentUser->first_name . ' ' . $currentUser->last_name),
|
| 409 |
'receiver_image' => $this->url()->fromRoute('storage', ['type' => 'user', 'filename' => $currentUser->image, 'code' => $user->uuid]),
|
410 |
'receiver_image' => $this->url()->fromRoute('storage', ['type' => 'user', 'filename' => $currentUser->image, 'code' => $user->uuid]),
|
| 410 |
'receiver_profile' => $this->url()->fromRoute('profile/view', ['id' => $currentUser->uuid]),
|
411 |
'receiver_profile' => $this->url()->fromRoute('profile/view', ['id' => $currentUser->uuid]),
|
| 411 |
'side' => 'right',
|
412 |
'side' => 'right',
|