MCPcopy Create free account
hub / github.com/B33pBeeps/redthread / Connect

Method Connect

internal/app/notes.go:495–512  ·  view source on GitHub ↗
(fromID, toID string)

Source from the content-addressed store, hash-verified

493}
494
495func (b *Board) Connect(fromID, toID string) *StringConn {
496 if fromID == toID || fromID == "" || toID == "" {
497 return nil
498 }
499 for _, s := range b.Strings {
500 if (s.A.NoteID == fromID && s.B.NoteID == toID) ||
501 (s.A.NoteID == toID && s.B.NoteID == fromID) {
502 return s
503 }
504 }
505 s := &StringConn{
506 A: StringEnd{NoteID: fromID},
507 B: StringEnd{NoteID: toID},
508 Tight: false,
509 }
510 b.Strings = append(b.Strings, s)
511 return s
512}
513
514// ConnectToWall creates a string from a note to a WORLD-coord wall-pin.
515// The caller is responsible for converting a mouse click (screen) to

Callers 3

seedBoardFunction · 0.95
commitPullAtMethod · 0.80
handleMouseMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected