can you not do something more naive:
- have flumeview plugins loaded in-order so that a new module, say
ssb-predecrypted
when plugged in first gets passed messages first. - then when a plugin comes across an encryped message, you send a request to
ssb-decrypted
to handle it, which has been building a plain text cache
e.g.
server
.use(require('ssb-predecrypted'))
.use(require('ssb-backlinks'))
//// in ssb-backlinks
if (typeof msg.value.content === 'string') {
msg.value.content = sbot.predecrypted.getContent(msg.key)
}
you could even pass every message over and put that boolean logic inside ssb-predecrypted