Remove category when emptied by ~rm.

This commit is contained in:
Psychedelic Squid 2012-03-10 17:48:49 +00:00
parent c852a4ada8
commit a0158ceac4

View File

@ -112,6 +112,9 @@ var quotes = function(dbot) {
var index = quotes[q[1]].indexOf(q[2]); var index = quotes[q[1]].indexOf(q[2]);
if(index != -1) { if(index != -1) {
quotes[q[1]].splice(index, 1); quotes[q[1]].splice(index, 1);
if(quotes[q[1]].length === 0) {
delete quotes[q[1]];
}
rmAllowed = false; rmAllowed = false;
dbot.say(data.channel, '\'' + q[2] + '\' removed from ' + q[1]); dbot.say(data.channel, '\'' + q[2] + '\' removed from ' + q[1]);
} else { } else {