// Render thread repost of a deleted thread. package main import ( "std" "testing" boards2 "gno.land/r/gnoland/boards2/v1" ) const ( owner = std.Address("g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq") // @devx srcBoardName = "BoardName" dstBoardName = "BoardName2" ) var repostThreadID boards2.PostID func init() { testing.SetRealm(std.NewUserRealm(owner)) // Create a board and a thread boardID := boards2.CreateBoard(cross, srcBoardName, false) threadID := boards2.CreateThread(cross, boardID, "Foo", "Body") // Repost thread into a different board dstBoardID := boards2.CreateBoard(cross, dstBoardName, false) repostThreadID = boards2.CreateRepost(cross, boardID, threadID, "Bar", "Body2", dstBoardID) // Remove the original thread boards2.DeleteThread(cross, boardID, threadID) } func main() { path := dstBoardName + "/" + repostThreadID.String() println(boards2.Render(path)) } // Output: // # Bar // // > *⚠ Source post has been deleted* // > // Body2 // // Created by [g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq](/u/g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq) on 2009-02-13 11:31pm UTC // [Flag](/r/gnoland/boards2/v1$help&func=FlagThread&boardID=2&reason=&threadID=1) • [Repost](/r/gnoland/boards2/v1$help&func=CreateRepost&boardID=2&body=&destinationBoardID=&threadID=1&title=) • [Reply](/r/gnoland/boards2/v1$help&func=CreateReply&boardID=2&body=&replyID=0&threadID=1) • [Edit](/r/gnoland/boards2/v1$help&func=EditThread&boardID=2&body=Body2&threadID=1&title=Bar) • [Delete](/r/gnoland/boards2/v1$help&func=DeleteThread&boardID=2&threadID=1)