Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xxdk-wasm
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
xxdk-wasm
Commits
43323445
Commit
43323445
authored
2 years ago
by
Jono Wenger
Browse files
Options
Downloads
Patches
Plain Diff
interface{} to any
parent
92f4db6c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!60
Revert "Fail a test to be sure it works"
,
!32
Admin Commands
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wasm/channels.go
+11
-10
11 additions, 10 deletions
wasm/channels.go
with
11 additions
and
10 deletions
wasm/channels.go
+
11
−
10
View file @
43323445
...
...
@@ -576,7 +576,7 @@ func GenerateChannel(_ js.Value, args []js.Value) any {
// (Uint8Array).
// - Throws a TypeError if there is no channel private key for the given
// channel or if encrypting the key fails.
func
GetSavedChannelPrivateKey
(
_
js
.
Value
,
args
[]
js
.
Value
)
interface
{}
{
func
GetSavedChannelPrivateKey
(
_
js
.
Value
,
args
[]
js
.
Value
)
any
{
cmixID
:=
args
[
0
]
.
Int
()
channelIdBytes
:=
utils
.
CopyBytesToGo
(
args
[
1
])
password
:=
args
[
2
]
.
String
()
...
...
@@ -602,7 +602,7 @@ func GetSavedChannelPrivateKey(_ js.Value, args []js.Value) interface{} {
// Returns:
// - Throws a TypeError if decryption the private key or saving it to storage
// fails.
func
ImportChannelPrivateKey
(
_
js
.
Value
,
args
[]
js
.
Value
)
interface
{}
{
func
ImportChannelPrivateKey
(
_
js
.
Value
,
args
[]
js
.
Value
)
any
{
cmixID
:=
args
[
0
]
.
Int
()
password
:=
args
[
1
]
.
String
()
encryptedPrivKey
:=
utils
.
CopyBytesToGo
(
args
[
2
])
...
...
@@ -1145,14 +1145,14 @@ func (ch *ChannelsManager) SendReaction(_ js.Value, args []js.Value) any {
// Returns:
// - Resolves to the JSON of [bindings.ChannelSendReport] (Uint8Array).
// - Rejected with an error if sending fails.
func
(
ch
*
ChannelsManager
)
DeleteMessage
(
_
js
.
Value
,
args
[]
js
.
Value
)
interface
{}
{
func
(
ch
*
ChannelsManager
)
DeleteMessage
(
_
js
.
Value
,
args
[]
js
.
Value
)
any
{
adminPrivateKey
:=
utils
.
CopyBytesToGo
(
args
[
0
])
channelIdBytes
:=
utils
.
CopyBytesToGo
(
args
[
1
])
targetMessageIdBytes
:=
utils
.
CopyBytesToGo
(
args
[
2
])
undoAction
:=
args
[
3
]
.
Bool
()
cmixParamsJSON
:=
utils
.
CopyBytesToGo
(
args
[
4
])
promiseFn
:=
func
(
resolve
,
reject
func
(
args
...
interface
{}
)
js
.
Value
)
{
promiseFn
:=
func
(
resolve
,
reject
func
(
args
...
any
)
js
.
Value
)
{
sendReport
,
err
:=
ch
.
api
.
DeleteMessage
(
adminPrivateKey
,
channelIdBytes
,
targetMessageIdBytes
,
undoAction
,
cmixParamsJSON
)
if
err
!=
nil
{
...
...
@@ -1183,14 +1183,14 @@ func (ch *ChannelsManager) DeleteMessage(_ js.Value, args []js.Value) interface{
//
// Returns:
// - []byte - JSON of [ChannelSendReport].
func
(
ch
*
ChannelsManager
)
PinMessage
(
_
js
.
Value
,
args
[]
js
.
Value
)
interface
{}
{
func
(
ch
*
ChannelsManager
)
PinMessage
(
_
js
.
Value
,
args
[]
js
.
Value
)
any
{
adminPrivateKey
:=
utils
.
CopyBytesToGo
(
args
[
0
])
channelIdBytes
:=
utils
.
CopyBytesToGo
(
args
[
1
])
targetMessageIdBytes
:=
utils
.
CopyBytesToGo
(
args
[
2
])
undoAction
:=
args
[
3
]
.
Bool
()
cmixParamsJSON
:=
utils
.
CopyBytesToGo
(
args
[
4
])
promiseFn
:=
func
(
resolve
,
reject
func
(
args
...
interface
{}
)
js
.
Value
)
{
promiseFn
:=
func
(
resolve
,
reject
func
(
args
...
any
)
js
.
Value
)
{
sendReport
,
err
:=
ch
.
api
.
PinMessage
(
adminPrivateKey
,
channelIdBytes
,
targetMessageIdBytes
,
undoAction
,
cmixParamsJSON
)
if
err
!=
nil
{
...
...
@@ -1221,14 +1221,14 @@ func (ch *ChannelsManager) PinMessage(_ js.Value, args []js.Value) interface{} {
//
// Returns:
// - []byte - JSON of [ChannelSendReport].
func
(
ch
*
ChannelsManager
)
MuteUser
(
_
js
.
Value
,
args
[]
js
.
Value
)
interface
{}
{
func
(
ch
*
ChannelsManager
)
MuteUser
(
_
js
.
Value
,
args
[]
js
.
Value
)
any
{
adminPrivateKey
:=
utils
.
CopyBytesToGo
(
args
[
0
])
channelIdBytes
:=
utils
.
CopyBytesToGo
(
args
[
1
])
mutedUserPubKeyBytes
:=
utils
.
CopyBytesToGo
(
args
[
2
])
undoAction
:=
args
[
3
]
.
Bool
()
cmixParamsJSON
:=
utils
.
CopyBytesToGo
(
args
[
4
])
promiseFn
:=
func
(
resolve
,
reject
func
(
args
...
interface
{}
)
js
.
Value
)
{
promiseFn
:=
func
(
resolve
,
reject
func
(
args
...
any
)
js
.
Value
)
{
sendReport
,
err
:=
ch
.
api
.
MuteUser
(
adminPrivateKey
,
channelIdBytes
,
mutedUserPubKeyBytes
,
undoAction
,
cmixParamsJSON
)
if
err
!=
nil
{
...
...
@@ -1370,7 +1370,7 @@ func IsNicknameValid(_ js.Value, args []js.Value) any {
// - Returns true if the user is muted in the channel and false otherwise
// (boolean).
// - Throws a TypeError if the channel ID cannot be unmarshalled.
func
(
ch
*
ChannelsManager
)
Muted
(
_
js
.
Value
,
args
[]
js
.
Value
)
interface
{}
{
func
(
ch
*
ChannelsManager
)
Muted
(
_
js
.
Value
,
args
[]
js
.
Value
)
any
{
channelIDBytes
:=
utils
.
CopyBytesToGo
(
args
[
0
])
muted
,
err
:=
ch
.
api
.
Muted
(
channelIDBytes
)
...
...
@@ -1622,7 +1622,8 @@ func (em *eventModel) UpdateFromUUID(uuid int64, messageUpdateInfoJSON []byte) {
// Returns:
// - A non-negative unique uuid for the modified message by which it can be
// referenced later with [EventModel.UpdateFromUUID] int).
func
(
em
*
eventModel
)
UpdateFromMessageID
(
messageID
[]
byte
,
messageUpdateInfoJSON
[]
byte
)
int64
{
func
(
em
*
eventModel
)
UpdateFromMessageID
(
messageID
[]
byte
,
messageUpdateInfoJSON
[]
byte
)
int64
{
return
int64
(
em
.
updateFromMessageID
(
utils
.
CopyBytesToJS
(
messageID
),
utils
.
CopyBytesToJS
(
messageUpdateInfoJSON
))
.
Int
())
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment