{$_contact = [ 'id' => null, 'name' => '[`Deleted contact`]' ]} {if !empty($contacts[$conversation.contact_id])} {$_contact = $contacts[$conversation.contact_id]} {/if} {$_sender = $contacts[$wa->userId()]} {$page = waRequest::get('pt', null, waRequest::TYPE_INT)} {if $page && $page != 1}{$_page = "?page=`$page`"}{else}{$_page = ''}{/if} {function name="_renderFromContact" _contact=[]} {if isset($_contact.id)} {$_contact.name|escape} {if isset($_m.from_formatted)} {$_m.from_formatted} {elseif !empty($_m.from)} <{$_m.from|escape}> {/if} {else} {* TODO: if not $contact.id how we displaying $contact.name? :o *} {$_contact.name|escape} {if !empty($_m.from)} <{$_m.from|escape}> {/if} {/if} {/function} {function name="_renderRecipient" _contact=[]} {if !empty($_contact.name)} {if !empty($_contact.contact_id)} {if !empty($_contact.photo)}{/if} {$_contact.name|escape} {else} {$_contact.name|escape} {/if} {/if} {if !empty($_contact.destination)} <{$_contact.destination|escape}> {elseif !empty($_contact.email)} <{$_contact.email|escape}> {/if} {/function} {function _renderMessageBody message=[]} {strip} {if !empty($message.body_formatted)} {$body_formatted = $message.body_formatted} {elseif !empty($message.body_sanitized)} {$body_formatted = $message.body_sanitized} {else} {$body_formatted = $message.body|escape|nl2br} {/if}