Read WakuMessage text

This commit is contained in:
Oskar Thoren 2020-10-16 13:38:54 +08:00
parent 24ca07fd1c
commit 5260a40a50
No known key found for this signature in database
GPG Key ID: B2ECCFD3BC2EF77E
1 changed files with 3 additions and 1 deletions

View File

@ -118,7 +118,9 @@ class Chat {
if (this.useWakuMessage) {
console.info("Reading message as a WakuMessage")
const msg = WakuMessage.decode(message.data)
console.info("WakuMessage: ", msg.contentTopic, msg.payload)
// XXX: Might not always work...
const text = String.fromCharCode(...msg.payload)
console.info("WakuMessage: ", msg.contentTopic, text)
}
else {
//TODO Figure out how to re-enable / remove wrt chat2 example