/** @odoo-module **/

import {registerPatch} from "@mail/model/model_core";

registerPatch({
    name: "MessageActionView",
    fields: {
        classNames: {
            compute() {
                let classNames = this._super() || "";
                if (
                    this.messageAction.messageActionListOwner ===
                    this.messageAction.replyMessageAction
                ) {
                    // Replace the fa-reply icon added by mail_quoted_reply with fa-envelope
                    classNames = classNames.replace("fa-reply", "fa-envelope");
                }
                return classNames;
            },
        },
        title: {
            compute() {
                if (
                    this.messageAction.messageActionListOwner ===
                    this.messageAction.replyMessageAction
                ) {
                    return this.env._t("Reply by Email");
                }
                return this._super();
            },
        },
    },
});
