It should be possible to identify without flushing.

This commit is contained in:
Jeremy Fincher 2005-03-27 09:59:44 +00:00
parent 47a1912030
commit 5ce2baa2d2
2 changed files with 4 additions and 3 deletions

View File

@ -339,7 +339,7 @@ class User(callbacks.Plugin):
if user.checkPassword(password):
try:
user.addAuth(msg.prefix)
ircdb.users.setUser(user)
ircdb.users.setUser(user, flush=False)
irc.replySuccess()
except ValueError:
irc.error('Your secure flag is true and your hostmask '

View File

@ -707,7 +707,7 @@ class UsersDictionary(utils.IterableMap):
del self._hostmaskCache[hostmask]
del self._hostmaskCache[id]
def setUser(self, user):
def setUser(self, user, flush=True):
"""Sets a user (given its id) to the IrcUser given it."""
self.nextId = max(self.nextId, user.id)
try:
@ -731,7 +731,8 @@ class UsersDictionary(utils.IterableMap):
raise DuplicateHostmask, hostmask
self.invalidateCache(user.id)
self.users[user.id] = user
self.flush()
if flush:
self.flush()
def delUser(self, id):
"""Removes a user from the database."""