[cl-irc-cvs] r233 - trunk

ehuelsmann at common-lisp.net ehuelsmann at common-lisp.net
Sun Jan 13 18:31:26 UTC 2013


Author: ehuelsmann
Date: Sun Jan 13 10:31:25 2013
New Revision: 233

Log:
Patch by Julien Danjou: register nickname upon RPL_WELCOME instead
of at connection initiation.

Modified:
   trunk/command.lisp
   trunk/event.lisp
   trunk/protocol.lisp

Modified: trunk/command.lisp
==============================================================================
--- trunk/command.lisp	Sun Jan 13 05:00:44 2013	(r232)
+++ trunk/command.lisp	Sun Jan 13 10:31:25 2013	(r233)
@@ -296,13 +296,8 @@
                                       :socket socket
                                       :network-stream stream
                                       :client-stream logging-stream
-                                      :server-name server))
-         (user (make-user connection
-                          :nickname nickname
-                          :username username
-                          :realname realname)))
+                                      :server-name server)))
     #+sbcl (setf (sb-bsd-sockets::sockopt-keep-alive (usocket:socket socket)) t)
-    (setf (user connection) user)
     (unless (null password)
       (pass connection password))
     (nick connection nickname)

Modified: trunk/event.lisp
==============================================================================
--- trunk/event.lisp	Sun Jan 13 05:00:44 2013	(r232)
+++ trunk/event.lisp	Sun Jan 13 10:31:25 2013	(r233)
@@ -141,6 +141,19 @@
               (username user) username
               (hostname user) hostname)))))
 
+(defmethod default-hook ((message irc-rpl_welcome-message))
+  (with-slots
+        (connection host user arguments)
+      message
+    (destructuring-bind
+          (nickname welcome-message)
+        arguments
+      (setf (user connection)
+            (make-user connection
+                       :nickname nickname
+                       :hostname host
+                       :username user)))))
+
 (defmethod default-hook ((message irc-rpl_list-message))
   (destructuring-bind
       (channel count topic)

Modified: trunk/protocol.lisp
==============================================================================
--- trunk/protocol.lisp	Sun Jan 13 05:00:44 2013	(r232)
+++ trunk/protocol.lisp	Sun Jan 13 10:31:25 2013	(r233)
@@ -247,6 +247,7 @@
                      irc-rpl_topic-message
                      irc-rpl_namreply-message
                      irc-rpl_endofnames-message
+                     irc-rpl_welcome-message
                      irc-ping-message
                      irc-join-message
                      irc-topic-message




More information about the cl-irc-cvs mailing list