Skip to content

Commit

Permalink
Fix incorrect channel join/part handling
Browse files Browse the repository at this point in the history
I have no idea how I never noticed this before, but somehow...
  • Loading branch information
RenolY2 committed Apr 26, 2015
1 parent 16bd768 commit bf1fb3e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
10 changes: 8 additions & 2 deletions IRCpackets/channel_JOIN.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ def execute(self, sendMsg, prefix, command, params):
name = part1[0]
ident = part2[0]
host = part2[2]

channel = self.retrieveTrueCase(params)

if not params.startswith(":"):
param_list = params.split(" ")
chan = param_list[0]
else:
chan = params.lstrip(":")

channel = self.retrieveTrueCase(chan)

if self.Bot_Auth.doesExist(name) and not self.Bot_Auth.isRegistered(name):
self.whoisUser(name)
Expand Down
20 changes: 13 additions & 7 deletions IRCpackets/channel_PART.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,22 @@ def execute(self, sendMsg, prefix, command, params):
host = part2[2]

print "CHANNEL LEAVE"

chan = self.retrieveTrueCase(params)

if params.startswith(":"):
chan_string = params.lstrip(":")
else:
param_list = params.split(" ")
chan_string = param_list[0]

channel = self.retrieveTrueCase(chan_string)

self.events["channelpart"].tryAllEvents(self, name, ident, host, chan)
self.events["channelpart"].tryAllEvents(self, name, ident, host, channel)

if chan != False:
for i in range(len(self.channelData[chan]["Userlist"])):
user, pref = self.channelData[chan]["Userlist"][i]
if channel != False:
for i in range(len(self.channelData[channel]["Userlist"])):
user, pref = self.channelData[channel]["Userlist"][i]
if user == name:
del self.channelData[chan]["Userlist"][i]
del self.channelData[channel]["Userlist"][i]
break
else:
self.__CMDHandler_log__.debug("Channel %s not found", params)
Expand Down

0 comments on commit bf1fb3e

Please sign in to comment.