1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 09:43:13 +02:00

weercd.py: read PART command sent by client

This commit is contained in:
Sebastien Helleu
2011-03-05 09:21:04 +01:00
parent 598b5262a6
commit b6be2adedd
+8 -2
View File
@@ -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