// WebSocket connection for new statuses
    const ws_theme = window.location.protocol === "https:" ? "wss" : "ws";
    const newStatusesSocketUrl = `${ws_theme}://${window.location.host}/ws/new-statuses/`;
    const newStatusesSocket = new WebSocket(newStatusesSocketUrl);

    newStatusesSocket.onopen = () => {
        console.log('WebSocket connection to new statuses established');
    };
    newStatusesSocket.onmessage = function(e) {
        const data = JSON.parse(e.data);
        if (data.event_type === 'new_status') {
            const activityDiv = document.getElementById('activitiesContainer');
            activityDiv.insertAdjacentHTML('afterbegin', data.html);
            const audio = new Audio('/static/notifications/new-status.mp3');
            audio.play().catch(error => {
                console.log('Error playing notification sound:', error);
            });
        }
    };

    newStatusesSocket.onclose = () => {
        console.log('WebSocket connection to new statuses closed');
    };

    newStatusesSocket.onerror = (error) => {
        console.log('WebSocket error:', error);
    };



