docs: function onMessage(userId, msg) {
    // check if it's a message for current dialog
    if (isMessageForCurrentDialog(userId, msg.dialog_id)){
      console.log("Message for this dialog");
  
      dialogsMessages.push(msg);
  
      // read message if current dialog is on screen
      if (msg.markable === 1 && userId != currentUser.id) {
        sendReadStatus(userId, msg.id, msg.dialog_id);
      }
  
      // сheck if it's an attachment
      //
      var messageAttachmentFileId = null;
      if (msg.extension.hasOwnProperty("attachments")) {
        if(msg.extension.attachments.length > 0) {
          messageAttachmentFileId = msg.extension.attachments[0].id;
        }
      }
  
      showMessage(userId, msg, messageAttachmentFileId);
    }
    // Here we process the regular messages
    //
    updateDialogsList(msg.dialog_id, msg.body);
  }