diff options
| author | George Hazan <george.hazan@gmail.com> | 2025-01-20 19:42:06 +0300 |
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2025-01-20 19:42:06 +0300 |
| commit | 454fd5713e1d460c6ef01201748805cc03f6164a (patch) | |
| tree | 78c5189bdceccee09837a344fc1557d9c7f06ce2 | |
| parent | 951bd950ea3a9270008bc606dd83698663b2be27 (diff) | |
fixes #4833 (Steam: add support for [lobbyinvite] bbcode)
| -rw-r--r-- | protocols/Steam/src/steam_utils.cpp | 12 |
1 files 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;
}
}
|
