39 views
Arbor Sync 2020-03-05 === ## Updates - ~whereswaldon - `wisteria` has gained mouse support for panning and selecting messages - I proposed a talk at [SELF](https://southeastlinuxfest.org/) about Arbor - I practiced `gio` by making a simple (kinda bad) game [here](https://git.sr.ht/~whereswaldon/pointstar) - ~athorp96 - Working on a [patchset](https://lists.sr.ht/~whereswaldon/arbor-dev/patches/9935) to add support for creating nodes with custom metadata using [`forest`](https://git.sr.ht/~whereswaldon/forest-go/tree/master/cmd/forest/main.go) - Elizabeth - Explored a [possible design](https://www.figma.com/file/ao6MEVlPaHjHUgx5jRGyxQ/Arbor-Chat?node-id=0%3A1) - ~amolith - Found an [interesting meeting platform option](https://bigbluebutton.org/) - open source - self hostable - voip with echo cancellation - video - virtual whiteboard ## Q & A ## Working session? Pick up a thing from [here](https://todo.sr.ht/~whereswaldon/arbor-dev?search=label:%22release-blocker%22) or choose a problem that you see in Arbor and want to solve. Or, pair up with someone else to help them! If you want, write what you're doing below so that we can all have context and help one another! whereswaldon: https://todo.sr.ht/~whereswaldon/arbor-dev/111 ```diff diff --git a/history_widget.go b/history_widget.go index 6d8b04f..901e6a3 100644 --- a/history_widget.go +++ b/history_widget.go @@ -66,7 +66,6 @@ type HistoryWidget struct { *HistoryView *CellView *wistTcell.Application - *forest.Builder *Config *notificator.Notificator *EditRequestMap @@ -84,15 +83,10 @@ func NewHistoryWidget(app *wistTcell.Application, archive *archive.Archive, conf cv.MakeCursorVisible() hv.SelectLastLine() - builder, err := config.Builder(archive) - if err != nil { - return nil, fmt.Errorf("failed creating node builder for widget: %w", err) - } return &HistoryWidget{ HistoryView: hv, CellView: cv, Application: app, - Builder: builder, Config: config, Notificator: notifier, EditRequestMap: NewEditRequestMap(), @@ -267,6 +261,14 @@ func (v *HistoryWidget) FinishReply(parent forest.Node, replyFileName string, ed } } +func (v *HistoryWidget) NewReply(parent interface{}, content string, metadata []byte) (forest.Node, error) { + builder, err := v.Config.Builder(v.Archive) + if err != nil { + return nil, fmt.Errorf("couldn't construct node builder: %w", err) + } + return builder.NewReply(parent, content, metadata) +} + // FinishReplyString writes the content provided as the content of a new forest // node into the store. func (v *HistoryWidget) FinishReplyString(parent forest.Node, content string) error { ``` ```go package main import ( "fmt" ) func main() { var x []int x = []int{1,2,3} fmt.Printf("%v\n", x) fmt.Println(len(x)) fmt.Println(x == nil) x = nil fmt.Printf("%v\n", x) fmt.Println(len(x)) fmt.Println(x == nil) x = append(x, 4, 5, 6) fmt.Printf("%v\n", x) fmt.Println(len(x)) fmt.Println(x == nil) x = []int{} fmt.Printf("%v\n", x) fmt.Println(len(x)) fmt.Println(x == nil) } ```