lain is a fickle mistress

This commit is contained in:
Ted Unangst 2020-02-07 11:57:00 -05:00
parent 8fd2e42878
commit 285f3cb5ac
8 changed files with 16 additions and 7 deletions

View File

@ -1127,7 +1127,7 @@ func jonkjonk(user *WhatAbout, h *Honk) (junk.Junk, junk.Junk) {
j["context"] = h.Convoy j["context"] = h.Convoy
} }
case "react": case "react":
j["type"] = "EmojiReaction" j["type"] = "EmojiReact"
j["object"] = h.XID j["object"] = h.XID
if h.Convoy != "" { if h.Convoy != "" {
j["context"] = h.Convoy j["context"] = h.Convoy

View File

@ -51,7 +51,7 @@ func userfromrow(row *sql.Row) (*WhatAbout, error) {
user.URL = fmt.Sprintf("https://%s/%s", serverName, user.Name) user.URL = fmt.Sprintf("https://%s/%s", serverName, user.Name)
} }
if user.Options.Reaction == "" { if user.Options.Reaction == "" {
user.Options.Reaction = "😞" user.Options.Reaction = "none"
} }
return user, nil return user, nil
} }

View File

@ -111,7 +111,7 @@ activities.
Does what it can. Does what it can.
.It Vt Like .It Vt Like
Don't be ridiculous. Don't be ridiculous.
.It Vt EmojiReaction .It Vt EmojiReact
Be ridiculous. Be ridiculous.
.El .El
.Ss METADATA .Ss METADATA

View File

@ -4,6 +4,8 @@ changelog
--- Add Reactions. --- Add Reactions.
+++ Rename reactions to badonkadonks.
+ Quick fix to hide all images. + Quick fix to hide all images.
+ Allow resending follow requests. + Allow resending follow requests.

View File

@ -126,7 +126,7 @@ Sometimes a thread goes on entirely too long.
Untag will hide further replies to the selected post, but without muting the Untag will hide further replies to the selected post, but without muting the
entire thread. entire thread.
Replies higher in the tree are still received. Replies higher in the tree are still received.
.It Ic react .It Ic badonkadonk
Please no. Please no.
.It Ic edit .It Ic edit
Change it up. Change it up.

View File

@ -16,6 +16,7 @@
<input tabindex=1 type="checkbox" id="maps" name="maps" value="apple" {{ if eq "apple" .User.Options.MapLink }}checked{{ end }}><span></span> <input tabindex=1 type="checkbox" id="maps" name="maps" value="apple" {{ if eq "apple" .User.Options.MapLink }}checked{{ end }}><span></span>
<p><label class="button" for="reaction">reaction:</label> <p><label class="button" for="reaction">reaction:</label>
<select tabindex=1 name="reaction"> <select tabindex=1 name="reaction">
<option {{ and (eq .User.Options.Reaction "none") "selected" }}>none</option>
<option {{ and (eq .User.Options.Reaction "😞") "selected" }}>😞</option> <option {{ and (eq .User.Options.Reaction "😞") "selected" }}>😞</option>
<option {{ and (eq .User.Options.Reaction "\U0001F937") "selected" }}>{{ "\U0001F937" }}</option> <option {{ and (eq .User.Options.Reaction "\U0001F937") "selected" }}>{{ "\U0001F937" }}</option>
<option {{ and (eq .User.Options.Reaction "🙈") "selected" }}>🙈</option> <option {{ and (eq .User.Options.Reaction "🙈") "selected" }}>🙈</option>

View File

@ -2,6 +2,7 @@
{{ $bonkcsrf := .BonkCSRF }} {{ $bonkcsrf := .BonkCSRF }}
{{ $IsPreview := .IsPreview }} {{ $IsPreview := .IsPreview }}
{{ $maplink := .MapLink }} {{ $maplink := .MapLink }}
{{ $hasbadonk := .HasBadonk }}
{{ with .Honk }} {{ with .Honk }}
<header> <header>
{{ if $bonkcsrf }} {{ if $bonkcsrf }}
@ -121,10 +122,12 @@ in reply to: <a href="{{ .RID }}" rel=noreferrer>{{ .RID }}</a>
<button onclick="return flogit(this, 'untag', '{{ .Honk.XID }}');">untag me</button> <button onclick="return flogit(this, 'untag', '{{ .Honk.XID }}');">untag me</button>
{{ end }} {{ end }}
<button><a href="/edit?xid={{ .Honk.XID }}">edit</a></button> <button><a href="/edit?xid={{ .Honk.XID }}">edit</a></button>
{{ if $hasbadonk }}
{{ if .Honk.IsReacted }} {{ if .Honk.IsReacted }}
<button disabled>reacted</button> <button disabled>badonkadonked</button>
{{ else }} {{ else }}
<button onclick="return flogit(this, 'react', '{{ .Honk.XID }}');">react</button> <button onclick="return flogit(this, 'react', '{{ .Honk.XID }}');">badonkadonk</button>
{{ end }}
{{ end }} {{ end }}
</div> </div>
</details> </details>

5
web.go
View File

@ -333,7 +333,7 @@ func inbox(w http.ResponseWriter, r *http.Request) {
} }
what, _ := j.GetString("type") what, _ := j.GetString("type")
obj, _ := j.GetString("object") obj, _ := j.GetString("object")
if what == "Like" || (what == "EmojiReaction" && originate(obj) != serverName) { if what == "Like" || (what == "EmojiReact" && originate(obj) != serverName) {
return return
} }
who, _ := j.GetString("actor") who, _ := j.GetString("actor")
@ -1271,6 +1271,9 @@ func zonkit(w http.ResponseWriter, r *http.Request) {
} }
if wherefore == "react" { if wherefore == "react" {
if user.Options.Reaction == "none" {
return
}
xonk := getxonk(userinfo.UserID, what) xonk := getxonk(userinfo.UserID, what)
if xonk != nil { if xonk != nil {
_, err := stmtUpdateFlags.Exec(flagIsReacted, xonk.ID) _, err := stmtUpdateFlags.Exec(flagIsReacted, xonk.ID)