diff --git a/scripts/communityScripts/armored-chat/armored_chat.qml b/scripts/communityScripts/armored-chat/armored_chat.qml
index 462966da11..706d431a95 100644
--- a/scripts/communityScripts/armored-chat/armored_chat.qml
+++ b/scripts/communityScripts/armored-chat/armored_chat.qml
@@ -369,6 +369,11 @@ Rectangle {
width: parent.width * 0.8
height: contentHeight // Adjust height to fit content
wrapMode: Text.Wrap
+ textFormat: TextEdit.RichText
+
+ onLinkActivated: {
+ Window.openWebBrowser(link)
+ }
}
}
}
@@ -455,6 +460,14 @@ Rectangle {
function addMessage(username, message, date, channel, type){
channel = getChannel(channel)
+ // Linkify
+ var regex = /(https?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+(?:\/[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]*)?(?=\s|$)/g;
+ message = message.replace(regex, (match) => {
+ return "" + match + "";
+ });
+
+ message = sanatizeContent(message); // Make sure we don't have any nasties
+
if (type === "notification"){
channel.append({ text: message, date: date, type: "notification" });
last_message_user = "";
@@ -471,6 +484,7 @@ Rectangle {
var last_item = channel.get(last_item_index);
if (last_message_user === username && elapsed_minutes < 1 && last_item){
+ message = "
" + message
last_item.text = last_item.text += "\n" + message;
scrollToBottom()
last_message_time = new Date();
@@ -487,10 +501,15 @@ Rectangle {
return channels[id];
}
+ function sanatizeContent(mess) {
+ var script_tag = /