Moved join-on-invite to botcmd.py, unbroke the API

This commit is contained in:
Juhani Haverinen 2015-01-24 14:27:04 +02:00
parent 64c7f8165b
commit ddc026907a
3 changed files with 4 additions and 6 deletions

2
README
View File

@ -2,4 +2,4 @@ Not that ugly IRC bot. In fact, ircbot.py is quite nice.
Contributions
-------------
* FireFly: Join back to auto-join channels on /invite
* FireFly: Join back to auto-join channels on /invite (original)

View File

@ -236,6 +236,9 @@ def parse((line,irc)):
irc.msg(line[3][1:], 'WTF, NickServ returned %s'+line[5])
authcmdlock.release()
authfunclock.release()
elif line[1]=='INVITE' and line[2]==irc.nick and line[3][1:] in irc.chan.split(' '):
addauthcmd(nick, 'JOIN '+line[3])
irc.msg('NickServ', 'ACC '+nick)
elif line[1]=='482':
irc.msg(line[3], 'Not op')
#elif line[1]=='332' or line[1]=='TOPIC':

View File

@ -59,13 +59,8 @@ class Connhandler(threading.Thread):
self.logc.send(s+'\n')
def check(self,line):
args=line.split(' ')
nick=args[0].split('!')[0][1:]
chan=args[2] if len(args) >= 3 and args[2][0]=='#' else nick
if args[0]=='PING':
self.send('PONG :hjdicks')
elif args[1]=='INVITE' and args[2]==self.nick and args[3][1:] in self.chan.split(' '):
botcmd.addauthcmd(nick, 'JOIN '+args[3])
self.send('PRIVMSG NickServ :ACC '+nick)
else:
self.logc.send(line+'\n')
Threadwrapper(botcmd.parse,(line,Irc(self.chan, self.nick, self.inpc))).start()