summaryrefslogtreecommitdiff
path: root/injector.py
diff options
context:
space:
mode:
Diffstat (limited to 'injector.py')
-rw-r--r--injector.py42
1 files changed, 41 insertions, 1 deletions
diff --git a/injector.py b/injector.py
index 0934b1b..6383804 100644
--- a/injector.py
+++ b/injector.py
@@ -117,6 +117,46 @@ class InjectorWindow(object):
def on_column2_disconnect(self,*args):
self.add_message("DEBUG: on_column2_disconnect")
+
+from omegle import OmegleChat
+class Chat(OmegleChat):
+ def __init__(self,injector):
+ OmegleChat.__init__(self)
+ self.injector = injector
+ self.name = name
+ def on_message(self,msg):
+ #XXX handle linking
+ injector.add_message("%s %s : %s" % (1, self.name, msg)
+
class Injector(InjectorWindow):
- pass
+ def __init__(self):
+ InjectorWindow.__init__(self)
+ self.omegle1 = Chat(self,"A")
+ self.omegle2 = Chat(self,"B")
+ def on_column1_send(self,message):
+ if self.omegle1.is_confirmed:
+ self.omegle1.send(message)
+ else:
+ self.add_message("Column 1 not connected")
+ def on_column2_send(self,message):
+ if self.omegle1.is_confirmed:
+ self.omegle2.send(message)
+ else:
+ self.add_message("Column 2 not connected")
+ def on_column1_disconnect(self,*args):
+ if self.omegle1.is_connected:
+ self.omegle1.disconnect()
+ self.add_message("Column1 disconnected")
+ else:
+ self.comegle1.start()
+ self.add_message("Connect Column1")
+ def on_column2_disconnect(self,*args):
+ if self.omegle2.is_connected:
+ self.omegle2.disconnect()
+ self.add_message("Column2 disconnected")
+ else:
+ self.comegle2.start()
+ self.add_message("Connect Column2")
+
+
Injector().main()