From 314d902b3d04392b93c06c34bc5df8c2d5a2559e Mon Sep 17 00:00:00 2001 From: Jono Wenger <jono@elixxir.io> Date: Thu, 1 Dec 2022 14:47:36 -0800 Subject: [PATCH] Fix channel comments --- go.mod | 2 +- go.sum | 4 ++-- wasm/channels.go | 21 ++++++++++++--------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 6378a932..a98aabed 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/hack-pad/go-indexeddb v0.2.0 github.com/pkg/errors v0.9.1 github.com/spf13/jwalterweatherman v1.1.0 - gitlab.com/elixxir/client/v4 v4.3.9-0.20221122010204-41d091b9b031 + gitlab.com/elixxir/client/v4 v4.3.9-0.20221201224548-883cf51c4d60 gitlab.com/elixxir/crypto v0.0.7-0.20221121233335-83f145891bc7 gitlab.com/elixxir/primitives v0.0.3-0.20221114231218-cc461261a6af gitlab.com/xx_network/crypto v0.0.5-0.20221121220724-8eefdbb0eb46 diff --git a/go.sum b/go.sum index 02cf1955..a23124be 100644 --- a/go.sum +++ b/go.sum @@ -369,8 +369,8 @@ github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo= github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4= gitlab.com/elixxir/bloomfilter v0.0.0-20211222005329-7d931ceead6f h1:yXGvNBqzZwAhDYlSnxPRbgor6JWoOt1Z7s3z1O9JR40= gitlab.com/elixxir/bloomfilter v0.0.0-20211222005329-7d931ceead6f/go.mod h1:H6jztdm0k+wEV2QGK/KYA+MY9nj9Zzatux/qIvDDv3k= -gitlab.com/elixxir/client/v4 v4.3.9-0.20221122010204-41d091b9b031 h1:p4EkUqPNSwC6cbCd2ulqyH7J5M+ZGXmWeLDNuF+wa0M= -gitlab.com/elixxir/client/v4 v4.3.9-0.20221122010204-41d091b9b031/go.mod h1:e2EC5b3ucHaVeR9DjGcoKNnDBbVPPPG2dHtpPGDrFhM= +gitlab.com/elixxir/client/v4 v4.3.9-0.20221201224548-883cf51c4d60 h1:fZLbgqE4Lskkao4MQzxCBGVN+GuJfBy7/BtxG/xkaTw= +gitlab.com/elixxir/client/v4 v4.3.9-0.20221201224548-883cf51c4d60/go.mod h1:e2EC5b3ucHaVeR9DjGcoKNnDBbVPPPG2dHtpPGDrFhM= gitlab.com/elixxir/comms v0.0.4-0.20221110181420-84bca6216fe4 h1:bLRjVCyMVde4n2hTVgoyyIAWrKI4CevpChchkPeb6A0= gitlab.com/elixxir/comms v0.0.4-0.20221110181420-84bca6216fe4/go.mod h1:XhI2/CMng+xcH3mAs+1aPz29PSNu1079XMJ8V+xxihw= gitlab.com/elixxir/crypto v0.0.7-0.20221121233335-83f145891bc7 h1:yhc8jQ27JKypdRE41NpfJPaYRS0sNkOwugaIyoscDiU= diff --git a/wasm/channels.go b/wasm/channels.go index 7f89277f..e9d0137b 100644 --- a/wasm/channels.go +++ b/wasm/channels.go @@ -1125,11 +1125,13 @@ func (ch *ChannelsManager) SendReaction(_ js.Value, args []js.Value) any { return utils.CreatePromise(promiseFn) } -// DeleteMessage is used to send a reaction to a message over a channel. The -// reaction must be a single emoji with no other characters, and will be -// rejected otherwise. +// DeleteMessage deletes the targeted message from user's view. Users may delete +// their own messages (by leaving the private key as nil) but only the channel +// admin can delete other user's messages. // -// Users will drop the reaction if they do not recognize the reactTo message. +// If undoAction is true, then the targeted message is un-deleted. +// +// Clients will drop the deletion if they do not recognize the target message. // // Parameters: // - args[0] - The PEM-encoded admin RSA private key for the channel @@ -1165,9 +1167,10 @@ func (ch *ChannelsManager) DeleteMessage(_ js.Value, args []js.Value) any { return utils.CreatePromise(promiseFn) } -// PinMessage pins the target message to the top of a channel view for all -// users in the specified channel. Only the channel admin can pin user -// messages. +// PinMessage pins the target message to the top of a channel view for all users +// in the specified channel. Only the channel admin can pin user messages. +// +// If undoAction is true, then the targeted message is unpinned. // // Clients will drop the pin if they do not recognize the target message. // @@ -1177,7 +1180,7 @@ func (ch *ChannelsManager) DeleteMessage(_ js.Value, args []js.Value) any { // - args[1] - Marshalled bytes of channel [id.ID] (Uint8Array). // - args[2] - The marshalled [channel.MessageID] of the message you want to // pin (Uint8Array). -// - args[3] - Set to true to un-delete the message (boolean). +// - args[3] - Set to true to unpin the message (boolean). // - args[4] - JSON of [xxdk.CMIXParams]. This may be empty, and // [GetDefaultCMixParams] will be used internally (Uint8Array). // @@ -1215,7 +1218,7 @@ func (ch *ChannelsManager) PinMessage(_ js.Value, args []js.Value) any { // - args[1] - Marshalled bytes of channel [id.ID] (Uint8Array). // - mutedUserPubKeyBytes - The [ed25519.PublicKey] of the user you want to // mute. -// - args[3] - Set to true to un-delete the message (boolean). +// - args[3] - Set to true to unmute the message (boolean). // - args[4] - JSON of [xxdk.CMIXParams]. This may be empty, and // [GetDefaultCMixParams] will be used internally (Uint8Array). // -- GitLab