aboutsummaryrefslogtreecommitdiff
path: root/lib/render-msg.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/render-msg.js')
-rw-r--r--lib/render-msg.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 645e6b9..3fd845d 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -209,6 +209,8 @@ RenderMsg.prototype.message = function (raw, cb) {
case 'robeson/update':
return this.update(cb)
case 'wifi-network': return this.wifiNetwork(cb)
+ case 'mutual/credit': return this.mutualCredit(cb)
+ case 'mutual/account': return this.mutualAccount(cb)
default: return this.object(cb)
}
}
@@ -599,3 +601,19 @@ RenderMsg.prototype.wifiNetwork = function (cb) {
),
], cb)
}
+
+RenderMsg.prototype.mutualCredit = function (cb) {
+ var self = this
+ self.link(self.c.account, function (err, a) {
+ if (err) return cb(err)
+ self.wrapMini([
+ 'credits ', a || '?', ' ',
+ self.c.amount, ' ', self.c.currency,
+ self.c.memo ? [' for ', h('q', self.c.memo)] : ''
+ ], cb)
+ })
+}
+
+RenderMsg.prototype.mutualAccount = function (cb) {
+ return this.object(cb)
+}