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

Revert "Merge branch 'XX-4476/SendReactionSettableLease' into 'release'"

This reverts commit 2055808a, reversing
changes made to 121f114c.
parent 1ef3d7aa
No related branches found
No related tags found
1 merge request!67fix for latest client release
...@@ -1140,29 +1140,21 @@ func (cm *ChannelsManager) SendReply(_ js.Value, args []js.Value) any { ...@@ -1140,29 +1140,21 @@ func (cm *ChannelsManager) SendReply(_ js.Value, args []js.Value) any {
// your own. Alternatively, if reacting to another user's message, you may // your own. Alternatively, if reacting to another user's message, you may
// retrieve it via the ChannelMessageReceptionCallback registered using // retrieve it via the ChannelMessageReceptionCallback registered using
// RegisterReceiveHandler (Uint8Array). // RegisterReceiveHandler (Uint8Array).
// - args[3] - The lease of the message. This will be how long the // - args[3] - JSON of [xxdk.CMIXParams]. If left empty
// message is available from the network, in milliseconds (int). As per the
// [channels.Manager] documentation, this has different meanings depending
// on the use case. These use cases may be generic enough that they will not
// be enumerated here. Use [ValidForever] to last the max message life.
// - args[4] - JSON of [xxdk.CMIXParams]. If left empty
// [bindings.GetDefaultCMixParams] will be used internally (Uint8Array). // [bindings.GetDefaultCMixParams] will be used internally (Uint8Array).
// //
// Returns a promise: // Returns a promise:
// - Resolves to the JSON of [bindings.ChannelSendReport] (Uint8Array). // - Resolves to the JSON of [bindings.ChannelSendReport] (Uint8Array).
// - Rejected with an error if sending fails. // - Rejected with an error if sending fails.
func (cm *ChannelsManager) SendReaction(_ js.Value, args []js.Value) any { func (cm *ChannelsManager) SendReaction(_ js.Value, args []js.Value) any {
var ( marshalledChanId := utils.CopyBytesToGo(args[0])
marshalledChanId = utils.CopyBytesToGo(args[0]) reaction := args[1].String()
reaction = args[1].String() messageToReactTo := utils.CopyBytesToGo(args[2])
messageToReactTo = utils.CopyBytesToGo(args[2]) cmixParamsJSON := utils.CopyBytesToGo(args[3])
leaseTimeMS = int64(args[3].Int())
cmixParamsJSON = utils.CopyBytesToGo(args[4])
)
promiseFn := func(resolve, reject func(args ...any) js.Value) { promiseFn := func(resolve, reject func(args ...any) js.Value) {
sendReport, err := cm.api.SendReaction(marshalledChanId, reaction, sendReport, err := cm.api.SendReaction(
messageToReactTo, leaseTimeMS, cmixParamsJSON) marshalledChanId, reaction, messageToReactTo, cmixParamsJSON)
if err != nil { if err != nil {
reject(utils.JsTrace(err)) reject(utils.JsTrace(err))
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment