Support send akkoma custom reactions

This commit is contained in:
localhost_frssoft 2022-10-26 01:16:13 +03:00
parent ca99d0a789
commit e6019323f6
2 changed files with 10 additions and 0 deletions

View File

@ -333,6 +333,10 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
putreact := handle(func(c *client) error { putreact := handle(func(c *client) error {
q := c.r.URL.Query() q := c.r.URL.Query()
emoji := q.Get("emoji") emoji := q.Get("emoji")
if len(emoji) <= 0 {
emoji = c.r.FormValue("akkoma-reaction")
}
id, _ := mux.Vars(c.r)["id"] id, _ := mux.Vars(c.r)["id"]
_, err := s.PutReact(c, id, emoji) _, err := s.PutReact(c, id, emoji)
if err != nil { if err != nil {

View File

@ -15,6 +15,12 @@
</form> </form>
{{end}} {{end}}
{{end}} {{end}}
<form action="/react-with/{{$st_id}}" method="post" target="_self" title="Custom akkoma reactions (ex. :blobemoji:)">
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
<input type="text" label="ex. :pleromaemoji:" id="akkoma-reaction" cols=30 name="akkoma-reaction">
<input type="submit" value="Send custom reaction" class="pleroma-emoji">
</form>
</div> </div>
</div> </div>