Skip to content
Snippets Groups Projects
Commit c5c73df2 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Print debug info when calling the send functions

parent dc00bc58
No related branches found
No related tags found
1 merge request!67fix for latest client release
......@@ -12,9 +12,10 @@ package wasm
import (
"crypto/ed25519"
"encoding/json"
"gitlab.com/elixxir/client/v4/dm"
"syscall/js"
"gitlab.com/elixxir/client/v4/dm"
indexDB "gitlab.com/elixxir/xxdk-wasm/indexedDb/worker/dm"
"encoding/base64"
......@@ -22,6 +23,8 @@ import (
"gitlab.com/elixxir/client/v4/bindings"
"gitlab.com/elixxir/crypto/codename"
"gitlab.com/elixxir/xxdk-wasm/utils"
jww "github.com/spf13/jwalterweatherman"
)
////////////////////////////////////////////////////////////////////////////////
......@@ -315,6 +318,10 @@ func (dmc *DMClient) SendText(_ js.Value, args []js.Value) any {
leaseTimeMS := int64(args[3].Int())
cmixParamsJSON := utils.CopyBytesToGo(args[4])
jww.DEBUG.Printf("SendText(%s, %d, %s...)",
base64.RawStdEncoding.EncodeToString(partnerPubKeyBytes)[:8],
partnerToken, message[:10])
promiseFn := func(resolve, reject func(args ...any) js.Value) {
sendReport, err := dmc.api.SendText(partnerPubKeyBytes,
uint32(partnerToken), message, leaseTimeMS,
......@@ -368,6 +375,12 @@ func (dmc *DMClient) SendReply(_ js.Value, args []js.Value) any {
leaseTimeMS := int64(args[4].Int())
cmixParamsJSON := utils.CopyBytesToGo(args[5])
jww.DEBUG.Printf("SendReply(%s, %d, %s: %s...)",
base64.RawStdEncoding.EncodeToString(partnerPubKeyBytes)[:8],
partnerToken,
base64.RawStdEncoding.EncodeToString(replyID),
message[:10])
promiseFn := func(resolve, reject func(args ...any) js.Value) {
sendReport, err := dmc.api.SendReply(partnerPubKeyBytes,
uint32(partnerToken), message, replyID, leaseTimeMS,
......@@ -409,6 +422,12 @@ func (dmc *DMClient) SendReaction(_ js.Value, args []js.Value) any {
message := args[3].String()
cmixParamsJSON := utils.CopyBytesToGo(args[4])
jww.DEBUG.Printf("SendReaction(%s, %d, %s: %s...)",
base64.RawStdEncoding.EncodeToString(partnerPubKeyBytes)[:8],
partnerToken,
base64.RawStdEncoding.EncodeToString(replyID),
message[:10])
promiseFn := func(resolve, reject func(args ...any) js.Value) {
sendReport, err := dmc.api.SendReaction(partnerPubKeyBytes,
uint32(partnerToken), message, replyID,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment