From c27636a438057b5edd02e3355fda289c4f419e90 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Fri, 22 Mar 2019 05:17:54 +0000 Subject: [PATCH] Add route /publish for sending activities, getOutboxR now free to return outbox --- config/routes | 1 + src/Vervis/Foundation.hs | 1 + src/Vervis/Handler/Inbox.hs | 8 ++++++-- templates/default-layout.hamlet | 5 +++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/config/routes b/config/routes index c97ad1c..4c87e8e 100644 --- a/config/routes +++ b/config/routes @@ -24,6 +24,7 @@ -- Federation -- ---------------------------------------------------------------------------- +/publish PublishR GET /inbox InboxR GET POST /outbox OutboxR GET POST /akey1 ActorKey1R GET diff --git a/src/Vervis/Foundation.hs b/src/Vervis/Foundation.hs index cd09051..688949a 100644 --- a/src/Vervis/Foundation.hs +++ b/src/Vervis/Foundation.hs @@ -765,6 +765,7 @@ instance YesodBreadcrumbs App where FaviconR -> ("", Nothing) RobotsR -> ("", Nothing) + PublishR -> ("Publish", Just HomeR) InboxR -> ("Inbox", Nothing) OutboxR -> ("Outbox", Nothing) ActorKey1R -> ("Actor Key 1", Nothing) diff --git a/src/Vervis/Handler/Inbox.hs b/src/Vervis/Handler/Inbox.hs index 84a2519..61dc205 100644 --- a/src/Vervis/Handler/Inbox.hs +++ b/src/Vervis/Handler/Inbox.hs @@ -16,6 +16,7 @@ module Vervis.Handler.Inbox ( getInboxR , postInboxR + , getPublishR , getOutboxR , postOutboxR , getActorKey1R @@ -219,11 +220,14 @@ activityWidget widget enctype = |] -getOutboxR :: Handler Html -getOutboxR = do +getPublishR :: Handler Html +getPublishR = do ((_result, widget), enctype) <- runFormPost activityForm defaultLayout $ activityWidget widget enctype +getOutboxR :: Handler TypedContent +getOutboxR = error "Not implemented yet" + route2uri' :: (Route App -> Text) -> Route App -> FedURI route2uri' renderUrl r = case parseFedURI $ renderUrl r of diff --git a/templates/default-layout.hamlet b/templates/default-layout.hamlet index f4dfd63..9d881cd 100644 --- a/templates/default-layout.hamlet +++ b/templates/default-layout.hamlet @@ -30,8 +30,9 @@ $nothing Sign up.

- UPDATE: Federation is coming! - Very early testing + UPDATE: Federation is coming! You can publish + activities, and see results in the destination server's + inbox report page! <.instance> Vervis @ #{instanceHost}