summaryrefslogtreecommitdiff
path: root/dscuss.go
diff options
context:
space:
mode:
authorVitaly Minko <vitaly.minko@gmail.com>2018-09-01 15:10:08 +0300
committerVitaly Minko <vitaly.minko@gmail.com>2018-09-01 15:10:08 +0300
commit521ffe0e4f75e4d1070ec29edc8b6976125f8961 (patch)
tree1be68a932a5f53948b44db37200e6527ac95ff1d /dscuss.go
parent569537522c5e920dab786ba2f1fadabdb06d9c2d (diff)
Implemented lsboard command.
Diffstat (limited to 'dscuss.go')
-rw-r--r--dscuss.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/dscuss.go b/dscuss.go
index 29e6af1..a8d6c39 100644
--- a/dscuss.go
+++ b/dscuss.go
@@ -202,6 +202,18 @@ func NewThread(subj string, text string) *entity.Message {
return
}*/
-func SendMessage(m *entity.Message) {
+func PostMessage(m *entity.Message) error {
+ err := stor.PutMessage(m, nil)
+ if err != nil {
+ log.Errorf("Failed to post message '%s': %v", m.Desc(), err)
+ return err
+ }
+ return nil
+}
+func ListBoard(offset, limit int) ([]*entity.Message, error) {
+ if offset < 0 || limit < 0 {
+ return nil, errors.WrongArguments
+ }
+ return stor.GetRootMessages(offset, limit)
}