diff options
author | yvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd> | 2009-11-16 21:21:53 +0000 |
---|---|---|
committer | yvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd> | 2009-11-16 21:21:53 +0000 |
commit | 6153ba1277632d74105170c182594d3833636fa7 (patch) | |
tree | b7f01eac05247b59a59be91e121d3afe9c403b9e /icq_roombot.py | |
parent | d47b17d4883773fd1f91d7d87420ec751875279a (diff) | |
download | omegle-6153ba1277632d74105170c182594d3833636fa7.tar.gz omegle-6153ba1277632d74105170c182594d3833636fa7.zip |
fix
git-svn-id: http://xapek.org/svn/common/omegle@1454 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd
Diffstat (limited to 'icq_roombot.py')
-rw-r--r-- | icq_roombot.py | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/icq_roombot.py b/icq_roombot.py index 1cba8f9..7dc3da9 100644 --- a/icq_roombot.py +++ b/icq_roombot.py @@ -1,10 +1,11 @@ #!/usr/bin/python -import struct,sys +import sys +import struct +from random import randint from twisted.python import log from twisted.words.protocols import oscar from twisted.internet import reactor, protocol -from random import randint uin = '370496181' password = 'megahal123' @@ -93,6 +94,7 @@ class icqBot( oscar.BOSConnection ): def sendMessage(self, user, messageUtf8): message = messageUtf8.encode('latin1','replace') oscar.BOSConnection.sendMessage(self,user,message) + def receiveMessage( self, user, multiparts, flags ): try: try: @@ -146,7 +148,6 @@ class icqBot( oscar.BOSConnection ): for otherMember in self.room.members: i += 1 reactor.callLater(i, self.sendMessage, otherMember.id, "===== %s/%s joined" % (member.name,member.id)) -# self.sendMessage(otherMember.id, "===== %s/%s joined" % (member.name,member.id)) else: if randint(0,5) == 3: self.sendMessage(user.name, "Use '/join Nickname' or ' /join Nickname'") @@ -157,11 +158,6 @@ class icqBot( oscar.BOSConnection ): def chatReceiveMessage( self, chat, user, message ): self.receiveMessage( self, user, message, 0 ) - """ - def receiveSendFileRequest(self, *args): -# def receiveSendFileRequest(self, user, file, description, cookie): - print args - """ def sendAuthorizationResponse(self, uin, success, responsString): packet = struct.pack("b", len(uin)) + uin @@ -199,9 +195,6 @@ class ReconnectingOSCARFactory(protocol.ClientFactory): class OscarCrap( oscar.OscarAuthenticator ): BOSClass = icqBot connectfactory = ReconnectingOSCARFactory - def connectToBOS(self, server, port): - f = self.connectfactory(self.username, self.cookie) - return reactor.connectTCP(server, int(port), f) class ReconnectingOSCARLoginFactory(protocol.ReconnectingClientFactory): protocol = OscarCrap @@ -212,7 +205,7 @@ class ReconnectingOSCARLoginFactory(protocol.ReconnectingClientFactory): p = self.protocol(self.sn, self.pass_, icq=1) p.factory = self return p - ## only reconnect on *failures* + """only reconnect on *failure*""" def clientConnectionLost(self, con, reason): pass |