irc.client: Notify mode change

db4
Bruno Deferrari 2008-10-25 20:41:33 -02:00
parent 4ca1fde579
commit d7affa7c50
2 changed files with 16 additions and 6 deletions

View File

@ -195,3 +195,11 @@ M: mb-writer dispose drop ;
[ participant-changed? ] read-matching-message
] unit-test
] with-irc
! Mode change
[ { T{ participant-changed f "ircuser" +mode+ "+o" } } [
"#factortest" <irc-channel-chat> [ %add-named-chat ] keep
":ircserver.net MODE #factortest +o ircuser" %push-line
[ participant-changed? ] read-matching-message
] unit-test
] with-irc

View File

@ -141,7 +141,9 @@ M: irc-chat to-chat in-messages>> mailbox-put ;
: change-participant-mode ( channel mode nick -- )
rot chat>
[ participants>> set-at ]
[ [ [ +mode+ ] dip <participant-changed> ] dip to-chat ] 3bi ; ! FIXME
[ [ participant-changed new
[ (>>nick) ] [ (>>parameter) ] [ +mode+ >>action ] tri ] dip to-chat ]
3bi ; ! FIXME
DEFER: me?
@ -224,11 +226,11 @@ M: quit process-message
M: nick process-message
[ irc-message-sender ] [ trailing>> ] bi rename-participant-in-all ;
! M: mode process-message ( mode -- )
! [ channel-mode? ] keep and [
! [ name>> ] [ mode>> ] [ parameter>> ] tri
! [ change-participant-mode ] [ 2drop ] if*
! ] when* ;
M: mode process-message ( mode -- )
[ channel-mode? ] keep and [
[ name>> ] [ mode>> ] [ parameter>> ] tri
[ change-participant-mode ] [ 2drop ] if*
] when* ;
: >nick/mode ( string -- nick mode )
dup first "+@" member? [ unclip ] [ 0 ] if participant-mode ;