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
9b2fd36a
Commit
9b2fd36a
authored
1 year ago
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
Add Block/Unblock to DM
parent
0606c450
No related branches found
No related tags found
1 merge request
!109
Project/haven beta
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wasm/dm.go
+28
-0
28 additions, 0 deletions
wasm/dm.go
with
28 additions
and
0 deletions
wasm/dm.go
+
28
−
0
View file @
9b2fd36a
...
...
@@ -63,6 +63,10 @@ func newDMClientJS(api *bindings.DMClient) map[string]any {
"SendReaction"
:
js
.
FuncOf
(
cm
.
SendReaction
),
"SendSilent"
:
js
.
FuncOf
(
cm
.
SendSilent
),
"Send"
:
js
.
FuncOf
(
cm
.
Send
),
// User Mute/Unmute
"BlockSender"
:
js
.
FuncOf
(
cm
.
BlockSender
),
"UnblockSender"
:
js
.
FuncOf
(
cm
.
UnblockSender
),
}
return
dmClientMap
...
...
@@ -572,6 +576,30 @@ func (dmc *DMClient) GetDatabaseName(js.Value, []js.Value) any {
"_speakeasy_dm"
}
// BlockSender blocks the provided sender public key from sending DMs
//
// Parameters:
// - args[0] - [ed25519.PublicKey] (Uint8Array)
//
// Returns nothing
func
(
dmc
*
DMClient
)
BlockSender
(
_
js
.
Value
,
args
[]
js
.
Value
)
any
{
senderKey
:=
utils
.
CopyBytesToGo
(
args
[
0
])
dmc
.
api
.
BlockSender
(
senderKey
)
return
nil
}
// UnblockSender unblocks the provided sender public key to allow sending DMs
//
// Parameters:
// - args[0] - [ed25519.PublicKey] (Uint8Array)
//
// Returns nothing
func
(
dmc
*
DMClient
)
UnblockSender
(
_
js
.
Value
,
args
[]
js
.
Value
)
any
{
senderKey
:=
utils
.
CopyBytesToGo
(
args
[
0
])
dmc
.
api
.
UnblockSender
(
senderKey
)
return
nil
}
////////////////////////////////////////////////////////////////////////////////
// DM 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