summaryrefslogtreecommitdiff
path: root/dumpchat.go
blob: dbaa3eec8aff1b039d931b52b0e47f9c03b89e0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package main

import (
	"go.wit.com/lib/protobuf/chatpb"
	"go.wit.com/log"
)

func dumpEntry(entry *chatpb.ChatEntry) {
	log.Printf(entry.FormatTEXT())
}

func dumpchat(chat *chatpb.Chat) {
	entries := chat.GetEntries()
	if len(entries) > 0 {
		lastEntry := entries[len(entries)-1]
		dumpEntry(lastEntry)
	}
}