From 454fd5713e1d460c6ef01201748805cc03f6164a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 20 Jan 2025 19:42:06 +0300 Subject: fixes #4833 (Steam: add support for [lobbyinvite] bbcode) --- protocols/Steam/src/steam_utils.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/protocols/Steam/src/steam_utils.cpp b/protocols/Steam/src/steam_utils.cpp index 235da7a173..d1e838c9bf 100644 --- a/protocols/Steam/src/steam_utils.cpp +++ b/protocols/Steam/src/steam_utils.cpp @@ -51,6 +51,7 @@ void DecodeBbcodes(SESSION_INFO *si, CMStringA &szText) if (iEnd == -1) return; + CMStringA szReplace; if (!isClosing) { auto *p = szText.c_str() + idx; if (!strncmp(p, "mention=", 8)) { @@ -60,15 +61,18 @@ void DecodeBbcodes(SESSION_INFO *si, CMStringA &szText) if (iEnd2 == -1) return; - szText.Delete(idx - 1, iEnd2 - idx + 11); - szText.Insert(0, ":"); - szText.Insert(0, T2Utf(pUser->pszNick)); - continue; + iEnd = iEnd2 + 10; + szReplace.Format("%s:", T2Utf(pUser->pszNick).get()); } } + else if (!strncmp(p, "lobbyinvite ", 12)) { + szReplace = TranslateU("You were invited to play a game"); + } } szText.Delete(idx - 1, iEnd - idx + 1); + if (!szReplace.IsEmpty()) + szText = szReplace + szText; idx = iEnd; } } -- cgit v1.2.3