diff options
Diffstat (limited to 'lib/serve.js')
-rw-r--r-- | lib/serve.js | 20 |
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() |