Fix some bugs

This commit is contained in:
mcrakhman committed 2022-07-06 23:35:43 +02:00
1 parent a09e7ca1cb
commit 906d2b6614
4 files changed
+18 -7

No files matched your search

@@ -120,3 +120,4 @@ graph:
maybeHeads:
- A.1.3
- B.1.2
+7 -5
View File
@@ -25,11 +25,13 @@ type Keychain struct {
func NewKeychain() *Keychain {
return &Keychain{
SigningKeys: map[string]threadmodels.SigningPrivKey{},
EncryptionKeys: map[string]threadmodels.EncryptionPrivKey{},
GeneratedIdentities: map[string]string{},
ReadKeys: map[string]*SymKey{},
coder: threadmodels.NewEd25519Decoder(),
SigningKeys: map[string]threadmodels.SigningPrivKey{},
SigningKeysByIdentity: map[string]threadmodels.SigningPrivKey{},
EncryptionKeys: map[string]threadmodels.EncryptionPrivKey{},
GeneratedIdentities: map[string]string{},
ReadKeys: map[string]*SymKey{},
ReadKeysByHash: map[uint64]*SymKey{},
coder: threadmodels.NewEd25519Decoder(),
}
}
+9 -1
View File
@@ -9,6 +9,8 @@ package threadbuilder
import (
"fmt"
"github.com/anytypeio/go-anytype-infrastructure-experiments/data/pb"
"github.com/gogo/protobuf/proto"
"strings"
"unicode"
@@ -42,7 +44,13 @@ func (t *ThreadBuilder) Graph() (string, error) {
var chSymbs []string
if r.changesDataDecrypted != nil {
for _, chc := range r.changesDataDecrypted.Content {
res := &pb.PlainTextChangeData{}
err := proto.Unmarshal(r.changesDataDecrypted, res)
if err != nil {
return err
}
for _, chc := range res.Content {
tp := fmt.Sprintf("%T", chc.Value)
tp = strings.Replace(tp, "ChangeContentValueOf", "", 1)
res := ""