src/main/ChatController.js
/**
 * Loads and shows messages of a chat in main panel
 */
Loads and shows messages of a chat in main panel
Loads and shows messages of a chat in main panel
async function loadMessages(id) {
    $(".chat").html("");
    $("#write-chat").prop("disabled", false);
    $("#nm" + id).remove();
    currentChat = semanticChats[id];
    userDataUrl = currentChat.url;
    var friendPhoto = currentChat.photo;
    if (!friendPhoto) {
        friendPhoto = baseService.getDefaultFriendPhoto();
    }
    $("#interlocutorphoto").attr("src", friendPhoto);
    interlocWebId = currentChat.interlocutorWebId;
    $("#interlocutorw-name").html("");
    $("#interlocutorw-name").append(currentChat.interlocutorName.replace(/U\+0020/g, " "));
    currentChat.getMessages().forEach(async (message) => {
        showMessage(message);
    });
    toScrollDown();
}
async function loadMessages ( id ) { $ ( ".chat" ) . html ( "" ) ; $ ( "#write-chat" ) . prop ( "disabled" , false ) ; $ ( "#nm" + id ) . remove ( ) ; currentChat = semanticChats [ id ] ; userDataUrl = currentChat . url ; var friendPhoto = currentChat . photo ; if ( ! friendPhoto ) { friendPhoto = baseService . getDefaultFriendPhoto ( ) ; } $ ( "#interlocutorphoto" ) . attr ( "src" , friendPhoto ) ; interlocWebId = currentChat . interlocutorWebId ; $ ( "#interlocutorw-name" ) . html ( "" ) ; $ ( "#interlocutorw-name" ) . append ( currentChat . interlocutorName . replace ( / U\+0020 / g , " " ) ) ; currentChat . getMessages ( ) . forEach ( async ( message ) => { showMessage ( message ) ; } ) ; toScrollDown ( ) ; }
Loads and shows messages of a chat in main panel
Loads and shows messages of a chat in main panel