fix long text in telegram
release / docker-image (push) Successful in 1m9s
release / goreleaser (push) Successful in 10m13s

This commit is contained in:
2026-02-12 20:36:37 +03:00
parent 868c90c896
commit 1905e7ab16
3 changed files with 63 additions and 41 deletions
+2 -4
View File
@@ -42,8 +42,7 @@ type Handler struct {
service *memory.Service
logger *slog.Logger
mux *http.ServeMux
memosURL string // internal Memos URL (for attachment files)
publicURL string // public Memos URL (for memo links)
publicURL string // public Memos URL (for images and memo links)
allowLoadMore bool
}
@@ -54,7 +53,6 @@ func NewHandler(service *memory.Service, memosURL, publicURL string, allowLoadMo
}
h := &Handler{
service: service,
memosURL: strings.TrimRight(memosURL, "/"),
publicURL: strings.TrimRight(pub, "/"),
allowLoadMore: allowLoadMore,
logger: logger,
@@ -107,7 +105,7 @@ func (h *Handler) handleMemory(w http.ResponseWriter, r *http.Request) {
if att.ExternalLink != "" {
imgURL = att.ExternalLink
} else {
imgURL = fmt.Sprintf("%s/file/%s/%s", h.memosURL, att.Name, att.Filename)
imgURL = fmt.Sprintf("%s/file/%s/%s", h.publicURL, att.Name, att.Filename)
}
images = append(images, imageData{URL: imgURL, Alt: att.Filename})
}