aboutsummaryrefslogtreecommitdiffstats
path: root/handlers.go
Commit message (Collapse)AuthorAgeFilesLines
* Introduce base pluginLibravatarLibravatar Simon Ser 2019-12-161-288/+0
| | | | | | This plugin offers base IMAP/SMTP functionality. References: https://todo.sr.ht/~sircmpwn/koushin/39
* Export Server.{Sessions,Plugins}LibravatarLibravatar Simon Ser 2019-12-111-1/+1
| | | | And unexport a few internal functions.
* Export Context.SetSession, unexport Session.TokenLibravatarLibravatar Simon Ser 2019-12-111-2/+2
| | | | | | | I'm uneasy exposing the token to plugins, I prefer to hide it if possible to prevent mis-use. This change allows plugins to logout users.
* Export ContextLibravatarLibravatar Simon Ser 2019-12-111-14/+14
| | | | This allows plugins to access it.
* go fmtLibravatarLibravatar Simon Ser 2019-12-101-7/+7
|
* Introduce GlobalRenderData and RenderDataLibravatarLibravatar Simon Ser 2019-12-101-7/+8
| | | | | | | | GlobalRenderData contains some global metadata that can be obtained from any template. RenderData is a base type for template data. It contains a Global field with global metadata and an Extra field for plugins.
* Reconnect to IMAP server when logged outLibravatarLibravatar Simon Ser 2019-12-091-9/+3
| | | | | | | | | | | | | | | The session manager has been upgraded to deal with reconnections. Each session has its own expiration timer. Each time a request is received, the expiration timer is reset. A session can be closed (this is used when the user wants to logout). When the IMAP connection is closed by the server, it's set to nil in the session. The next time an IMAP command needs to be issued, the connection is re-established. Closes: https://todo.sr.ht/~sircmpwn/koushin/30
* Make SessionManager create the IMAP clientLibravatarLibravatar Simon Ser 2019-12-091-11/+4
| | | | | This will allow SessionManager to re-connect when the IMAP server logs the user out.
* Rename ConnPool to SessionManagerLibravatarLibravatar Simon Ser 2019-12-091-1/+1
|
* Make render data staticLibravatarLibravatar Simon Ser 2019-12-091-14/+39
| | | | | | | | This makes sure fields filled by vanilla koushin keep the right type. A new Extra field allows plugins to attach their own data. This also makes it easier to write Go plugins, which would have trouble working with interface{}.
* Use imap.BodyStructure.Filename and imap.Address.AddressLibravatarLibravatar Simon Ser 2019-12-091-1/+1
| | | | | The former fixes encoding issues in filenames. The latter is just for brevity.
* Extract HTTP handlers in separate fileLibravatarLibravatar Simon Ser 2019-12-041-0/+275