fix long text in telegram
This commit is contained in:
@@ -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})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user