submit_msg_ajax = async (
  table_id,
  viewname,
  {
    participant_field,
    msg_relation,
    msgsender_field,
    msgview,
    msgform,
    participant_maxread_field,
  },
  body,
  { req, res },
  { submitAjaxQuery }
) => {
  const queryResult = await submitAjaxQuery(
    msg_relation,
    participant_field,
    body,
    msgform,
    msgsender_field,
    participant_maxread_field
  );
  if (!queryResult.json.error) {
    const msgid = queryResult.json.msgid;
    const v = await View.findOne({ name: msgview });
    const myhtml = await v.run({ id: msgid.success }, { req, res });
    const newreq = { ...req, user: { ...req.user, id: 0 } };
    const theirhtml = await v.run({ id: msgid.success }, { req: newreq, res });
    const tenant = db.getTenantSchema();
    getState().emitRoom(tenant, viewname, +body.room_id, {
      append: theirhtml,
      not_for_user_id: req.user.id,
      pls_ack_msg_id: msgid.success,
    });
    return {
      json: {
        success: "ok",
        append: myhtml,
      },
    };
  } else {
    return queryResult;
  }
}
@param {*} table_id
@param {string} viewname
@param {object} optsOne
@param {string} optsOne.participant_field
@param {string} optsOne.msg_relation
@param {*} optsOne.msgsender_field
@param {string} optsOne.msgview
@param {string} optsOne.msgform
@param {string} optsOne.participant_maxread_field
@param {*} body
@param {object} optsTwo
@param {object} optsTwo.req
@param {object} optsTwo.res
@returns {Promise<object>}