src/lib/notification-list.js
function (username, channel) {
        var userChannels = this.getUserNotifications(username);

        // dont remove if they dont exist
        if (userChannels === null) {
            return false;
        }

        var index = userChannels.indexOf(channel);

        // dont remove if the channel doesnt exist
        if (index < 0) {
            return false;
        }

        // remove the channel
        userChannels.splice(index, 1);

        //if no channels left remove the entire user
        if (userChannels.length === 0) {
            var userIndex = -1;
            this.notifications.some(function (element, index) {
                if (element.username === username) {
                    userIndex = index;
                    return true;
                }
                return false;
            });
            this.notifications.splice(userIndex, 1);
            this.latestVideos.removeUser(username);
        }

        // save the new data
        this.saveNotifications();
        return true;
    }
function (username, channel) {
        var userChannels = this.getUserNotifications(username);

        // dont remove if they dont exist
        if (userChannels === null) {
            return false;
        }

        var index = userChannels.indexOf(channel);

        // dont remove if the channel doesnt exist
        if (index < 0) {
            return false;
        }

        // remove the channel
        userChannels.splice(index, 1);

        //if no channels left remove the entire user
        if (userChannels.length === 0) {
            var userIndex = -1;
            this.notifications.some(function (element, index) {
                if (element.username === username) {
                    userIndex = index;
                    return true;
                }
                return false;
            });
            this.notifications.splice(userIndex, 1);
            this.latestVideos.removeUser(username);
        }

        // save the new data
        this.saveNotifications();
        return true;
    }
function ( username , channel ) { var userChannels = this . getUserNotifications ( username ) ; // dont remove if they dont exist if ( userChannels === null ) { return false ; } var index = userChannels . indexOf ( channel ) ; // dont remove if the channel doesnt exist if ( index < 0 ) { return false ; } // remove the channel userChannels . splice ( index , 1 ) ; //if no channels left remove the entire user if ( userChannels . length === 0 ) { var userIndex = - 1 ; this . notifications . some ( function ( element , index ) { if ( element . username === username ) { userIndex = index ; return true ; } return false ; } ) ; this . notifications . splice ( userIndex , 1 ) ; this . latestVideos . removeUser ( username ) ; } // save the new data this . saveNotifications ( ) ; return true ; }
Removes the given username from the list of names for notifications

@param {string} username - The account name to check for
@param {string} channel - The channel to send notifications to
@returns {boolean} true if removed, false if didn't exist
Removes the given username from the list of names for notifications