docs: function onMessage(userId, msg) {
      var dialogId = msg.dialog_id,
          isForCurrentDialog = isMessageForCurrentDialog(userId, dialogId);
  
      updateCallState({
          dialogId: dialogId,
          userId: userId,
          active: isForCurrentDialog,
          type: msg.extension.notification_type
      });
  
      if (!msg.body) return true;
  
      // check if it's a message for current dialog
      if (isMessageForCurrentDialog(userId, dialogId)) {
          dialogsMessages.push(msg);
  
          if (msg.markable === 1 && userId != currentUser.id) {
              sendReadStatus(userId, msg.id, dialogId);
          }
  
          // с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(dialogId, msg.body);
  
      if (userId != currentUser.id) {
          playSoundOnNewMessage();
      }
  }