const syncDisabled = function ({room, wt, roomSession, emitter} = {}) {
    

    const handleAddLocalParticipant = () => {
        removeMaster();
    };

    const handleAddRemoteParticipant = () => {
        removeMaster();
    };
    
    const handleRemoveRemoteParticipant = () => {
        removeMaster();
    };

    const removeMaster = () => {
        return room.sendMessage(room.handleId, {
            body:{
                request: "sync_paused",
                room: room.roomId,
                timestamp: new Date().getTime(),
                fragment:'0',
                fragment_pos:0
            }});
    };

    

    return {

        __events: [],

        initialize: ({} = {}) => {
            room.on('addLocalParticipant', handleAddLocalParticipant);
            room.on('addRemoteParticipant', handleAddRemoteParticipant);
            room.on('removeRemoteParticipant', handleRemoveRemoteParticipant);
        },

        destroy: () => {
            room.off('addLocalParticipant', handleAddLocalParticipant);
            room.off('addRemoteParticipant', handleAddRemoteParticipant);
            room.off('removeRemoteParticipant', handleRemoveRemoteParticipant);
        }
    };

};

export default syncDisabled;
