summaryrefslogtreecommitdiff
path: root/helpers.go
diff options
context:
space:
mode:
Diffstat (limited to 'helpers.go')
-rw-r--r--helpers.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/helpers.go b/helpers.go
index 5385944..35acf88 100644
--- a/helpers.go
+++ b/helpers.go
@@ -93,3 +93,11 @@ func (x *Chats) AppendNew(y *Chat) {
x.Chats = append(x.Chats, chat)
}
+
+// a Append() shortcut (that does Clone() with a mutex) notsure if it really works
+func (x *Chat) AppendEntry(y *ChatEntry) {
+ x.Lock()
+ defer x.Unlock()
+
+ x.Entries = append(x.Entries, proto.Clone(y).(*ChatEntry))
+}