MCPcopy Create free account
hub / github.com/basecamp/hey-cli / fetchTopic

Method fetchTopic

internal/tui/mail.go:370–398  ·  view source on GitHub ↗
(topicID int64, title string)

Source from the content-addressed store, hash-verified

368 if msg.err != nil {
369 v.notice = "Could not load more results: " + msg.err.Error()
370 return nil, true
371 }
372 v.searchList.growPostings(msg.postings)
373 if len(msg.postings) == 0 {
374 v.searchNextPage = 0
375 } else {
376 v.searchNextPage = msg.nextPage
377 }
378 return v.loadMoreSearchResults(), true
379
380 case topicLoadedMsg:
381 if msg.requestID != v.activeRequestID || msg.boxID != v.currentBoxID() {
382 return nil, true
383 }
384 v.finishRequest(msg.requestID)
385 if msg.err != nil {
386 return func() tea.Msg { return errMsg{msg.err} }, true
387 }
388 v.inThread = true
389 v.topicID = msg.topicID
390 v.topicName = msg.title
391 v.entries = msg.entries
392 v.attachments = msg.attachments
393 v.attachmentCursor = 0
394 var imageContent strings.Builder
395 var uploadCmds []tea.Cmd
396 for _, imgData := range msg.images {
397 rendered := v.vc.imageRenderer.render(imgData, nextImageID(), v.vc.width-4)
398 if rendered.content != "" {
399 imageContent.WriteString("\n\n")
400 imageContent.WriteString(rendered.content)
401 }

Callers 2

openSelectedMethod · 0.95
handlePostingActionMethod · 0.95

Calls 3

ParseTopicEntriesHTMLFunction · 0.92
extractImageURLsFunction · 0.85
fetchImageDataFunction · 0.85

Tested by

no test coverage detected