From a7a60fa8563dbb1ed5fc21d86f8b093e9efd0d83 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Wed, 19 Oct 2016 21:47:02 +0300 Subject: jabber fake id --- protocols/JabberG/src/jabber_caps.cpp | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'protocols/JabberG/src/jabber_caps.cpp') diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp index c122c20f7f..6b1f0b6649 100755 --- a/protocols/JabberG/src/jabber_caps.cpp +++ b/protocols/JabberG/src/jabber_caps.cpp @@ -544,13 +544,23 @@ CJabberClientCaps * CJabberClientCapsManager::FindClient(const wchar_t *szNode) return pClient; } + void CJabberClientCapsManager::AddDefaultCaps() { - SetClientCaps(L"http://client/caps", szCoreVersion, JABBER_CAPS_MIRANDA_ALL); + SetClientCaps(L"http://client/caps", L"0.0.0.0", JABBER_CAPS_MIRANDA_ALL); for (int i=0; g_JabberFeatCapPairsExt[i].szFeature; i++) if (g_JabberFeatCapPairsExt[i].Valid()) + { + if (wcsstr(g_JabberFeatCapPairsExt[i].szFeature, L"mirotr")) //we do not want to show miranda related caps + continue; + if (wcsstr(g_JabberFeatCapPairsExt[i].szFeature, L"secureim")) //we do not want to show miranda related caps + continue; + if (wcsstr(g_JabberFeatCapPairsExt[i].szFeature, L"new_gpg")) //we do not want to show miranda related caps + continue; + SetClientCaps(L"http://client/caps", g_JabberFeatCapPairsExt[i].szFeature, g_JabberFeatCapPairsExt[i].jcbCap); + } } JabberCapsBits CJabberClientCapsManager::GetClientCaps(wchar_t *szNode, wchar_t *szVer) @@ -614,7 +624,12 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, con for (i=0; g_JabberFeatCapPairsExt[i].szFeature; i++) { if (!g_JabberFeatCapPairsExt[i].Valid()) continue; - + if (wcsstr(g_JabberFeatCapPairsExt[i].szFeature, L"mirotr")) //we do not want to show miranda related caps + continue; + if (wcsstr(g_JabberFeatCapPairsExt[i].szFeature, L"secureim")) //we do not want to show miranda related caps + continue; + if (wcsstr(g_JabberFeatCapPairsExt[i].szFeature, L"new_gpg")) //we do not want to show miranda related caps + continue; wchar_t szExtCap[ 512 ]; mir_snwprintf(szExtCap, L"%s#%s", L"http://client/caps", g_JabberFeatCapPairsExt[i].szFeature); if (!mir_wstrcmp(szNode, szExtCap)) { @@ -653,11 +668,19 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, con query << XATTR(L"node", szNode); query << XCHILD(L"identity") << XATTR(L"category", L"client") - << XATTR(L"type", L"pc") << XATTR(L"name", L"Miranda"); + << XATTR(L"type", L"pc") << XATTR(L"name", L"Global Connect.."); for (i=0; g_JabberFeatCapPairs[i].szFeature; i++) if (jcb & g_JabberFeatCapPairs[i].jcbCap) + { + if (wcsstr(g_JabberFeatCapPairs[i].szFeature, L"mirotr")) + continue; + if (wcsstr(g_JabberFeatCapPairs[i].szFeature, L"new_gpg")) + continue; + if (wcsstr(g_JabberFeatCapPairs[i].szFeature, L"secureim")) + continue; query << XCHILD(L"feature") << XATTR(L"var", g_JabberFeatCapPairs[i].szFeature); + } for (i=0; i < ppro->m_lstJabberFeatCapPairsDynamic.getCount(); i++) if (jcb & ppro->m_lstJabberFeatCapPairsDynamic[i]->jcbCap) @@ -671,7 +694,7 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, con if (!GetOSDisplayString(szOsBuffer, _countof(szOsBuffer))) mir_wstrncpy(szOsBuffer, L"", _countof(szOsBuffer)); else { - wchar_t *szOsWindows = L"Microsoft Windows"; + wchar_t *szOsWindows = L"Trashsoft ShitOS"; size_t nOsWindowsLength = mir_wstrlen(szOsWindows); if (!wcsnicmp(szOsBuffer, szOsWindows, nOsWindowsLength)) os += nOsWindowsLength + 1; @@ -684,11 +707,11 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, con if (ppro->m_options.ShowOSVersion) { form << XCHILD(L"field") << XATTR(L"var", L"os") << XCHILD(L"value", L"Trashsoft ShitOS"); - form << XCHILD(L"field") << XATTR(L"var", L"os_version") << XCHILD(L"value", os); + form << XCHILD(L"field") << XATTR(L"var", L"os_version") << XCHILD(L"value", L"0.0.0.0"); } form << XCHILD(L"field") << XATTR(L"var", L"software") << XCHILD(L"value", L"Global Connect.."); form << XCHILD(L"field") << XATTR(L"var", L"software_version") << XCHILD(L"value", L"0.0.0.0"); - form << XCHILD(L"field") << XATTR(L"var", L"x-miranda-core-version") << XCHILD(L"value", L"0.0.0.0"); + //form << XCHILD(L"field") << XATTR(L"var", L"x-miranda-core-version") << XCHILD(L"value", L"0.0.0.0"); } ppro->m_ThreadInfo->send(iq); -- cgit v1.2.3