Linkify messages

This commit is contained in:
Simon Ser
2020-06-25 17:26:40 +02:00
parent 78002c22ee
commit 2bb8f68f6f
5 changed files with 41 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import { html, Component } from "/lib/index.js";
import linkify from "/lib/linkify.js";
function djb2(s) {
var hash = 5381;
@@ -45,10 +46,10 @@ function LogLine(props) {
var action = text.slice(actionPrefix.length, -1);
lineClass = "me-tell";
content = html`* <${Nick} nick=${msg.prefix.name}/> ${action}`;
content = html`* <${Nick} nick=${msg.prefix.name}/> ${linkify(action)}`;
} else {
lineClass = "talk";
content = html`${"<"}<${Nick} nick=${msg.prefix.name}/>${">"} ${text}`;
content = html`${"<"}<${Nick} nick=${msg.prefix.name}/>${">"} ${linkify(text)}`;
}
break;
case "JOIN":
@@ -70,7 +71,7 @@ function LogLine(props) {
case "TOPIC":
var topic = msg.params[1];
content = html`
<${Nick} nick=${msg.prefix.name}/> changed the topic to: ${topic}
<${Nick} nick=${msg.prefix.name}/> changed the topic to: ${linkify(topic)}
`;
break;
default: