fix for external attachments not having xid anymore
This commit is contained in:
parent
1e9d1f0fc7
commit
a81cf01844
|
@ -401,6 +401,7 @@ func donksforhonks(honks []*Honk) {
|
|||
log.Printf("error scanning donk: %s", err)
|
||||
continue
|
||||
}
|
||||
d.External = !strings.HasPrefix(d.URL, serverPrefix)
|
||||
h := hmap[hid]
|
||||
h.Donks = append(h.Donks, d)
|
||||
}
|
||||
|
|
3
honk.go
3
honk.go
|
@ -163,6 +163,7 @@ type Donk struct {
|
|||
URL string
|
||||
Media string
|
||||
Local bool
|
||||
External bool
|
||||
}
|
||||
|
||||
type Place struct {
|
||||
|
@ -231,6 +232,7 @@ const (
|
|||
)
|
||||
|
||||
var serverName string
|
||||
var serverPrefix string
|
||||
var masqName string
|
||||
var dataDir = "."
|
||||
var viewDir = "."
|
||||
|
@ -281,6 +283,7 @@ func main() {
|
|||
if masqName == "" {
|
||||
masqName = serverName
|
||||
}
|
||||
serverPrefix = fmt.Sprintf("https://%s/", serverName)
|
||||
getconfig("usersep", &userSep)
|
||||
getconfig("honksep", &honkSep)
|
||||
getconfig("debug", &debugMode)
|
||||
|
|
|
@ -78,7 +78,7 @@ in reply to: <a href="{{ .RID }}" rel=noreferrer>{{ .RID }}</a>
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ if .XID }}
|
||||
{{ if .External }}
|
||||
<p><a href="{{ .URL }}" rel=noreferrer>External Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
|
||||
{{ else }}
|
||||
{{ if eq .Media "video/mp4" }}
|
||||
|
|
Loading…
Reference in New Issue