From b6be2adeddef7a8cbad0683a5a86350f3cf725d5 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sat, 5 Mar 2011 09:21:04 +0100 Subject: [PATCH] weercd.py: read PART command sent by client --- test/weercd.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/weercd.py b/test/weercd.py index a1abe5e9c..5cc5a363e 100755 --- a/test/weercd.py +++ b/test/weercd.py @@ -50,10 +50,10 @@ # Yeah, it's stable \o/ # -import sys, socket, select, time, random, string +import sys, socket, select, time, random, string, re NAME = 'weercd' -VERSION = '0.2' +VERSION = '0.3' options = { 'host' : ['', 'Host for socket bind'], @@ -164,6 +164,12 @@ class Client: self.send('PONG :%s' % args) elif data.startswith('NICK '): self.nick = data[5:] + elif data.startswith('PART '): + m = re.search('^PART :?(#[^ ]+)', data) + if m: + channel = m.group(1) + if channel in self.channels: + del self.channels[channel] elif data.startswith('QUIT '): self.quit = True self.incount += 1