{if $system['redirect_to_mobile_apps']}
  <li class="d-block d-md-none">
    <a href="#" onclick="open_messenger_app()">
      {include file='__svg_icons.tpl' icon="header-messages" class="header-icon" width="24px" height="24px"}
      <span class="counter red shadow-sm rounded-pill {if $user->_data['user_live_messages_counter'] == 0}x-hidden{/if}">
        {$user->_data['user_live_messages_counter']}
      </span>
    </a>
  </li>
{/if}
<li class="dropdown js_live-messages {if $system['redirect_to_mobile_apps']}d-none d-md-block{/if}">
  <a href="#" data-bs-toggle="dropdown" data-display="static">
    {include file='__svg_icons.tpl' icon="header-messages" class="header-icon" width="24px" height="24px"}
    <span class="counter red shadow-sm rounded-pill {if $user->_data['user_live_messages_counter'] == 0}x-hidden{/if}">
      {$user->_data['user_live_messages_counter']}
    </span>
  </a>
  <div class="dropdown-menu dropdown-menu-end dropdown-widget">
    <div class="dropdown-widget-header">
      <span class="title">{__("Messages")}</span>
      <a class="float-end text-link js_chat-new" href="{$system['system_url']}/messages/new">{__("Send a New Message")}</a>
    </div>
    <div class="dropdown-widget-body">
      <div class="js_scroller">
        {if $user->_data['conversations']}
          <ul>
            {foreach $user->_data['conversations'] as $conversation}
              {include file='__feeds_conversation.tpl'}
            {/foreach}
          </ul>
        {else}
          <p class="text-center text-muted mt10">
            {__("No messages")}
          </p>
        {/if}
      </div>
    </div>
    <a class="dropdown-widget-footer" href="{$system['system_url']}/messages">{__("See All")}</a>
  </div>
</li>