aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-09-01 20:25:45 -0700
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-09-01 20:34:10 -0700
commitbe5d952536013f75eeb725536a54ad9e92a38b0a (patch)
tree7752c7fbef736ea5c721cbbe3aab47d33da64e1e
parent63b9d0c20fa2a26e783a138c9e5b98b4cfca3230 (diff)
downloadpatchfoo-be5d952536013f75eeb725536a54ad9e92a38b0a.tar.gz
patchfoo-be5d952536013f75eeb725536a54ad9e92a38b0a.zip
Render ahau audio messages
-rw-r--r--lib/render-msg.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 82395af..3de96c7 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -286,9 +286,10 @@ RenderMsg.prototype.message = function (cb) {
case 'ssb-dns': return this.dns(cb)
case 'gathering': return this.gathering(cb)
case 'micro': return this.micro(cb)
+ case 'audio': return this.audio(cb)
case 'ferment/audio':
case 'robeson/audio':
- return this.audio(cb)
+ return this.fermentAudio(cb)
case 'ferment/repost':
case 'robeson/repost':
return this.repost(cb)
@@ -1123,6 +1124,15 @@ function formatDuration(s) {
}
RenderMsg.prototype.audio = function (cb) {
+ this.wrapMini([
+ h('a', {href: this.toUrl(this.c.blob)}, 'audio'),
+ isFinite(this.c.format) ? ' (' + this.c.format + ')' : '',
+ isFinite(this.c.duration) ? ' (' + formatDuration(this.c.duration) + ')' : '',
+ isFinite(this.c.size) ? ' [' + this.render.formatSize(this.c.size) + ']' : '',
+ ], cb)
+}
+
+RenderMsg.prototype.fermentAudio = function (cb) {
// fileName, fallbackFileName, overview
this.wrap(h('table', h('tr',
h('td',