render.jsView |
---|
9 | 9 | var config = require('./config')() |
10 | 10 | var id = require('./keys').id |
11 | 11 | var avatar = require('./avatar') |
12 | 12 | |
| 13 | +function hash () { |
| 14 | + return window.location.hash.substring(1) |
| 15 | +} |
| 16 | + |
13 | 17 | module.exports = function (msg) { |
14 | 18 | var message = h('div.message#' + msg.key.substring(0, 44)) |
15 | 19 | |
16 | 20 | if (!localStorage[msg.value.author]) |
23 | 27 | message.appendChild(tools.mini(msg, muted)) |
24 | 28 | return message |
25 | 29 | } |
26 | 30 | else if (msg.value.content.type == 'scat_message') { |
| 31 | + var src = hash() |
| 32 | + if (src != 'backchannel') { |
| 33 | + message.appendChild(h('button.btn.right', h('a', {href: '#backchannel'}, 'Chat'))) |
| 34 | + } |
27 | 35 | message.appendChild(tools.mini(msg, ' ' + msg.value.content.text)) |
28 | 36 | return message |
29 | 37 | } |
30 | 38 | else if (msg.value.content.type == 'contact') { |