Skip to content

Commit

Permalink
Merge pull request #275 from Manganeez/server_password_earlier
Browse files Browse the repository at this point in the history
Per RFC 2812, PASS is required *before* NICK/USER.
  • Loading branch information
Elad Alfassa committed May 31, 2013
2 parents c9faadc + 35dcc2f commit 2d4d934
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions willie/irc.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,12 @@ def handle_connect(self):
% e)
os._exit(1)
self.set_socket(self.ssl)
self.write(('NICK', self.nick))
self.write(('USER', self.user, '+iw', self.nick), self.name)

if self.config.core.server_password is not None:
self.write(('PASS', self.config.core.server_password))
self.write(('NICK', self.nick))
self.write(('USER', self.user, '+iw', self.nick), self.name)

stderr('Connected.')
self.last_ping_time = datetime.now();
timeout_check_thread = threading.Thread(target=self._timeout_check)
Expand Down

0 comments on commit 2d4d934

Please sign in to comment.