Ejemplo n.º 1
0
 def _logInUser(self, username):
     """Login a user."""
     username = util.stripUsername(username)
     if username not in self.loggedInUsers:
         self.server.users[username].loggedIn = True
         self.server.users[username].lastLogin = self.server.users[username].loggedInTime
         self.server.users[username].loggedInTime = time.time()
Ejemplo n.º 2
0
 def _logout(self, username):
     """Logout a user. Returns True if the user was loggedin, else False."""
     username = util.stripUsername(username)
     if username in self.loggedInUsers:
         self.server.users[username].loggedIn = False
         return True
     return False
Ejemplo n.º 3
0
 def removeUser(self, nickname):
     snickname = util.stripUsername(nickname)
     self.server.users[snickname].removeFromChannel(self.name)
Ejemplo n.º 4
0
 def addUser(self, nickname):
     snickname = util.stripUsername(nickname)
     if snickname not in self.server.users:
         self.server.users[snickname] = src.irc.userObject.UserObject(nickname)
     self.server.users[snickname].addChannel(self.name)
Ejemplo n.º 5
0
 def userQuit(self, username):
     username = util.stripUsername(username)
     self.users[username].online = False
Ejemplo n.º 6
0
 def nickChange(self, oldNick, newNick):
     oldNick = util.stripUsername(oldNick)
     newNick = util.stripUsername(newNick)
     self.users[newNick] = self.users[oldNick]
     del self.users[oldNick]
Ejemplo n.º 7
0
 def _isLoggedIn(self, username):
     """Check if a user is logged in."""
     if util.stripUsername(username) in self.loggedInUsers:
         return True
     return False