aboutsummaryrefslogtreecommitdiff
path: root/lib/serve.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-09-04 12:46:36 -0700
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-09-06 14:08:22 -0700
commit5771e0391004bbfe4ded56f38382ed0c39a5fee4 (patch)
tree2f62ab6cfcdba6a137c16fc7d57d18bdbf8457ff /lib/serve.js
parent445387df1c63790ab1d71cb15baae871023c8531 (diff)
downloadpatchfoo-5771e0391004bbfe4ded56f38382ed0c39a5fee4.tar.gz
patchfoo-5771e0391004bbfe4ded56f38382ed0c39a5fee4.zip
Handle meetingTime polls, positions and resolutions
Diffstat (limited to 'lib/serve.js')
-rw-r--r--lib/serve.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/serve.js b/lib/serve.js
index 424e9f3..e9c719a 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -235,10 +235,14 @@ Serve.prototype.publishPollPosition = function (cb) {
branch: this.data.branches || [],
reason: this.data.poll_reason || undefined,
details: {
- type: this.data.poll_type,
- choice: Number(this.data.poll_choice)
+ type: this.data.poll_type
}
}
+ if (this.data.poll_choice != null) {
+ content.details.choice = Number(this.data.poll_choice)
+ } else {
+ content.details.choices = u.toArray(this.data.poll_choices).map(Number)
+ }
if (this.data.recps) content.recps = this.data.recps.split(',')
var json = JSON.stringify(content, 0, 2)
var q = qs.stringify({text: json, action: 'preview'})