\r
GENERIC: write-irc ( irc-message -- )\r
\r
+M: ping write-irc\r
+ drop "* Ping" blue write-color ;\r
+\r
M: privmsg write-irc\r
"<" blue write-color\r
[ prefix>> parse-name write ] keep\r
"> " blue write-color\r
trailing>> write ;\r
\r
+M: notice write-irc\r
+ [ type>> blue write-color ] keep\r
+ ": " blue write-color\r
+ trailing>> write ;\r
+\r
TUPLE: own-message message nick timestamp ;\r
\r
: <own-message> ( message nick -- own-message )\r
\r
GENERIC: handle-inbox ( tab message -- )\r
\r
-: filter-participants ( pack alist val color -- )\r
+: filter-participants ( pack alist val color -- pack )\r
'[ , = [ <label> , >>color add-gadget ] [ drop ] if ] assoc-each ;\r
\r
: update-participants ( tab -- )\r
[ listener>> participants>> ] bi\r
[ +operator+ green filter-participants ]\r
[ +voice+ blue filter-participants ]\r
- [ +normal+ black filter-participants ] 2tri ;\r
+ [ +normal+ black filter-participants ] tri drop ;\r
\r
M: participant-changed handle-inbox\r
drop update-participants ;\r