diff options
Diffstat (limited to 'helpers.go')
| -rw-r--r-- | helpers.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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)) +} |
