Commits

Stephen Tanner  committed 23f106d

Minor regression fixes

  • Participants
  • Parent commits 8725b4e

Comments (0)

Files changed (3)

         return self.OWNER
 
     def addAdmin(self, nick):
-        self.curs.execute('INSERT INTO admin values (?)', [nick])
-        self.conn.commit()
+        if nick in self.getAdmins():
+            pass
+        else:
+            self.curs.execute('INSERT INTO admin values (?)', [nick])
+            self.conn.commit()
         #return self.ADMINS.append(admin)
 
     def delAdmin(self, nick):
-        self.curs.execute('DELETE FROM admin WHERE nick = ?', [nick])
-        self.conn.commit()
+        if nick in self.getAdmins():
+            self.curs.execute('DELETE FROM admin WHERE nick = ?', [nick])
+            self.conn.commit()
+        else:
+            pass
         #return self.ADMINS.remove(admin)
 
     def getPermLvl(self, message):

File src/Karma.py

             else:
                 pass
 
-        self.curs.execute('SELECT * FROM vote2 WHERE word = ?',
+            self.curs.execute('SELECT * FROM vote2 WHERE word = ?',
                           [message.message[1]])
-        if len(self.curs.fetchall()) == 1 :
-            karma = self.__totalWKarma(message.message[1])
-        else:
-            pass
+            if len(self.curs.fetchall()) == 1 :
+                karma = self.__totalWKarma(message.message[1])
+            else:
+                pass
 
-        if message.chan == self.SERVER.NICK:
-            message.chan = message.nick
+            if message.chan == self.SERVER.NICK:
+                message.chan = message.nick
 
-        if len(karma) == 4:
-            self.SERVER.sendPRIVMessage(message.chan + " :"
-                                        + message.message[1] +
-                                        " has a karma of: " + str(karma[0]) +
-                                        " (U:" + str(karma[1]) + " D:" +
-                                        str(karma[2]) + " V:" +
-                                        str(karma[3]) + ")")
-        elif len(karma) == 3:
-            self.SERVER.sendPRIVMessage(message.chan + " :" +
-                                        message.message[1] +
-                                        " has a karma of: " + str(karma[0]) +
-                                        " (U:" + str(karma[1]) + " D:" +
-                                        str(karma[2]) + ")")
-        else:
-            pass
+            if len(karma) == 4:
+                self.SERVER.sendPRIVMessage(message.chan + " :"
+                                            + message.message[1] +
+                                            " has a karma of: " + str(karma[0]) +
+                                            " (U:" + str(karma[1]) + " D:" +
+                                            str(karma[2]) + " V:" +
+                                            str(karma[3]) + ")")
+            elif len(karma) == 3:
+                self.SERVER.sendPRIVMessage(message.chan + " :" +
+                                            message.message[1] +
+                                            " has a karma of: " + str(karma[0]) +
+                                            " (U:" + str(karma[1]) + " D:" +
+                                            str(karma[2]) + ")")
+            else:
+                pass
 
     def __upVote(self, message):
         '''Increase the karma score for a word or user by one'''

File src/karma_kat.py

         self.admin = Admin(self.ACL, self.SERVER)
         self.karma = Karma(self.ACL, self.SERVER)
         self.url = URL(self.ACL, self.SERVER)
-        self.cccb = ComboBreaker(self.ACL, self.SERVER)
-        self.plugins = [self.admin, self.karma, self.url, self.cccb]
+        #self.cccb = ComboBreaker(self.ACL, self.SERVER)
+        self.plugins = [self.admin, self.karma, self.url]
 
 
         self.SERVER.connectToServer()