]> gitweb.factorcode.org Git - factor.git/commitdiff
irc.ui: Fixed inference error, can now display notices
authorWilliam Schlieper <schlieper@unc.edu>
Fri, 1 Aug 2008 22:44:28 +0000 (18:44 -0400)
committerWilliam Schlieper <schlieper@unc.edu>
Fri, 1 Aug 2008 22:44:28 +0000 (18:44 -0400)
extra/irc/ui/ui.factor

index 0ceeed1d35b4c469bf649687dff32ea30f619acd..662fca6d79ed6e9ca9be73417c7953427b87c012 100755 (executable)
@@ -39,12 +39,20 @@ TUPLE: irc-tab < frame listener client userlist ;
 \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
@@ -116,7 +124,7 @@ M: irc-message write-irc
 \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
@@ -124,7 +132,7 @@ GENERIC: handle-inbox ( tab message -- )
     [ 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