<% if (MM.util.wsAvailable('local_mobile_core_message_search_contacts')) { %>
<% } %>
<% var types = ["online", "offline", "blocked", "strangers"]; %> <% var displayed = []; %> <% types.forEach(function(type) { %>
<% if (type == "online") { %> <%= MM.lang.s("onlinecontacts", "core", contacts[type].length) %> <% } else if (type == "offline") { %> <%= MM.lang.s("offlinecontacts", "core", contacts[type].length) %> <% } else if (type == "blocked") { %> <%= MM.lang.s("blockedusers", "core", contacts[type].length) %> <% } else { %> <%= MM.lang.s("others") %> <% } %>
<% _.each(contacts[type], function(contact) { %> <% contact.id = parseInt(contact.id) %> <% var user = MM.plugins.messages.recentContactsIds[contact.id]; %> <% if (displayed.indexOf(contact.id) > -1) return; %> <% if (parseInt(contact.id, 10) == parseInt(MM.config.current_site.userid, 10)) return; %> <% displayed.push(contact.id) %>
<% if (user && user.profileimageurl) { %>
<% } else if (contact.profileimageurl) { %>
<% } else { %>
<% } %>
<%= contact.fullname %>
<% }); %>
<% }); %>