about summary refs log tree commit diff
path: root/src/handlers.rs
AgeCommit message (Collapse)AuthorFilesLines
2018-04-17 chore(license): Relicense under AGPL-3.0-or-laterVincent Ambo1-8/+10
Relicense the project from the standard GPL3 to the Affero version of the license, requiring source code disclosure for modifications made on instances of Converse that are serving users over the network.
2018-04-15 feat(handlers): Implement post editing handlerVincent Ambo1-0/+28
Implements a handler that receives the edit form result and updates the database accordingly if the user identity matches.
2018-04-15 feat(handlers/render): Display edit form for user's own postsVincent Ambo1-0/+35
Displays an edit form for posts that are owned by a user (which is currently defined as "email addresses match").
2018-04-15 refactor(templates/render): Add generic post editing templateVincent Ambo1-7/+7
Adds a generic template that can be used for submitting, responding to and editing posts.
2018-04-15 fix(handlers): Trim leading/trailing whitespace from new threadsVincent Ambo1-6/+12
2018-04-15 feat(handlers): Determine whether current user can edit a postVincent Ambo1-1/+8
2018-04-14 refactor(handlers): Receive search terms via query parametersVincent Ambo1-3/+3
There are several reasons for this, but one important one is that people expect to be able to share search links.
2018-04-14 feat: Implement search result view & enable searchVincent Ambo1-0/+16
Implements a very simple and currently kinda broken-looking search result view.
2018-04-14 refactor(handlers): Improve error handling in post creationVincent Ambo1-2/+2
2018-04-14 feat: License project under GPLv3Vincent Ambo1-0/+16
2018-04-14 refactor(db): Store thread body in the posts tableVincent Ambo1-2/+6
This is a simplification over the previous approach. The OP of a thread is just a normal post like any other in this model, which allows some code simplifications (and future query convenience).
2018-04-12 feat(handlers/main): Add 'anonymous' mode for forumVincent Ambo1-6/+17
Adds a `REQUIRE_LOGIN` environment variable which, if set to anything other than true, will let users post anonymously on the forums.
2018-04-12 feat(handler): Perform basic input validation on new thread viewVincent Ambo1-2/+17
2018-04-12 fix(handlers): Fix chained error handling in actorsVincent Ambo1-14/+15
This took me some time to figure out so it's useful to document in the commit message. When chaining messages from actors, the result type of a message (i.e. the actual `<M as Message>::Result`) is sometimes itself a `Result<T, E>`. In many cases this leads to a situation where the return type of a message sending process is something like (simplified): Future<Item=Result<Foo, ConverseError>, Error=actix::MailboxError> Due to the implementation of `From<actix::MailboxError> for ConverseError` it is possible to use `.from_err()` on these futures to convert the future's `Error` to `ConverseError`. The type `Result` apparently implements `IntoFuture`, which means that due to some trait magic that's been applied somewhere in the futures API a call to `flatten()` can "lift" the contained error if the error types match and give us a "simple" Future<Item=Foo, Error=ConverseError> From that point on chaining becomes easy.
2018-04-11 chore(handlers): Remove unused codeVincent Ambo1-8/+0
2018-04-11 fix(templates/handlers): Fix post anchorsVincent Ambo1-1/+1
- ensure users are correctly linked to a post actor after replying - ensure timestamps are clickable to get post IDs
2018-04-11 chore: Clean up unused importsVincent Ambo1-2/+1
2018-04-11 refactor(handlers): Use rendering actor for page rendersVincent Ambo1-45/+27
This currently breaks error handling in page render flows. To fix it properly, the database actor should return failable futures instead of `Result<T>` wrapped in a future.
2018-04-09 feat(handlers/templates): Add "New Thread" handler and templateVincent Ambo1-0/+9
2018-04-09 feat(handlers): Extract & add author to thread and post informationVincent Ambo1-4/+40
2018-04-09 feat(handlers): Add RequireLogin middlewareVincent Ambo1-3/+26
Adds a middleware that automatically redirects users to the login page if they don't have an active session (i.e. 'author' set).
2018-04-08 feat(handlers): Use cookie session backend to store author infoVincent Ambo1-8/+16
2018-04-08 feat(handler): Implement OIDC login & callback handlersVincent Ambo1-0/+23
2018-04-08 feat(handlers): Add reply_thread handler for postsVincent Ambo1-1/+16
2018-04-08 feat(handlers): Add thread submission handlerVincent Ambo1-0/+15
2018-04-08 refactor(main): Move handlers into separate handler moduleVincent Ambo1-0/+76