Ejemplo n.º 1
0
 def nickservIdentify(self):
     if not self.identified:
         self.serverLogArea.appendPlainText("[Identify as : %s]" %
                                            (self.client.login))
         self.connection.privmsg(
             'NickServ', 'identify %s %s' %
             (self.client.login, util.md5text(self.client.password)))
Ejemplo n.º 2
0
 def nickservRegister(self):
     if hasattr(self, '_nickserv_registered'):
         return
     self.connection.privmsg('NickServ', 'register %s %s' % (util.md5text(self.client.password), '{}@users.faforever.com'.format(self.client.me.login)))
     self._nickserv_registered = True
     self.autoJoin(self.optionalChannels)
     self.autoJoin(self.crucialChannels)
Ejemplo n.º 3
0
 def nickservRegister(self):
     if hasattr(self, '_nickserv_registered'):
         return
     self.connection.privmsg(
         'NickServ', 'register %s %s' %
         (util.md5text(self.client.password),
          '{}@users.faforever.com'.format(self.client.me.login)))
     self._nickserv_registered = True
     self.autoJoin(self.optionalChannels)
     self.autoJoin(self.crucialChannels)
Ejemplo n.º 4
0
 def on_identified(self):
     if self.connection.get_nickname() != self.client.login:
         self.serverLogArea.appendPlainText(
             "[Retrieving our nickname : %s]" % (self.client.login))
         self.connection.privmsg(
             'NickServ', 'recover %s %s' %
             (self.client.login, util.md5text(self.client.password)))
     #Perform any pending autojoins (client may have emitted autoJoin signals before we talked to the IRC server)
     self.autoJoin(self.optionalChannels)
     self.autoJoin(self.crucialChannels)
Ejemplo n.º 5
0
    def on_privnotice(self, c, e):
        source = user2name(e.source())
        notice = e.arguments()[0]
        prefix = notice.split(" ")[0]
        target = prefix.strip("[]")

        if source and source.lower() == 'nickserv':

            if e.arguments()[0].find("registered under your account") >= 0:
                if self.identified == False:
                    self.identified = True
                    self.on_authentified()

            elif e.arguments()[0].find("isn't registered") >= 0:

                self.nickservRegister()

            elif e.arguments()[0].find("Password accepted"):
                if self.identified == False:
                    self.identified = True
                    self.on_authentified()

            elif e.arguments()[0].find("RELEASE") >= 0:
                self.connection.privmsg(
                    'nickserv', 'release %s %s' %
                    (self.client.login, util.md5text(self.client.password)))

            elif e.arguments()[0].find("hold on") >= 0:
                self.connection.nick(self.client.login)
        elif source and source.lower() == 'botserv':
            print "botserv", notice

        message = "\n".join(e.arguments()).lstrip(prefix)
        if target in self.channels:
            self.channels[target].printMsg(source, message)
        elif source == "Global":
            for channel in self.channels:
                self.channels[channel].printAnnouncement(
                    message, "yellow", "+2")
        elif source == "AeonCommander":
            for channel in self.channels:
                self.channels[channel].printMsg(source, message)
        else:
            self.serverLogArea.appendPlainText("%s: %s" % (source, notice))
Ejemplo n.º 6
0
    def on_privnotice(self, c, e):
        source = user2name(e.source())
        notice = e.arguments()[0]
        prefix = notice.split(" ")[0]
        target = prefix.strip("[]")

        if source and source.lower() == 'nickserv':

            if e.arguments()[0].find("registered under your account") >= 0:
                if self.identified == False :
                    self.identified = True
                    self.on_authentified()

            elif e.arguments()[0].find("isn't registered") >= 0:

                self.nickservRegister()

            elif e.arguments()[0].find("Password accepted") :
                if self.identified == False :
                    self.identified = True
                    self.on_authentified()

            elif e.arguments()[0].find("RELEASE") >= 0:
                self.connection.privmsg('nickserv', 'release %s %s' % (self.client.login, util.md5text(self.client.password)))

            elif e.arguments()[0].find("hold on") >= 0:
                self.connection.nick(self.client.login)
        elif source and source.lower() == 'botserv':
            print "botserv", notice


        message = "\n".join(e.arguments()).lstrip(prefix)
        if target in self.channels:
            self.channels[target].printMsg(source, message)
        elif source == "Global":
            for channel in self.channels:
                self.channels[channel].printAnnouncement(message, "yellow", "+2")
        elif source == "AeonCommander":
            for channel in self.channels:
                self.channels[channel].printMsg(source, message)
        else:
            self.serverLogArea.appendPlainText("%s: %s" % (source, notice))
Ejemplo n.º 7
0
 def nickservRegister(self):
     self.connection.privmsg('NickServ', 'register %s %s' % (util.md5text(self.client.password), self.client.email))
Ejemplo n.º 8
0
 def on_authentified(self):
     if self.connection.get_nickname() != self.client.login :
         self.serverLogArea.appendPlainText("[Retrieving our nickname : %s]" % (self.client.login))
         self.connection.privmsg('nickserv', 'recover %s %s' % (self.client.login, util.md5text(self.client.password)))
     #Perform any pending autojoins (client may have emitted autoJoin signals before we talked to the IRC server)
     self.autoJoin(self.optionalChannels)
     self.autoJoin(self.crucialChannels)
Ejemplo n.º 9
0
 def nickservIdentify(self):
     if self.identified == False :
         self.serverLogArea.appendPlainText("[Identify as : %s]" % (self.client.login))
         self.connection.privmsg('NickServ', 'identify %s %s' % (self.client.login, util.md5text(self.client.password)))
Ejemplo n.º 10
0
    def on_privnotice(self, c, e):
        source = user2name(e.source())
        notice = e.arguments()[0]
        prefix = notice.split(" ")[0]
        target = prefix.strip("[]")

        # It is surprising that SimpleIRCClient doesn't handle this for us.
        # I suspect, in reality, it probably can do...
        if source and source.lower() == 'nickserv':
            if notice.find("registered under your account") or \
               notice.find("Password accepted"):
                if not self.identified :
                    self.identified = True
                    self.on_identified()

            elif notice.find("isn't registered") >= 0:
                self.nickservRegister()

            elif notice.find("RELEASE") >= 0:
                self.connection.privmsg('nickserv', 'release %s %s' % (self.client.login, util.md5text(self.client.password)))

            elif notice.find("hold on") >= 0:
                self.connection.nick(self.client.login)

        message = "\n".join(e.arguments()).lstrip(prefix)
        if target in self.channels:
            self.channels[target].printMsg(source, message)
        elif source == "Global":
            for channel in self.channels:
                self.channels[channel].printAnnouncement(message, "yellow", "+2")
        elif source == "AeonCommander":
            for channel in self.channels:
                self.channels[channel].printMsg(source, message)
        else:
            self.serverLogArea.appendPlainText("%s: %s" % (source, notice))
Ejemplo n.º 11
0
 def nickservRegister(self):
     self.connection.privmsg(
         'NickServ', 'register %s %s' %
         (util.md5text(self.client.password), self.client.email))