summaryrefslogtreecommitdiff
path: root/src/http/posts.go
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2023-08-25 21:04:59 +0200
committerBrian Picciano <mediocregopher@gmail.com>2023-08-25 21:12:57 +0200
commit78bbfa42fa1159bce12c2c1d29eeb0bb9a8a2f75 (patch)
tree041dd938346eddf0a4bcd098403c229555a654cb /src/http/posts.go
parentc4ec9064063f3b15aeb25feb85a3afaaa02008ba (diff)
Remove mailinglist and proof-of-work functionality
Diffstat (limited to 'src/http/posts.go')
-rw-r--r--src/http/posts.go13
1 files changed, 3 insertions, 10 deletions
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
}