all repos — honk @ 94b5284cfe206a006e3f57f69720c0aca8145624

my fork of honk

some pleroma frontends apparently use notice urls
Ted Unangst tedu@tedunangst.com
Thu, 09 Mar 2023 00:54:59 -0500
commit

94b5284cfe206a006e3f57f69720c0aca8145624

parent

b3897d2f89702d2bb97cc2d33d3ba2a803ed50d1

2 files changed, 5 insertions(+), 5 deletions(-)

jump to
M activity.goactivity.go

@@ -511,7 +511,8 @@ var re_mast0link = regexp.MustCompile(`https://[[:alnum:].]+/users/[[:alnum:]]+/statuses/[[:digit:]]+`)

var re_masto1ink = regexp.MustCompile(`https://[[:alnum:].]+/@[[:alnum:]]+/[[:digit:]]+`) var re_misslink = regexp.MustCompile(`https://[[:alnum:].]+/notes/[[:alnum:]]+`) var re_honklink = regexp.MustCompile(`https://[[:alnum:].]+/u/[[:alnum:]]+/h/[[:alnum:]]+`) -var re_romalink = regexp.MustCompile(`https://[[:alnum:].]+/objects/[[:alnum:]-]+`) +var re_r0malink = regexp.MustCompile(`https://[[:alnum:].]+/objects/[[:alnum:]-]+`) +var re_roma1ink = regexp.MustCompile(`https://[[:alnum:].]+/notice/[[:alnum:]]+`) var re_qtlinks = regexp.MustCompile(`>https://[^\s<]+<`) func qutify(user *WhatAbout, content string) string {

@@ -521,11 +522,10 @@ malcontent = strings.ReplaceAll(malcontent, `</span><span class="invisible">`, "")

mlinks := re_qtlinks.FindAllString(malcontent, -1) for _, m := range mlinks { m = m[1 : len(m)-1] - if re_mast0link.MatchString(m) || - re_masto1ink.MatchString(m) || + if re_mast0link.MatchString(m) || re_masto1ink.MatchString(m) || re_misslink.MatchString(m) || re_honklink.MatchString(m) || - re_romalink.MatchString(m) { + re_r0malink.MatchString(m) || re_roma1ink.MatchString(m) { j, err := GetJunk(user.ID, m) if err == nil { q, ok := j.GetString("content")
M web.goweb.go

@@ -2113,7 +2113,7 @@ return fmt.Sprintf("%d", secs)

} func lookatme(ava string) string { - if strings.Contains(ava, serverName + "/" + userSep) { + if strings.Contains(ava, serverName+"/"+userSep) { idx := strings.LastIndexByte(ava, '/') if idx < len(ava) { name := ava[idx+1:]