From f7690451e9fde4ff61704e7a3a9b4047adb9b917 Mon Sep 17 00:00:00 2001
From: joshemb <josh@elixxir.io>
Date: Tue, 20 Sep 2022 15:57:36 -0700
Subject: [PATCH] Add more debugs in groupChat

---
 groupChat/send.go | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/groupChat/send.go b/groupChat/send.go
index 5829a3364..5e390d865 100644
--- a/groupChat/send.go
+++ b/groupChat/send.go
@@ -101,6 +101,9 @@ func (m *manager) newMessages(g gs.Group, tag string, msg []byte,
 	rng := m.getRng().GetStream()
 	defer rng.Close()
 
+	// fixme: maybe make internal message here, pass it into
+	//  newCmixMsg and return, instead of making it continuously?
+
 	// Create cMix messages in parallel
 	for _, member := range g.Members {
 		// Do not send to the sender
@@ -166,6 +169,16 @@ func newCmixMsg(g gs.Group, tag string, msg []byte, timestamp time.Time,
 	// Generate internal message
 	payload := setInternalPayload(intlMsg, timestamp, senderId, msg)
 
+	mar, _ := json.Marshal(NewPublicInternalMessage_DeleteThis(intlMsg))
+
+	jww.INFO.Printf("GROUP MSG ID DEBUG (newCmixMsg):"+
+		"senders group ID: %s\n, "+
+		"internalMessage marshal: %s\n"+
+		"internalMessage json: %s\n",
+		g.ID,
+		base64.StdEncoding.EncodeToString(intlMsg.Marshal()),
+		string(mar))
+
 	// Encrypt internal message
 	encryptedPayload := group.Encrypt(key, cmixMsg.Fingerprint, payload)
 
-- 
GitLab