diff --git a/ChatTwo/ChatTwo.csproj b/ChatTwo/ChatTwo.csproj index 5df989a..f3b911f 100755 --- a/ChatTwo/ChatTwo.csproj +++ b/ChatTwo/ChatTwo.csproj @@ -1,6 +1,6 @@ - 1.34.2 + 1.34.3 enable enable true diff --git a/ChatTwo/Http/Frontend/src/lib/chat.svelte.ts b/ChatTwo/Http/Frontend/src/lib/chat.svelte.ts index d27ffe1..ab89039 100644 --- a/ChatTwo/Http/Frontend/src/lib/chat.svelte.ts +++ b/ChatTwo/Http/Frontend/src/lib/chat.svelte.ts @@ -241,14 +241,21 @@ export class ChatTwoWeb { processUrlTemplate(template: Template, spanElement: HTMLSpanElement) { const urlElement = document.createElement('a'); + let url = template.content; + if (!url.startsWith('https://')) { + url = `https://${url}`; + } + urlElement.innerText = template.content; - urlElement.href = encodeURI(template.content); + urlElement.href = encodeURI(url); urlElement.target = '_blank' if (template.color !== 0) { this.processColor(template, spanElement); } + + spanElement.appendChild(urlElement); } // converts a RGBA uint number to components diff --git a/ChatTwo/Http/HostContext.cs b/ChatTwo/Http/HostContext.cs index 944f8ef..4a55795 100644 --- a/ChatTwo/Http/HostContext.cs +++ b/ChatTwo/Http/HostContext.cs @@ -45,7 +45,7 @@ public class HostContext Host.Settings.Debug.Responses = true; Host.Settings.Debug.AccessControl = true; #endif - Host.Events.Logger = logMessage => Plugin.Log.Information(logMessage); + Host.Events.Logger = logMessage => Plugin.Log.Debug(logMessage); IsActive = true; return true; diff --git a/ChatTwo/Http/RouteController.cs b/ChatTwo/Http/RouteController.cs index 50064b5..07e87f6 100644 --- a/ChatTwo/Http/RouteController.cs +++ b/ChatTwo/Http/RouteController.cs @@ -233,7 +233,7 @@ public class RouteController { try { - Plugin.Log.Information($"Client connected: {ctx.Guid}"); + Plugin.Log.Debug($"Client connected: {ctx.Guid}"); var sse = new SSEConnection(HostContext.TokenSource.Token); await HostContext.Core.PrepareNewClient(sse); diff --git a/ChatTwo/Http/SSEConnection.cs b/ChatTwo/Http/SSEConnection.cs index 370283f..6225481 100644 --- a/ChatTwo/Http/SSEConnection.cs +++ b/ChatTwo/Http/SSEConnection.cs @@ -36,8 +36,8 @@ public class SSEConnection if (!await ctx.Response.SendChunk(outgoingEvent.Build(), false, Token)) { - Plugin.Log.Information("SSE connection was unable to send new data"); - Plugin.Log.Information($"Client disconnected: {ctx.Guid}"); + Plugin.Log.Debug("SSE connection was unable to send new data"); + Plugin.Log.Debug($"Client disconnected: {ctx.Guid}"); return; } } diff --git a/ChatTwo/Util/WrapperUtil.cs b/ChatTwo/Util/WrapperUtil.cs index 450ba92..bfb64bc 100644 --- a/ChatTwo/Util/WrapperUtil.cs +++ b/ChatTwo/Util/WrapperUtil.cs @@ -28,7 +28,7 @@ public static class WrapperUtil public static IEnumerable<(T Value, int Index)> WithIndex(this IEnumerable list) => list.Select((x, i) => (x, i)); - /// Return the first object fulfilling the predicate or null for structs. + /// Return the first object fulfilling the predicate or null for structs. /// The enumerable. /// The predicate. /// The first object fulfilling the predicate, or a null-optional. diff --git a/ChatTwo/websiteBuild.zip b/ChatTwo/websiteBuild.zip index 7fb4cf3..988d9fb 100644 Binary files a/ChatTwo/websiteBuild.zip and b/ChatTwo/websiteBuild.zip differ