From 85f043e20f819139314f5ed0b02315126d7961f7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 20 Feb 2019 14:21:21 +0300 Subject: fix for some formatting issues --- protocols/JabberG/src/jabber_caps.cpp | 2 +- protocols/JabberG/src/jabber_misc.cpp | 4 ++-- protocols/JabberG/src/jabber_password.cpp | 6 +++--- protocols/JabberG/src/jabber_thread.cpp | 17 +++++++++-------- 4 files changed, 15 insertions(+), 14 deletions(-) (limited to 'protocols') diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp index aae787a123..305cf845eb 100755 --- a/protocols/JabberG/src/jabber_caps.cpp +++ b/protocols/JabberG/src/jabber_caps.cpp @@ -176,7 +176,7 @@ void CJabberProto::OnIqResultCapsDiscoInfo(const TiXmlElement*, CJabberIqInfo *p root.push_back(JSONNode("sm", pCaps->m_szSoftMir.get())); root.push_back(JSONNode("c", CMStringA(FORMAT, "%lld", jcbCaps))); - CMStringA szName(FORMAT, "%S#%S", pCaps->GetNode(), pCaps->GetHash()); + CMStringA szName(FORMAT, "%s#%s", pCaps->GetNode(), pCaps->GetHash()); json_string szValue = root.write(); db_set_s(0, "JabberCaps", szName, szValue.c_str()); } diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 423e65516b..1ebda3ebf6 100755 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -158,8 +158,8 @@ void CJabberProto::GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t mir_snwprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%S%s", JabberSha1(str, buf), szFileType); } else if (m_ThreadInfo != nullptr) { - mir_snwprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%s@%S avatar%s", - m_ThreadInfo->conn.username, m_ThreadInfo->conn.server, szFileType); + mir_snwprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%s@%s avatar%s", + Utf2T(m_ThreadInfo->conn.username).get(), Utf2T(m_ThreadInfo->conn.server).get(), szFileType); } else { ptrA res1(getStringA("LoginName")), res2(getStringA("LoginServer")); diff --git a/protocols/JabberG/src/jabber_password.cpp b/protocols/JabberG/src/jabber_password.cpp index 1fe7ed41f0..4ad8974619 100644 --- a/protocols/JabberG/src/jabber_password.cpp +++ b/protocols/JabberG/src/jabber_password.cpp @@ -44,9 +44,9 @@ public: Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_KEYS)); if (m_proto->m_bJabberOnline && m_proto->m_ThreadInfo != nullptr) { - wchar_t text[1024]; - mir_snwprintf(text, TranslateT("Set New Password for %s@%S"), m_proto->m_ThreadInfo->conn.username, m_proto->m_ThreadInfo->conn.server); - SetCaption(text); + char text[1024]; + mir_snprintf(text, TranslateU("Set New Password for %s@%s"), m_proto->m_ThreadInfo->conn.username, m_proto->m_ThreadInfo->conn.server); + SetWindowTextUtf(m_hwnd, text); } return true; } diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index ada674d96c..40c40ab336 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -293,7 +293,7 @@ LBL_FatalError: } char jidStr[512]; - mir_snprintf(jidStr, "%s@%S/%s", info.conn.username, info.conn.server, info.resource); + mir_snprintf(jidStr, "%s@%s/%s", info.conn.username, info.conn.server, info.resource); strncpy_s(info.fullJID, jidStr, _TRUNCATE); if (m_bUseDomainLogin) // in the case of NTLM auth we have no need in password @@ -302,7 +302,7 @@ LBL_FatalError: if (m_savedPassword != nullptr) strncpy_s(info.conn.password, T2Utf(m_savedPassword), _TRUNCATE); else { - mir_snprintf(jidStr, "%s@%S", info.conn.username, info.conn.server); + mir_snprintf(jidStr, "%s@%s", info.conn.username, info.conn.server); JabberPasswordDlgParam param; param.pro = this; @@ -395,7 +395,7 @@ LBL_FatalError: // User may change status to OFFLINE while we are connecting above if (m_iDesiredStatus != ID_STATUS_OFFLINE || info.bIsReg) { if (!info.bIsReg) { - m_szJabberJID = CMStringA(FORMAT, "%s@%S", info.conn.username, info.conn.server).Detach(); + m_szJabberJID = CMStringA(FORMAT, "%s@%s", info.conn.username, info.conn.server).Detach(); m_bSendKeepAlive = m_bKeepAlive != 0; setUString("jid", m_szJabberJID); // store jid in database @@ -663,9 +663,10 @@ void CJabberProto::PerformAuthentication(ThreadData *info) return; } - wchar_t text[1024]; - mir_snwprintf(text, TranslateT("Authentication failed for %s@%S."), info->conn.username, info->conn.server); - MsgPopup(0, text, TranslateT("Jabber Authentication")); + char text[1024]; + mir_snprintf(text, TranslateU("Authentication failed for %s@%s."), info->conn.username, info->conn.server); + MsgPopup(0, Utf2T(text), TranslateT("Jabber Authentication")); + JLoginFailed(LOGINERR_WRONGPASSWORD); info->send(""); m_ThreadInfo = nullptr; @@ -1629,7 +1630,7 @@ void CJabberProto::OnProcessPresence(const TiXmlElement *node, ThreadData *info) if (strchr(from, '@') == nullptr) { UI_SAFE_NOTIFY(m_pDlgServiceDiscovery, WM_JABBER_TRANSPORT_REFRESH); } - debugLogA("%s (%s) online, set contact status to %S", nick, from, Clist_GetStatusModeDescription(status, 0)); + debugLogA("%s (%s) online, set contact status to %s", nick, from, T2Utf(Clist_GetStatusModeDescription(status, 0))); if (m_bEnableAvatars) { bool bHasAvatar = false, bRemovedAvatar = false; @@ -1896,7 +1897,7 @@ void CJabberProto::SetRegConfig(TiXmlElement *node, void *from) iqIdRegSetReg = SerialNext(); char text[MAX_PATH]; - mir_snprintf(text, "%s@%S", g_pRegInfo->conn.username, g_pRegInfo->conn.server); + mir_snprintf(text, "%s@%s", g_pRegInfo->conn.username, g_pRegInfo->conn.server); XmlNodeIq iq("set", iqIdRegSetReg, (const char*)from); iq << XATTR("from", text); TiXmlElement *query = iq << XQUERY(JABBER_FEAT_REGISTER); -- cgit v1.2.3