]> Sergey Matveev's repositories - mmc.git/commitdiff
netstring library adds spaces now
authorSergey Matveev <stargrave@stargrave.org>
Tue, 14 Mar 2023 15:24:33 +0000 (18:24 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 14 Mar 2023 15:24:33 +0000 (18:24 +0300)
common.go
go.mod
go.sum

index 6a9b385ccae8904871dfc38abbbede0d1b52d01d..e0e2b3eb5fb6c932c1d9a4bfdf802a4f90e0fea1 100644 (file)
--- a/common.go
+++ b/common.go
@@ -74,13 +74,7 @@ func PostToRec(w *recfile.Writer, users map[string]*model.User, post Post) error
        if _, err = w.WriteFields(fields...); err != nil {
                return err
        }
-       lines := strings.Split(post.P.Message, "\n")
-       for i, line := range lines {
-               if strings.HasSuffix(line, "\\") {
-                       lines[i] += " "
-               }
-       }
-       _, err = w.WriteFieldMultiline("Text", lines)
+       _, err = w.WriteFieldMultiline("Text", strings.Split(post.P.Message, "\n"))
        return err
 }
 
diff --git a/go.mod b/go.mod
index ce1cdedaf99d1f5cdc6d340554bf00fe4275ee9d..58f5f3f89e2bd5a9b599b8b7b31d551934c867a8 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -6,7 +6,7 @@ require (
        github.com/davecgh/go-spew v1.1.1
        github.com/fsnotify/fsnotify v1.6.0
        github.com/mattermost/mattermost-server/v6 v6.7.2
-       go.cypherpunks.ru/recfile v0.6.0
+       go.cypherpunks.ru/recfile v0.7.0
        golang.org/x/sys v0.6.0
 )
 
diff --git a/go.sum b/go.sum
index 5c8a0ec0eaf6ed4e3161f78b7bf06a784c781ff1..f8809dc145dcdba1d7e728d45a464aba2b06e85b 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -1352,8 +1352,8 @@ github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPS
 github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg=
 github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
 gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b/go.mod h1:T3BPAOm2cqquPa0MKWeNkmOM5RQsRhkrwMWonFMN7fE=
-go.cypherpunks.ru/recfile v0.6.0 h1:cAoiaPhcVOjdTUmQ4nr4PNJ0IPJM9veOJGUjFm+k5zc=
-go.cypherpunks.ru/recfile v0.6.0/go.mod h1:sR+KajB+vzofL3SFVFwKt3Fke0FaCcN1g3YPNAhU3qI=
+go.cypherpunks.ru/recfile v0.7.0 h1:0R1UnDGKccp7JnC66msslJMlSY02jHx/XkW+ISl0GuY=
+go.cypherpunks.ru/recfile v0.7.0/go.mod h1:sR+KajB+vzofL3SFVFwKt3Fke0FaCcN1g3YPNAhU3qI=
 go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
 go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
 go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=