From f725f95def3f9a74d3c7cce483b97074a65a6cdd Mon Sep 17 00:00:00 2001
From: "Richard T. Carback III" <rick.carback@gmail.com>
Date: Thu, 1 Jun 2023 19:21:45 +0000
Subject: [PATCH] Fix bug with GetChannelNotificationReportsForMe

---
 go.mod           | 2 +-
 go.sum           | 2 ++
 main.go          | 6 ++----
 wasm/channels.go | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/go.mod b/go.mod
index f9d3c9ba..9afb4df0 100644
--- a/go.mod
+++ b/go.mod
@@ -9,7 +9,7 @@ require (
 	github.com/spf13/cobra v1.7.0
 	github.com/spf13/jwalterweatherman v1.1.0
 	github.com/stretchr/testify v1.8.2
-	gitlab.com/elixxir/client/v4 v4.6.4-0.20230531224642-b24cd3f5e4a4
+	gitlab.com/elixxir/client/v4 v4.6.4-0.20230601191407-1b0289b33708
 	gitlab.com/elixxir/crypto v0.0.7-0.20230522162218-45433d877235
 	gitlab.com/elixxir/primitives v0.0.3-0.20230214180039-9a25e2d3969c
 	gitlab.com/elixxir/wasm-utils v0.0.0-20230522231408-a43b2c1481b2
diff --git a/go.sum b/go.sum
index 4734b30b..73f80ff8 100644
--- a/go.sum
+++ b/go.sum
@@ -543,6 +543,8 @@ gitlab.com/elixxir/client/v4 v4.6.4-0.20230531212217-e21b55fbf23c h1:6OTyW9U/ntZ
 gitlab.com/elixxir/client/v4 v4.6.4-0.20230531212217-e21b55fbf23c/go.mod h1:fegbuF1/6a+H3QgsoMG8teLnyuKtDxkELMw8pn5WlZ8=
 gitlab.com/elixxir/client/v4 v4.6.4-0.20230531224642-b24cd3f5e4a4 h1:YacWU7IJUfixfZyckdXEWPwhix7sq+STK+8Vz8DzVO4=
 gitlab.com/elixxir/client/v4 v4.6.4-0.20230531224642-b24cd3f5e4a4/go.mod h1:fegbuF1/6a+H3QgsoMG8teLnyuKtDxkELMw8pn5WlZ8=
+gitlab.com/elixxir/client/v4 v4.6.4-0.20230601191407-1b0289b33708 h1:wNIKci4XuDfzAJM8+4awP5CgY0jlOEaVbHgp+BkEtz4=
+gitlab.com/elixxir/client/v4 v4.6.4-0.20230601191407-1b0289b33708/go.mod h1:fegbuF1/6a+H3QgsoMG8teLnyuKtDxkELMw8pn5WlZ8=
 gitlab.com/elixxir/comms v0.0.4-0.20230519211512-4a998f4b0938 h1:f27+QUFiGWrprKm+fstOg3ABkYLpWcZi3+8Lf5eDnqY=
 gitlab.com/elixxir/comms v0.0.4-0.20230519211512-4a998f4b0938/go.mod h1:z+qW0D9VpY5QKTd7wRlb5SK4kBNqLYsa4DXBcUXue9Q=
 gitlab.com/elixxir/crypto v0.0.7-0.20230522162218-45433d877235 h1:0BySdXTzRWxzH8k5RiNNMmmn2lpuQWLVcDDA/7ehyqc=
diff --git a/main.go b/main.go
index 9bf2a059..5315e373 100644
--- a/main.go
+++ b/main.go
@@ -132,14 +132,12 @@ func setGlobals() {
 	js.Global().Set("GetShareUrlType", js.FuncOf(wasm.GetShareUrlType))
 	js.Global().Set("ValidForever", js.FuncOf(wasm.ValidForever))
 	js.Global().Set("IsNicknameValid", js.FuncOf(wasm.IsNicknameValid))
-	js.Global().Set("GetNotificationReportsForMe",
-		js.FuncOf(wasm.GetNotificationReportsForMe))
+	js.Global().Set("GetChannelNotificationReportsForMe",
+		js.FuncOf(wasm.GetChannelNotificationReportsForMe))
 	js.Global().Set("GetNoMessageErr", js.FuncOf(wasm.GetNoMessageErr))
 	js.Global().Set("CheckNoMessageErr", js.FuncOf(wasm.CheckNoMessageErr))
 	js.Global().Set("NewChannelsDatabaseCipher",
 		js.FuncOf(wasm.NewChannelsDatabaseCipher))
-	js.Global().Set("GetNotificationReportsForMe",
-		js.FuncOf(wasm.GetNotificationReportsForMe))
 
 	// wasm/dm.go
 	js.Global().Set("InitChannelsFileTransfer",
diff --git a/wasm/channels.go b/wasm/channels.go
index eb5c571d..13562a20 100644
--- a/wasm/channels.go
+++ b/wasm/channels.go
@@ -1708,11 +1708,11 @@ func (cm *ChannelsManager) SetMobileNotificationsLevel(_ js.Value, args []js.Val
 // Returns:
 //   - The JSON of a slice of [channels.NotificationReport] (Uint8Array).
 //   - Throws an error if getting the report fails.
-func GetNotificationReportsForMe(_ js.Value, args []js.Value) any {
+func GetChannelNotificationReportsForMe(_ js.Value, args []js.Value) any {
 	notificationFilterJSON := utils.CopyBytesToGo(args[0])
 	notificationDataJSON := utils.CopyBytesToGo(args[1])
 
-	report, err := bindings.GetNotificationReportsForMe(
+	report, err := bindings.GetChannelNotificationReportsForMe(
 		notificationFilterJSON, notificationDataJSON)
 	if err != nil {
 		exception.ThrowTrace(err)
-- 
GitLab