             f <paste-state>
             [ deposit-entity-slots ]
             [ insert-tuple ]
-            [ id>> paste-url <redirect> ]
+            [ id>> paste-url [ email-on-paste ] [ <redirect> ] bi ]
             tri
         ] >>submit ;
 

furnace.auth furnace.boilerplate furnace.recaptcha
furnace.redirection furnace.syndication html.forms
http.server.dispatchers http.server.responses kernel math.parser
sequences sorting urls validators xmode.catalog ;
IN: webapps.pastebin

TUPLE: pastebin < dispatcher ;

SYMBOL: can-delete-pastes?

can-delete-pastes? define-capability


    now >>date
    { "summary" "author" "mode" "contents" } to-object ;

: email-on-paste ( url -- )
    pastebin-email-list get-global [
        drop
    ] [
        <email> swap >>to
        swap >>body
        "factor-builds2@gmail.com" >>from
        "New paste" >>subject
        send-email
    ] if-empty ;

: <new-paste-action> ( -- action )
    <page-action>
        [
