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
c5230220
Commit
c5230220
authored
2 years ago
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
Add docstring comments to new funcs
parent
b6d2b745
No related branches found
No related tags found
2 merge requests
!73
Add bindings to enable DMs
,
!67
fix for latest client release
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wasm/channels.go
+36
-20
36 additions, 20 deletions
wasm/channels.go
with
36 additions
and
20 deletions
wasm/channels.go
+
36
−
20
View file @
c5230220
...
...
@@ -763,26 +763,6 @@ func (cm *ChannelsManager) JoinChannel(_ js.Value, args []js.Value) any {
return
utils
.
CopyBytesToJS
(
ci
)
}
func
(
cm
*
ChannelsManager
)
EnableDirectMessages
(
_
js
.
Value
,
args
[]
js
.
Value
)
any
{
marshalledChanId
:=
utils
.
CopyBytesToGo
(
args
[
0
])
err
:=
cm
.
api
.
EnableDirectMessages
(
marshalledChanId
)
if
err
!=
nil
{
utils
.
Throw
(
utils
.
TypeError
,
err
)
return
nil
}
return
nil
}
func
(
cm
*
ChannelsManager
)
DisableDirectMessages
(
_
js
.
Value
,
args
[]
js
.
Value
)
any
{
marshalledChanId
:=
utils
.
CopyBytesToGo
(
args
[
0
])
err
:=
cm
.
api
.
DisableDirectMessages
(
marshalledChanId
)
if
err
!=
nil
{
utils
.
Throw
(
utils
.
TypeError
,
err
)
return
nil
}
return
nil
}
// LeaveChannel leaves the given channel. It will return the error
// [channels.ChannelDoesNotExistsErr] if the channel was not previously joined.
//
...
...
@@ -848,6 +828,42 @@ func (cm *ChannelsManager) GetChannels(js.Value, []js.Value) any {
return
utils
.
CopyBytesToJS
(
channelList
)
}
// EnableDirectMessages enables the token for direct messaging for this
// channel.
//
// Parameters:
// - args[0] - Marshalled bytes of the channel [id.ID] (Uint8Array).
//
// Returns:
// - Throws a TypeError if saving the DM token fails.
func
(
cm
*
ChannelsManager
)
EnableDirectMessages
(
_
js
.
Value
,
args
[]
js
.
Value
)
any
{
marshalledChanId
:=
utils
.
CopyBytesToGo
(
args
[
0
])
err
:=
cm
.
api
.
EnableDirectMessages
(
marshalledChanId
)
if
err
!=
nil
{
utils
.
Throw
(
utils
.
TypeError
,
err
)
return
nil
}
return
nil
}
// DisableDirectMessages removes the token for direct messaging for a
// given channel.
//
// Parameters:
// - args[0] - Marshalled bytes of the channel [id.ID] (Uint8Array).
//
// Returns:
// - Throws a TypeError if saving the DM token fails
func
(
cm
*
ChannelsManager
)
DisableDirectMessages
(
_
js
.
Value
,
args
[]
js
.
Value
)
any
{
marshalledChanId
:=
utils
.
CopyBytesToGo
(
args
[
0
])
err
:=
cm
.
api
.
DisableDirectMessages
(
marshalledChanId
)
if
err
!=
nil
{
utils
.
Throw
(
utils
.
TypeError
,
err
)
return
nil
}
return
nil
}
////////////////////////////////////////////////////////////////////////////////
// Channel Share URL //
////////////////////////////////////////////////////////////////////////////////
...
...
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