owncast/webroot/js/message.js

19 lines
320 B
JavaScript
Raw Normal View History

2020-06-02 22:56:59 +02:00
class Message {
constructor(model) {
this.author = model.author
this.body = model.body
this.image = "https://robohash.org/" + model.author
}
2020-06-03 00:37:36 +02:00
linkedText() {
return autoLink(this.body, { embed: true })
}
2020-06-02 22:56:59 +02:00
toModel() {
return {
author: this.author(),
body: this.body(),
image: this.image()
}
}
}