aboutsummaryrefslogtreecommitdiff
path: root/plugins/viewhtml/plugin.go
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-05-13 14:07:44 +0200
committerSimon Ser <contact@emersion.fr>2020-05-13 14:07:44 +0200
commitb891a95fcf4a3d4b64100911dae49fb28904a7fd (patch)
treefe07b29d6f2443047b7f740c79d86b3c499cc9e9 /plugins/viewhtml/plugin.go
parent4cf5ad68afd80f27512c464843b0d917182ef0c2 (diff)
downloadalps-b891a95fcf4a3d4b64100911dae49fb28904a7fd.tar.gz
alps-b891a95fcf4a3d4b64100911dae49fb28904a7fd.zip
Rename project to alps
Diffstat (limited to 'plugins/viewhtml/plugin.go')
-rw-r--r--plugins/viewhtml/plugin.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/viewhtml/plugin.go b/plugins/viewhtml/plugin.go
index 1007d4a..a121d92 100644
--- a/plugins/viewhtml/plugin.go
+++ b/plugins/viewhtml/plugin.go
@@ -1,4 +1,4 @@
-package koushinviewhtml
+package alpsviewhtml
import (
"io"
@@ -8,8 +8,8 @@ import (
"strconv"
"strings"
- "git.sr.ht/~emersion/koushin"
- koushinbase "git.sr.ht/~emersion/koushin/plugins/base"
+ "git.sr.ht/~emersion/alps"
+ alpsbase "git.sr.ht/~emersion/alps/plugins/base"
"github.com/labstack/echo/v4"
)
@@ -19,10 +19,10 @@ var (
)
func init() {
- p := koushin.GoPlugin{Name: "viewhtml"}
+ p := alps.GoPlugin{Name: "viewhtml"}
- p.Inject("message.html", func(ctx *koushin.Context, _data koushin.RenderData) error {
- data := _data.(*koushinbase.MessageRenderData)
+ p.Inject("message.html", func(ctx *alps.Context, _data alps.RenderData) error {
+ data := _data.(*alpsbase.MessageRenderData)
data.Extra["RemoteResourcesAllowed"] = ctx.QueryParam("allow-remote-resources") == "1"
hasRemoteResources := false
if v := ctx.Get("viewhtml.hasRemoteResources"); v != nil {
@@ -32,7 +32,7 @@ func init() {
return nil
})
- p.GET("/proxy", func(ctx *koushin.Context) error {
+ p.GET("/proxy", func(ctx *alps.Context) error {
if !proxyEnabled {
return echo.NewHTTPError(http.StatusForbidden, "proxy disabled")
}
@@ -67,5 +67,5 @@ func init() {
return ctx.Stream(http.StatusOK, mediaType, &lr)
})
- koushin.RegisterPluginLoader(p.Loader())
+ alps.RegisterPluginLoader(p.Loader())
}