Created
February 16, 2013 23:06
-
-
Save photofroggy/4969121 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
settings.bds = { | |
// Main DSP channel. | |
mns: 'chat:datashare', | |
ns: [], | |
// Check if we should be processing messages from a given channel. | |
channel: function( ns ) { | |
if( !ns ) | |
return false; | |
ns = client.format_ns(ns).toLowerCase(); | |
return settings.bds.ns.indexOf( ns ) > -1; | |
}, | |
// Add a channel | |
add: function( ns ) { | |
if( !ns ) | |
return false; | |
ns = client.format_ns(ns).toLowerCase(); | |
if( settings.bds.ns.indexOf( ns ) > -1 ) | |
return true; | |
settings.bds.ns.push( ns ); | |
return true; | |
}, | |
// Remove a channel | |
remove: function( ns ) { | |
if( !ns ) | |
return false; | |
ns = client.format_ns(ns).toLowerCase(); | |
if( settings.bds.ns.indexOf( ns ) == -1 ) | |
return true; | |
settings.bds.ns.splice( settings.bds.ns.indexOf( ns ), 1 ); | |
return true; | |
}, | |
// Because it's fun spamming #ds | |
'provides': [ | |
'BOTCHECK', | |
'CLINK' | |
] | |
}; | |
// Allow other parts of client to use the channel listing. | |
client.bds = settings.bds; | |
settings.bds.add(settings.bds.mns); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment