Fix !post in round-robin mode, reaction VS16, image label

- !post falls back to newest unposted story for the channel when the
  in-memory queue is empty (the steady state under round-robin).
- Accept ️/️ (U+FE0F variation selector) as question reactions —
  the bare codepoints alone missed clients that render the colored emoji.
- Rewrite Guardian i.guim.co.uk thumbnails to width=1200 so we stop
  rejecting real images as "tracking pixels"; relabel the size warning.
- Log decrypt failures and reactions on events not in post_log so future
  silent drops surface instead of vanishing.
This commit is contained in:
prosolis
2026-05-24 09:14:37 -07:00
parent 23fffdda3c
commit afe2ef996b
9 changed files with 92 additions and 7 deletions

30
main.go
View File

@@ -92,11 +92,35 @@ func main() {
if queue.ForcePost(channel) {
return
}
// In-memory queue empty (common in round-robin mode). Fall back to the
// newest classified, not-yet-posted story for this channel.
story, err := storage.GetNewestPostableStoryByChannel(channel)
if err != nil {
slog.Error("!post: db lookup failed", "channel", channel, "err", err)
return
}
if story != nil {
imageURL := ""
if story.ImageURL != "" && ingestion.ValidateImageURL(story.ImageURL) {
imageURL = story.ImageURL
}
queue.PostNow(poster.QueueItem{
GUID: story.GUID,
Headline: story.Headline,
Lede: story.Lede,
ImageURL: imageURL,
ArticleURL: story.ArticleURL,
Source: story.Source,
Channel: story.Channel,
Platforms: storage.UnmarshalPlatforms(story.Platforms),
})
return
}
if err := mx.PostThreadedReply(channel, eventID,
"nothing queued for "+channel,
"nothing queued for <code>"+channel+"</code>",
"nothing available for "+channel,
"nothing available for <code>"+channel+"</code>",
); err != nil {
slog.Warn("!post: failed to send empty-queue reply", "err", err)
slog.Warn("!post: failed to send empty reply", "err", err)
}
})