Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
integration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package 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
integration
Commits
017cde6c
Commit
017cde6c
authored
2 years ago
by
Jono Wenger
Browse files
Options
Downloads
Patches
Plain Diff
Fix channel demo to work without database
parent
8eb02dec
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
wasm/clients/channels/channels.js
+41
-24
41 additions, 24 deletions
wasm/clients/channels/channels.js
with
41 additions
and
24 deletions
wasm/clients/channels/channels.js
+
41
−
24
View file @
017cde6c
...
@@ -139,21 +139,39 @@ async function joinChannel(htmlConsole, messageConsole, net, username,
...
@@ -139,21 +139,39 @@ async function joinChannel(htmlConsole, messageConsole, net, username,
* Use this when NOT using the database
* Use this when NOT using the database
*/
*/
let
uuidCount
=
0
// The eventModel is used only without the database
// The eventModel is used only without the database
let
eventModel
=
{
let
eventModel
=
{
JoinChannel
:
function
(
channel
)
{
JoinChannel
:
function
(
channel
)
{
},
},
LeaveChannel
:
function
(
channelID
)
{
LeaveChannel
:
function
(
channelID
)
{
},
},
ReceiveMessage
:
function
(
channelID
,
messageID
,
senderUsername
,
text
,
timestamp
,
lease
,
roundId
,
status
)
{
ReceiveMessage
:
function
(
channelID
,
messageID
,
nickname
,
text
,
messageConsole
.
overwrite
(
text
)
identity
,
timestamp
,
lease
,
roundId
,
status
)
{
// htmlConsole.log(senderUsername + ": " + text)
htmlConsole
.
log
(
"
Identity:
"
+
dec
.
decode
(
identity
))
identity
=
jsonToObj
(
identity
)
let
msg
=
"
<strong>
"
+
identity
.
Codename
+
"
#
"
+
nickname
+
"
</strong><br />
"
+
text
+
"
<br /><br />
"
messageConsole
.
log
(
msg
)
uuidCount
++
return
uuidCount
},
},
ReceiveReply
:
function
(
channelID
,
messageID
,
reactionTo
,
senderUsername
,
text
,
timestamp
,
lease
,
roundId
,
status
)
{
ReceiveReply
:
function
(
channelID
,
messageID
,
reactionTo
,
senderUsername
,
text
,
identity
,
timestamp
,
lease
,
roundId
,
status
)
{
uuidCount
++
return
uuidCount
},
},
ReceiveReaction
:
function
(
channelID
,
messageID
,
reactionTo
,
senderUsername
,
reaction
,
timestamp
,
lease
,
roundId
,
status
)
{
ReceiveReaction
:
function
(
channelID
,
messageID
,
reactionTo
,
senderUsername
,
reaction
,
identity
,
timestamp
,
lease
,
roundId
,
status
)
{
uuidCount
++
return
uuidCount
},
},
UpdateSentStatus
:
function
(
messageID
,
status
)
{
UpdateSentStatus
:
function
(
uuid
,
messageID
,
timestamp
,
roundID
,
status
)
{
},
},
}
}
...
@@ -203,7 +221,6 @@ async function joinChannel(htmlConsole, messageConsole, net, username,
...
@@ -203,7 +221,6 @@ async function joinChannel(htmlConsole, messageConsole, net, username,
}
}
nameOutput
.
value
=
chanInfo
.
Name
nameOutput
.
value
=
chanInfo
.
Name
descriptionOutput
.
value
=
chanInfo
.
Description
descriptionOutput
.
value
=
chanInfo
.
Description
idOutput
.
value
=
chanInfo
.
ChannelID
idOutput
.
value
=
chanInfo
.
ChannelID
...
...
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