WIP copy U Game link to sender

This commit is contained in:
NigeParis 2026-01-12 16:28:10 +01:00 committed by Maix0
parent ed2885f19d
commit 432fd849b8
4 changed files with 47 additions and 10 deletions

View file

@ -17,7 +17,7 @@ import authHtml from "./chat.html?raw";
import { getUser } from "@app/auth";
import { listBuddies } from "./chatHelperFunctions/listBuddies";
import { getProfil } from "./chatHelperFunctions/getProfil";
import { addMessage } from "./chatHelperFunctions/addMessage";
import { addInviteMessage, addMessage } from "./chatHelperFunctions/addMessage";
import { broadcastMsg } from "./chatHelperFunctions/broadcastMsg";
import { openProfilePopup } from "./chatHelperFunctions/openProfilePopup";
import { actionBtnPopUpBlock } from "./chatHelperFunctions/actionBtnPopUpBlock";
@ -209,7 +209,13 @@ function initChatSocket() {
});
socket.on("privMessageCopy", (message: string) => {
addMessage(message);
const htmlBaliseRegex = /<a\b[^>]*>[\s\S]*?<\/a>/;
const htmlBaliseMatch = message.match(htmlBaliseRegex);
if (htmlBaliseMatch)
addInviteMessage(message);
else
addMessage(message);
});
//receives broadcast of the next GAME