X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/f2d227db9c3b556c7b0e1cfe735ccc54311850e5..b2873a2a0bf8b0ba648aebac51759e5fed89a2e2:/memory.go diff --git a/memory.go b/memory.go index 792fe21..a3665a1 100644 --- a/memory.go +++ b/memory.go @@ -543,6 +543,15 @@ func (m *Memory) View() string { return m.chat.Render() } +// ViewLines returns the lines of the chat view, each with its newline, without +// the leaf lines of the messages in skip. +func (m *Memory) ViewLines(skip map[int]bool) []string { + m.mutex.Lock() + defer m.mutex.Unlock() + + return m.chat.LinesWithout(skip) +} + // Len returns the number of messages in the log. func (m *Memory) Len() int { m.mutex.Lock()