import IMOperator from "./im-operator";
import MsgTypeManager from "./msg-type/base/msg-type-manager";

export default class MsgManager extends MsgTypeManager {
    constructor(page) {
        super(page);
    }

    showMsg({msg}) {
        this.getMsgManager({type: msg.msgType}).showMsg({msg});
    }

    sendMsg({msgType = IMOperator.TextType, content, duration}) {
        this.getMsgManager({type: msgType}).sendOneMsg(arguments[0]);
    }

    resend({msgType, content, duration, itemIndex}) {
        this.getMsgManager({type: msgType}).resend(arguments[0]);
    }

    stopAllVoice() {
        this.voiceManager.stopAllVoicePlay(true);
    }
}
