X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/f2d227db9c3b556c7b0e1cfe735ccc54311850e5..97729fc59a2fbd73e3f8a424cae4c825f5ba885b:/memory.go?ds=inline 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()