prevent telegram instant view when we could fit stuff in the big image card.

This commit is contained in:
fiatjaf
2023-11-08 19:30:18 -03:00
parent 8c591b72f4
commit dee60d4721

View File

@@ -87,7 +87,7 @@ func renderEvent(w http.ResponseWriter, r *http.Request) {
if data.event.Kind == 30023 || // do it for longform articles
(data.event.Kind == 1 && len(data.event.Content) > 650) || // or very long notes
// or shorter notes that should be using text-to-image stuff but are not because they have video or images
(data.event.Kind == 1 && len(data.event.Content) > 133 && !useTextImage) {
(data.event.Kind == 1 && len(data.event.Content)-len(data.image) > 133 && !useTextImage) {
data.templateId = TelegramInstantView
useTextImage = false
}