src/main/ChatController.js
/**
 * Displays available invitations at left panel. 
 */
Displays available invitations at left panel.
Displays available invitations at left panel .
async function showInvitations() {
    $(".contact-list").html("");
    chatsToJoin.forEach(async chat => {
        var friendPhoto = chat.photo;
        if (!friendPhoto) {
            friendPhoto = await baseService.getPhoto(chat.interlocutorWebId);
            if (!friendPhoto)
                friendPhoto = baseService.getDefaultFriendPhoto();
        }
        var html = $("<div style='cursor: pointer;' class='contact new-message-contact' id='join" + chat.url + "'><img src='" + friendPhoto + "' alt='!' onerror='this.onerror=null;this.src='http://www.philosophica.info/voces/aquino/Aquino.jpg';'><div class='contact-preview'><div class='contact-text'><h1 class='font-name'>" + chat.interlocutorName + "</h1><p class='font-preview'>Wants to chat with you</p></div></div><div class='contact-time'><p>" + "</p><div class='new-message' id='nm" + "'><p>" + "1" + "</p></div></div></div>");
        $(".contact-list").prepend(html);
        document.getElementById("join" + chat.url).addEventListener("click", joinChat, false);
    });
}
async function showInvitations ( ) { $ ( ".contact-list" ) . html ( "" ) ; chatsToJoin . forEach ( async chat => { var friendPhoto = chat . photo ; if ( ! friendPhoto ) { friendPhoto = await baseService . getPhoto ( chat . interlocutorWebId ) ; if ( ! friendPhoto ) friendPhoto = baseService . getDefaultFriendPhoto ( ) ; } var html = $ ( "<div style='cursor: pointer;' class='contact new-message-contact' id='join" + chat . url + "'><img src='" + friendPhoto + "' alt='!' onerror='this.onerror=null;this.src='http://www.philosophica.info/voces/aquino/Aquino.jpg';'><div class='contact-preview'><div class='contact-text'><h1 class='font-name'>" + chat . interlocutorName + "</h1><p class='font-preview'>Wants to chat with you</p></div></div><div class='contact-time'><p>" + "</p><div class='new-message' id='nm" + "'><p>" + "1" + "</p></div></div></div>" ) ; $ ( ".contact-list" ) . prepend ( html ) ; document . getElementById ( "join" + chat . url ) . addEventListener ( "click" , joinChat , false ) ; } ) ; }
Displays available invitations at left panel.
Displays available invitations at left panel .