Commits

wifiman  committed 44d9282

Moved QUIT loop to a generic clearNickWatches function.

  • Participants
  • Parent commits ac9d3bd

Comments (0)

Files changed (1)

File desktopbot.js

 			watchedServers[addr].removeWatcher(channel, nick);
 }
 
+function clearNickWatches (nick) {
+	for (var channel in serverWatchers)
+		clearNickInChannelWatches(channel, nick);
+}
+
 commands = {
 	q2: function (me, args, fromNick, fromMask, inChannel, reply) {
 		args = args.match(/^ *([+-])?([^ +-].*)?$/);
 			} while (0);  // restrict scope of message
 			break;
 		case 'QUIT':
-			// This sucks.
-			for (var channel in config.channels)
-				clearNickInChannelWatches(channel, fromNick);
+			clearNickWatches(fromNick);
 		}
 	}
 });