Exemple #1
0
 def checkmail(self, destination, user):
     db = self.db
     all_rows = database.get_tells(db, user)
     x = 0
     for row in all_rows:
         if x < 4:
             x += 1
             self.send_message(destination, "%s, %s -%s" % (row[0], row[1], row[2]))
     if len(all_rows) > 4:
         return self.response["more_mail"]
     return self.response["no_mail"]
Exemple #2
0
 def checkmail(self, destination, user):
     db = self.db
     all_rows = database.get_tells(db, user)
     x = 0
     for row in all_rows:
         if x < 4:
             x += 1
             self.send_message(destination,
                               "%s, %s -%s" % (row[0], row[1], row[2]))
     if len(all_rows) > 4:
         return self.response["more_mail"]
     elif not len(all_rows):
         return self.response["no_mail"]
Exemple #3
0
 def checkmail(self, destination, user):
     """
     checkmail performs a database lookup using the supplied 'destination' and 'user'
     input in order to find 'tells'. Returns string messages appropriate to whether or
     not the user has 'tells' waiting for them in the database.
     """
     db = self.db
     all_rows = database.get_tells(db, user)
     x = 0
     for row in all_rows:
         if x < 4:
             x += 1
             self.send_message(destination, "%s, %s -%s" % (row[0], row[1], row[2]))
     if len(all_rows) > 4:
         return self.response["more_mail"]
     return self.response["no_mail"]