diff options
Diffstat (limited to 'protocols/Steam/src/steam_utils.cpp')
-rw-r--r-- | protocols/Steam/src/steam_utils.cpp | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/protocols/Steam/src/steam_utils.cpp b/protocols/Steam/src/steam_utils.cpp index 7f1275add3..2b8c3263db 100644 --- a/protocols/Steam/src/steam_utils.cpp +++ b/protocols/Steam/src/steam_utils.cpp @@ -20,91 +20,6 @@ bool IsNull(const ProtobufCBinaryData &buf) /////////////////////////////////////////////////////////////////////////////////////////
-void EncodeBbcodes(SESSION_INFO *si, CMStringW &wszText)
-{
- int idx = wszText.Find(':');
- if (idx != -1) {
- CMStringW wszNick(wszText.Left(idx));
- for (auto &it : si->getUserList()) {
- if (wszNick == it->pszNick) {
- wszText.Delete(0, idx+1);
-
- CMStringW wszReplace(FORMAT, L"[mention=%lld]@%s[/mention]", SteamIdToAccountId(_wtoi64(it->pszUID)), it->pszNick);
- wszText = wszReplace + wszText;
- break;
- }
- }
- }
-}
-
-void DecodeBbcodes(SESSION_INFO *si, CMStringA &szText)
-{
- for (int idx = 0; idx != -1; idx = szText.Find('[', idx+1)) {
- bool isClosing = false;
- idx++;
- if (szText[idx] == '/') {
- isClosing = true;
- idx++;
- }
-
- int iEnd = szText.Find(']', idx + 1);
- if (iEnd == -1)
- return;
-
- bool bPlaceFirst = false;
- CMStringA szReplace;
-
- auto *p = szText.c_str() + idx;
- if (!strncmp(p, "emoticon", 8) || !strncmp(p, "sticker", 7))
- szReplace = ":";
-
- if (!isClosing) {
- if (!strncmp(p, "mention=", 8)) {
- CMStringW wszId(FORMAT, L"%lld", AccountIdToSteamId(_atoi64(p + 8)));
- if (auto *pUser = g_chatApi.UM_FindUser(si, wszId)) {
- int iEnd2 = szText.Find("[/mention]", iEnd);
- if (iEnd2 == -1)
- return;
-
- iEnd = iEnd2 + 10;
- szReplace.Format("%s:", T2Utf(pUser->pszNick).get());
- bPlaceFirst = true;
- }
- }
- else if (!strncmp(p, "lobbyinvite ", 12)) {
- szReplace = TranslateU("You were invited to play a game");
- }
- else if (!strncmp(p, "sticker ", 8)) {
- std::regex regex("type=\"(.+?)\"");
- std::smatch match;
- std::string content(p + 8);
- if (std::regex_search(content, match, regex)) {
- std::string szType = match[1];
- szReplace += szType.c_str();
- szReplace.Replace(" ", "_");
- }
- iEnd++;
- }
- else iEnd++;
- }
- else iEnd++, idx--;
-
- idx--;
- szText.Delete(idx, iEnd - idx);
-
- if (!szReplace.IsEmpty()) {
- if (bPlaceFirst)
- szText = szReplace + szText;
- else
- szText.Insert(idx, szReplace);
- }
- iEnd -= iEnd - idx;
- idx = iEnd;
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
MBinBuffer createMachineID(const char *accName)
{
uint8_t hashOut[MIR_SHA1_HASH_SIZE];
|