diff --git a/protocol/communities/manager.go b/protocol/communities/manager.go index 715e46b09..470e2a268 100644 --- a/protocol/communities/manager.go +++ b/protocol/communities/manager.go @@ -6,7 +6,6 @@ import ( "crypto/ecdsa" "database/sql" "encoding/hex" - "encoding/json" "fmt" "io/ioutil" "net" @@ -5428,12 +5427,11 @@ func (m *Manager) encryptCommunityDescriptionImpl(groupID []byte, d *protobuf.Co return "", nil, err } - communityJSON, err := json.Marshal(d) - if err != nil { - return "", nil, err - } + m.logger.Debug("encrypting community description", + zap.Any("community", d), + zap.String("groupID", types.Bytes2Hex(groupID)), + zap.String("keyID", types.Bytes2Hex(keyID))) - m.logger.Debug("encrypting community description", zap.String("community", string(communityJSON)), zap.String("groupID", types.Bytes2Hex(groupID)), zap.String("key-id", types.Bytes2Hex(keyID))) keyIDSeqNo := fmt.Sprintf("%s%d", hex.EncodeToString(keyID), newSeqNo) return keyIDSeqNo, encryptedPayload, nil diff --git a/protocol/messenger_communities.go b/protocol/messenger_communities.go index 68d5fa5af..99623e0b3 100644 --- a/protocol/messenger_communities.go +++ b/protocol/messenger_communities.go @@ -109,11 +109,12 @@ func (m *Messenger) publishOrg(org *communities.Community, shouldRekey bool) err return nil } - communityJSON, err := json.Marshal(org) - if err != nil { - return err - } - m.logger.Debug("publishing org", zap.String("org-id", org.IDString()), zap.Uint64("clock", org.Clock()), zap.String("org", string(communityJSON))) + m.logger.Debug("publishing community", + zap.Uint64("clock", org.Clock()), + zap.String("communityID", org.IDString()), + zap.Any("community", org), + ) + payload, err := org.MarshaledDescription() if err != nil {