]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Add a maximum amount of subscriptions per channel.
authorChris Porter <redacted>
Fri, 11 Jul 2008 00:19:41 +0000 (01:19 +0100)
committerChris Porter <redacted>
Fri, 11 Jul 2008 00:19:41 +0000 (01:19 +0100)
config.py.example
qwebirc/ajaxengine.py

index 8532cc17eec4c26bb0bba549ddabf56e6834ae42..b1e1bd792de55dda68f9d1bbbcd07c69f0c8ee21 100644 (file)
@@ -3,3 +3,4 @@ HMACKEY = "mrmoo"
 HMACTEMPORAL = 30
 UPDATE_FREQ = 0.5
 MAXBUFSIZE = 10000
+MAXSUBSCRIPTIONS = 3
index 4f91466d5a5dbec599b301b89ff1cf4a13ed229a..4c5114603c4ca798de54b5fefbc6759274fcc33d 100644 (file)
@@ -37,6 +37,9 @@ class IRCSession:
     self.cleanupschedule = None
 
   def subscribe(self, channel):
+    if len(self.subscriptions) >= config.MAXSUBSCRIPTIONS:
+      self.subscriptions.pop(0)
+
     self.subscriptions.append(channel)
     self.flush()