aboutsummaryrefslogtreecommitdiff
path: root/lib/serve.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-05-30 14:04:54 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-05-30 14:04:54 -1000
commit7fdca5304e8322ddc09a35e4018e86984dde9ff4 (patch)
tree60aa1d2cacebae16e8beb68bcc48cab62fee0a4a /lib/serve.js
parentee7abb673cd0a592982e340d29ab64a3f4184eae (diff)
downloadpatchfoo-7fdca5304e8322ddc09a35e4018e86984dde9ff4.tar.gz
patchfoo-7fdca5304e8322ddc09a35e4018e86984dde9ff4.zip
Add attend button for gatherings
Diffstat (limited to 'lib/serve.js')
-rw-r--r--lib/serve.js20
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/serve.js b/lib/serve.js
index 1909bbc..e0d9396 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -122,9 +122,10 @@ Serve.prototype.go = function () {
self.data = data
if (err) next(err)
else if (data.action === 'publish') self.publishJSON(next)
- else if (data.action === 'vote') self.publishVote(next)
else if (data.action === 'contact') self.publishContact(next)
else if (data.action === 'want-blobs') self.wantBlobs(next)
+ else if (data.action_vote) self.publishVote(next)
+ else if (data.action_attend) self.publishAttend(next)
else next()
}
@@ -161,8 +162,8 @@ Serve.prototype.publishVote = function (cb) {
channel: this.data.channel || undefined,
vote: {
link: this.data.link,
- value: Number(this.data.value),
- expression: this.data.expression,
+ value: Number(this.data.vote_value),
+ expression: this.data.vote_expression,
}
}
if (this.data.recps) content.recps = this.data.recps.split(',')
@@ -178,6 +179,19 @@ Serve.prototype.publishContact = function (cb) {
this.publish(content, cb)
}
+Serve.prototype.publishAttend = function (cb) {
+ var content = {
+ type: 'about',
+ channel: this.data.channel || undefined,
+ about: this.data.link,
+ attendee: {
+ link: this.app.sbot.id
+ }
+ }
+ if (this.data.recps) content.recps = this.data.recps.split(',')
+ this.publish(content, cb)
+}
+
Serve.prototype.wantBlobs = function (cb) {
var self = this
if (!self.data.blob_ids) return cb()