← All plugin changes

sm-forum-plugin 0.1.1

v0.1.11 min readPlugins

Highlights

Forum threads, replies and edits can now be refused before they are rendered and stored. Listen for the new PostSaving event and return a contracts.Rejection, and the client gets the usual 422 validation answer.

Added

  • New package events with PostSaving (event name golem15.forum.post.saving), fired after the access and required-field checks and before rendering. It carries the context, the actor, the thread and post IDs, the title and body, and Op: events.OpThread, events.OpReply or events.OpUpdate.
  • contracts.Rejection{Field, Message}: a listener returns it to refuse the write. The API answers 422 under errors.title or errors.body (the field you name) and nothing is persisted.

Changed

  • Any other listener error aborts the write and keeps the existing opaque error answer.

Without a PostSaving listener the plugin behaves exactly as v0.1.0. The forum plugin does not depend on chat.

Subscribe via RSS