summaryrefslogtreecommitdiff
path: root/mibbit.py
diff options
context:
space:
mode:
Diffstat (limited to 'mibbit.py')
-rw-r--r--mibbit.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/mibbit.py b/mibbit.py
new file mode 100644
index 0000000..73a929d
--- /dev/null
+++ b/mibbit.py
@@ -0,0 +1,31 @@
+#!/usr/bin/python
+import re
+
+class Mibbit(object):
+ def onRecv(self, IRC, line, data):
+ if data==None: return
+ (origin, ident, host, cmd, target, params, extinfo)=data
+ if len(target) and target[0]!="#":
+ #print target
+ #print cmd
+ #print extinfo
+ target=IRC.user(target)
+ if cmd=="NOTICE" and target==IRC.identity:
+ matches=re.findall("^\\*\\*\\* CONNECT: Client connecting on port ([0-9]+) \\(class (.*?)\\): (.+)!([0-9a-f]{8})@(.+\\.mibbit\\.com) \\((.+)\\) \\[(.+)\\]$",extinfo)
+ #print matches
+ "*** REMOTECONNECT: Client connecting at hypocrisy.insomniairc.net: B!463df443@ircip4.mibbit.com (109.169.29.95) [rrcs-70-61-244-67.central.biz.rr.com]"
+ if matches:
+ (port, cls, nick, hexip, mibbithost, mibbitip, host)=matches[0]
+ IRC.raw("CHGHOST %s %s"%(nick, host))
+ IRC.raw("CHGIDENT %s %s"%(nick, "mibbit"))
+ IRC.raw("CHGNAME %s %s"%(nick, "Mibbit User"))
+ return
+ matches=re.findall("^\\*\\*\\* REMOTECONNECT: Client connecting at (.+?): (.+)!([0-9a-f]{8})@(.+\\.mibbit\\.com) \\((.+)\\) \\[(.+)\\]$",extinfo)
+ #print matches
+ "*** REMOTECONNECT: Client connecting at hypocrisy.insomniairc.net: B!463df443@ircip4.mibbit.com (109.169.29.95) [rrcs-70-61-244-67.central.biz.rr.com]"
+ if matches:
+ (remotehost, nick, hexip, mibbithost, mibbitip, host)=matches[0]
+ IRC.raw("CHGHOST %s %s"%(nick, host))
+ IRC.raw("CHGIDENT %s %s"%(nick, "mibbit"))
+ IRC.raw("CHGNAME %s %s"%(nick, "Mibbit User"))
+ return