From 4dacd8311d8a18c0f076629417299f8cb8c15316 Mon Sep 17 00:00:00 2001
From: Jake Taylor <jake@elixxir.io>
Date: Wed, 1 Mar 2023 12:49:11 -0600
Subject: [PATCH] fixed buildmessage

---
 indexedDb/impl/dm/implementation.go | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/indexedDb/impl/dm/implementation.go b/indexedDb/impl/dm/implementation.go
index df604194..d497e77c 100644
--- a/indexedDb/impl/dm/implementation.go
+++ b/indexedDb/impl/dm/implementation.go
@@ -79,15 +79,15 @@ func (w *wasmModel) joinConversation(nickname string,
 // NOTE: ID is not set inside this function because we want to use the
 // autoincrement key by default. If you are trying to overwrite an existing
 // message, then you need to set it manually yourself.
-func buildMessage(messageID, parentID, text []byte, pubKey ed25519.PublicKey,
-	timestamp time.Time, round id.Round, mType dm.MessageType,
-	codeset uint8, status dm.Status) *Message {
+func buildMessage(messageID, parentID, text []byte, partnerKey,
+	senderKey ed25519.PublicKey, timestamp time.Time, round id.Round,
+	mType dm.MessageType, codeset uint8, status dm.Status) *Message {
 	return &Message{
 		MessageID:          messageID,
-		ConversationPubKey: pubKey,
+		ConversationPubKey: partnerKey[:],
 		ParentMessageID:    parentID,
 		Timestamp:          timestamp,
-		SenderPubKey:       pubKey[:],
+		SenderPubKey:       senderKey[:],
 		Status:             uint8(status),
 		CodesetVersion:     codeset,
 		Text:               text,
@@ -254,7 +254,7 @@ func (w *wasmModel) receiveWrapper(messageID message.ID, parentID *message.ID, n
 	}
 
 	msgToInsert := buildMessage(messageID.Bytes(), parentIdBytes, textBytes,
-		senderKey, timestamp, round.ID, mType, codeset, status)
+		partnerKey, senderKey, timestamp, round.ID, mType, codeset, status)
 
 	uuid, err := w.receiveHelper(msgToInsert, false)
 	if err != nil {
-- 
GitLab