Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Floofchat with ArmoredChat #961

Merged
merged 33 commits into from
Jul 11, 2024
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
002fdf0
Initial Commit.
Armored-Dragon May 17, 2024
0d5eb93
Added Settings.
Armored-Dragon May 18, 2024
7b50f91
Clear already logged messages.
Armored-Dragon May 18, 2024
66fd217
Maximum messages setting.
Armored-Dragon May 21, 2024
391a33d
Fixed saved date on messages.
Armored-Dragon May 21, 2024
c48e9d3
Clickable links.
Armored-Dragon May 22, 2024
2a42bce
Minor formatting adjustments.
Armored-Dragon May 22, 2024
9d9b57d
Fix notification width.
Armored-Dragon May 22, 2024
7920610
README
Armored-Dragon May 22, 2024
9bf5f3d
Linking fix.
Armored-Dragon May 22, 2024
86f8e29
Quick Message hotbar.
Armored-Dragon May 23, 2024
0bc11e8
Fix for #975 sticky keys.
Armored-Dragon May 23, 2024
1cddc5a
Added message padding.
Armored-Dragon May 23, 2024
ed3e629
Image embedding.
Armored-Dragon May 23, 2024
0a7b64d
Prevent VR quick_message bar.
Armored-Dragon May 23, 2024
c1e5115
Updated README.
Armored-Dragon May 23, 2024
7ef3322
Moved system chat to script-archive.
Armored-Dragon May 23, 2024
c734e0d
Updated Readme.
Armored-Dragon May 25, 2024
60a4662
Updated URL regex.
Armored-Dragon May 25, 2024
8301bfd
Added development manual.
Armored-Dragon May 26, 2024
82605c5
Scroll to bottom on launch.
Armored-Dragon May 27, 2024
01306b3
Scroll to bottom when changing page.
Armored-Dragon May 27, 2024
7fc1a3d
Fixed scrolling too far.
Armored-Dragon Jun 8, 2024
eb84de8
Corrected case on variables.
Armored-Dragon Jun 8, 2024
192d80a
Floofchat compatibility.
Armored-Dragon Jun 8, 2024
7e100a1
Raise VR Keyboard when textfield is selected
Armored-Dragon Jun 28, 2024
2012cce
Merge branch 'master' into ArmoredChat
Armored-Dragon Jun 29, 2024
ce79cc8
Merge branch 'overte-org:master' into ArmoredChat
Armored-Dragon Jun 30, 2024
c6d2e56
Fix keyboard being invoked when not in VR.
Armored-Dragon Jul 6, 2024
6cf6e6c
Disallow all text formatting by default.
Armored-Dragon Jul 8, 2024
252b33b
Removed commented code.
Armored-Dragon Jul 8, 2024
fe46258
Sanity check on message channel.
Armored-Dragon Jul 9, 2024
9964d91
Fixed message subscription.
Armored-Dragon Jul 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion scripts/communityScripts/armored-chat/armored_chat.qml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,11 @@ Rectangle {
width: parent.width * 0.8
height: contentHeight // Adjust height to fit content
wrapMode: Text.Wrap
textFormat: TextEdit.RichText
Armored-Dragon marked this conversation as resolved.
Show resolved Hide resolved

onLinkActivated: {
Window.openWebBrowser(link)
}
}
}
}
Expand Down Expand Up @@ -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 "<a onclick='Window.openUrl("+match+")' href='" + match + "'>" + match + "</a>";
});

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 = "";
Expand All @@ -471,6 +484,7 @@ Rectangle {
var last_item = channel.get(last_item_index);

if (last_message_user === username && elapsed_minutes < 1 && last_item){
message = "<br>" + message
last_item.text = last_item.text += "\n" + message;
scrollToBottom()
last_message_time = new Date();
Expand All @@ -487,10 +501,15 @@ Rectangle {
return channels[id];
}

function sanatizeContent(mess) {
var script_tag = /<script\b[^>]*>/gi;
return mess.replace(script_tag, "script");
}

// Messages from script
function fromScript(message) {
let time = new Date().toLocaleTimeString(undefined, { hour12: false });
let date = new Date().toLocaleDateString(undefined, { month: "long", day: "numeric", });
let date = new Date().toLocaleDateString(undefined, { year: "numeric", month: "long", day: "numeric", });

switch (message.type){
case "show_message":
Expand All @@ -502,6 +521,7 @@ Rectangle {
case "clear_messages":
local.clear()
domain.clear()
break;
case "initial_settings":
if (message.settings.external_window) s_external_window.checked = true
if (message.settings.maximum_messages) s_maximum_messages.value = message.settings.maximum_messages
Expand Down
Loading