[cl-irc-devel] [patch] Add a connection arg to irc-message-event

Hi, Beirc as it is right now uses a really ugly re-implementation of the read-message method, because in order to operate correctly, we can't just use an :around method on read-message like this: (defmethod read-message ((con my-irc-connection)) (let ((m (call-next-method))) (dispatch-on-message m) m)) Why? Because (in the case of a QUIT message) read-message modified the channel user table already when beirc tries to find out which channels a user who just quit was on. So, I think we're specializing a method one level too high. We should be specializing the irc-message-event method, but it has no connection argument. Yet. The attached patch adds a connection argument on which irc-message-event can be specialized. I would also suggest exporting irc-message-event and making that method the recommended way to dispatch on all messages on an irc connection. I've used this patch with a locally hacked version of beirc for a few days now and it works very well for me. I hope you all like it, because I'd really like to see that ugly wart in beirc go away. (-: -- Andreas Fuchs, (http://|im:asf@|mailto:asf@)boinkor.net, antifuchs

Beirc as it is right now uses a really ugly re-implementation of the read-message method, because in order to operate correctly, we can't just use an :around method on read-message like this:
It's great to hear from a library user for once ! :-)
(defmethod read-message ((con my-irc-connection)) (let ((m (call-next-method))) (dispatch-on-message m) m))
Why? Because (in the case of a QUIT message) read-message modified the channel user table already when beirc tries to find out which channels a user who just quit was on.
Good point.
So, I think we're specializing a method one level too high. We should be specializing the irc-message-event method, but it has no connection argument. Yet.
Well, now it does :-)
The attached patch adds a connection argument on which irc-message-event can be specialized. I would also suggest exporting irc-message-event and making that method the recommended way to dispatch on all messages on an irc connection.
Thanks for your contribution! anonymous CVS should lag a bit, but the change is in. bye, Erik. -- 10 GB Mailbox, 100 FreeSMS/Monat http://www.gmx.net/de/go/topmail +++ GMX - die erste Adresse f�r Mail, Message, More +++
participants (2)
-
Andreas Fuchs
-
Erik Huelsmann