From 78bbfa42fa1159bce12c2c1d29eeb0bb9a8a2f75 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Fri, 25 Aug 2023 21:04:59 +0200 Subject: Remove mailinglist and proof-of-work functionality --- src/http/posts.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/http/posts.go') diff --git a/src/http/posts.go b/src/http/posts.go index 5c7ac25..b1dbc35 100644 --- a/src/http/posts.go +++ b/src/http/posts.go @@ -418,7 +418,7 @@ func postFromPostReq(r *http.Request) (post.Post, error) { return p, nil } -func (a *api) storeAndPublishPost(ctx context.Context, p post.Post) error { +func (a *api) publishPost(ctx context.Context, p post.Post) error { first, err := a.params.PostStore.Set(p, time.Now()) @@ -430,13 +430,6 @@ func (a *api) storeAndPublishPost(ctx context.Context, p post.Post) error { return nil } - a.params.Logger.Info(ctx, "publishing blog post to mailing list") - urlStr := a.postURL(p.ID, true) - - if err := a.params.MailingList.Publish(p.Title, urlStr); err != nil { - return fmt.Errorf("publishing post to mailing list: %w", err) - } - if err := a.params.PostDraftStore.Delete(p.ID); err != nil { return fmt.Errorf("deleting draft: %w", err) } @@ -458,9 +451,9 @@ func (a *api) postPostHandler() http.Handler { ctx = mctx.Annotate(ctx, "postID", p.ID) - if err := a.storeAndPublishPost(ctx, p); err != nil { + if err := a.publishPost(ctx, p); err != nil { apiutil.InternalServerError( - rw, r, fmt.Errorf("storing/publishing post with id %q: %w", p.ID, err), + rw, r, fmt.Errorf("publishing post with id %q: %w", p.ID, err), ) return } -- cgit v1.2.3