Skip to content
Snippets Groups Projects
Commit 017cde6c authored by Jono Wenger's avatar Jono Wenger
Browse files

Fix channel demo to work without database

parent 8eb02dec
No related branches found
No related tags found
No related merge requests found
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment