Support akkoma custom reactions, worst quality

This commit is contained in:
localhost_frssoft 2022-10-23 02:43:38 +03:00
parent cbbebe6b15
commit b07793e986
3 changed files with 15 additions and 0 deletions

View File

@ -20,6 +20,9 @@ type ReactionsPleroma struct {
Count int `json:"count"` Count int `json:"count"`
Me bool `json:"me"` Me bool `json:"me"`
Name string `json:"name"` Name string `json:"name"`
// For support akkoma reactions :)
Url *string `json:"url"`
} }
type ReplyInfo struct { type ReplyInfo struct {

View File

@ -20,7 +20,11 @@
<div class="page-title"> Who reacted </div> <div class="page-title"> Who reacted </div>
{{range .Reactions}} {{range .Reactions}}
{{if .Url}}
<div class="page-title"><img src="{{.Url}}" height=32 width=32></img></div>
{{else}}
<div class="page-title">{{.Name}}</div> <div class="page-title">{{.Name}}</div>
{{end}}
{{template "userlist.tmpl" (WithContext .Accounts $.Ctx)}} {{template "userlist.tmpl" (WithContext .Accounts $.Ctx)}}
{{end}} {{end}}
{{end}} {{end}}

View File

@ -105,13 +105,21 @@
<form action="/unreact-with/{{$st_id}}?emoji={{.Name}}" method="post" target="_self"> <form action="/unreact-with/{{$st_id}}?emoji={{.Name}}" method="post" target="_self">
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}"> <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
{{if .Url}}
<input type="image" src="{{.Url}}" alt="{{.Name}}{{.Count}}*" height=36 width=36 class="pleroma-emoji">
{{else}}
<input type="submit" value="{{.Name}}{{.Count}}*" class="pleroma-emoji"> <input type="submit" value="{{.Name}}{{.Count}}*" class="pleroma-emoji">
{{end}}
</form> </form>
{{else}} {{else}}
<form action="/react-with/{{$st_id}}?emoji={{.Name}}" method="post" target="_self"> <form action="/react-with/{{$st_id}}?emoji={{.Name}}" method="post" target="_self">
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}"> <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
{{if .Url}}
<input type="image" src="{{.Url}}" alt="{{.Name}}{{.Count}}" height=32 width=32 class="pleroma-emoji">
{{else}}
<input type="submit" value="{{.Name}}{{.Count}}" class="pleroma-emoji"> <input type="submit" value="{{.Name}}{{.Count}}" class="pleroma-emoji">
{{end}}
</form> </form>
{{end}} {{end}}
{{end}} {{end}}