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