aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--OutboxPost.go3
-rw-r--r--main.go2
-rw-r--r--static/posts.html2
3 files changed, 5 insertions, 2 deletions
diff --git a/OutboxPost.go b/OutboxPost.go
index 235611e..b51e7cc 100644
--- a/OutboxPost.go
+++ b/OutboxPost.go
@@ -355,7 +355,8 @@ func ObjectFromForm(r *http.Request, db *sql.DB, obj ObjectBase) ObjectBase {
obj.Preview = CreatePreviewObject(obj.Attachment[0])
}
- obj.AttributedTo = EscapeString(r.FormValue("name"))
+ obj.AttributedTo = CreateNameTripCode(r.FormValue("name"))
+ obj.AttributedTo = EscapeString(obj.AttributedTo)
obj.Name = EscapeString(r.FormValue("subject"))
obj.Content = EscapeString(r.FormValue("comment"))
diff --git a/main.go b/main.go
index 30f3430..e4cf856 100644
--- a/main.go
+++ b/main.go
@@ -926,7 +926,7 @@ func CreateNameTripCode(input string) string {
re := regexp.MustCompile("#.+")
chunck := re.FindString(input)
hash := CreateTripCode(chunck)
- return re.ReplaceAllString(input, hash[0:8])
+ return re.ReplaceAllString(input, "!" + hash[42:50])
}
func GetActorFromPath(db *sql.DB, location string, prefix string) Actor {
diff --git a/static/posts.html b/static/posts.html
index fcc8aec..e146032 100644
--- a/static/posts.html
+++ b/static/posts.html
@@ -65,8 +65,10 @@
{{ if .Replies }}
{{ $replies := .Replies }}
{{ if gt $replies.TotalItems 5 }}
+ {{ if gt $len 1 }}
<span>{{ $replies.TotalItems }} replies{{ if gt $replies.TotalImgs 0}} and {{ $replies.TotalImgs }} images{{ end }}, Click <a id="view" post="{{.Id}}" href="/{{ $board.Name }}/{{ .Id }}">here</a> to view all.</span>
{{ end }}
+ {{ end }}
{{ range $replies.OrderedItems }}
<div id="{{ .Id }}">
<div style="display: inline-block; overflow: auto;">