protected function makeMessageCollection($conversations)
{
if (!$conversations) {
return false;
}
$collection = (object) null;
if ($conversations->user_one == $this->authUserId || $conversations->user_two == $this->authUserId) {
$withUser = $conversations->userone->id === $this->authUserId ? $conversations->usertwo : $conversations->userone;
$collection->withUser = $withUser;
$collection->messages = $conversations->messages;
return $collection;
}
return false;
}