summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r--protocols/JabberG/src/jabber_byte.cpp2
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp14
-rw-r--r--protocols/JabberG/src/jabber_events.cpp4
-rw-r--r--protocols/JabberG/src/jabber_file.cpp4
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp4
-rwxr-xr-xprotocols/JabberG/src/jabber_iqid.cpp2
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp4
-rwxr-xr-xprotocols/JabberG/src/jabber_misc.cpp8
-rwxr-xr-xprotocols/JabberG/src/jabber_opt.cpp2
-rw-r--r--protocols/JabberG/src/jabber_search.cpp2
-rw-r--r--protocols/JabberG/src/jabber_secur.cpp6
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp6
12 files changed, 29 insertions, 29 deletions
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp
index 58fabd9362..bb40258434 100644
--- a/protocols/JabberG/src/jabber_byte.cpp
+++ b/protocols/JabberG/src/jabber_byte.cpp
@@ -502,7 +502,7 @@ int CJabberProto::ByteSendProxyParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jb
data[4] = 40;
char szAuthString[256];
- mir_snprintf(szAuthString, "%s%s%s", jbt->sid, ptrA(JabberPrepareJid(jbt->srcJID)), ptrA(JabberPrepareJid(jbt->dstJID)));
+ mir_snprintf(szAuthString, "%s%s%s", jbt->sid, ptrA(JabberPrepareJid(jbt->srcJID)).get(), ptrA(JabberPrepareJid(jbt->dstJID)).get());
debugLogA("Auth: '%s'", szAuthString);
JabberShaStrBuf buf;
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index c0e3fa6923..d1ff8e9e93 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -178,16 +178,16 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus
switch (type) {
case INFO_BAN:
if (m_bGcLogBans)
- buf.Format(TranslateU("User %s is now banned."), user->m_szResourceName);
+ buf.Format(TranslateU("User %s is now banned."), user->m_szResourceName.get());
break;
case INFO_STATUS:
if (m_bGcLogStatuses) {
wchar_t *ptszDescr = Clist_GetStatusModeDescription(user->m_iStatus, 0);
if (user->m_szStatusMessage)
- buf.Format(TranslateU("User %s changed status to %s with message: %s"), user->m_szResourceName, ptszDescr, user->m_szStatusMessage);
+ buf.Format(TranslateU("User %s changed status to %s with message: %s"), user->m_szResourceName.get(), ptszDescr, user->m_szStatusMessage.get());
else
- buf.Format(TranslateU("User %s changed status to %s"), user->m_szResourceName, ptszDescr);
+ buf.Format(TranslateU("User %s changed status to %s"), user->m_szResourceName.get(), ptszDescr);
}
break;
@@ -207,7 +207,7 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus
case AFFILIATION_OUTCAST: name = TranslateU("Outcast"); break;
}
if (name)
- buf.Format(TranslateU("Affiliation of %s was changed to '%s'."), user->m_szResourceName, name);
+ buf.Format(TranslateU("Affiliation of %s was changed to '%s'."), user->m_szResourceName.get(), name);
}
break;
@@ -222,7 +222,7 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus
}
if (name)
- buf.Format(TranslateU("Role of %s was changed to '%s'."), user->m_szResourceName, name);
+ buf.Format(TranslateU("Role of %s was changed to '%s'."), user->m_szResourceName.get(), name);
}
break;
}
@@ -839,7 +839,7 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
SendDlgItemMessage(hwndDlg, IDC_ICO_STATUS, STM_SETICON, (WPARAM)Skin_LoadProtoIcon(dat->ppro->m_szModuleName, dat->him->m_iStatus), 0);
char buf[256];
- mir_snprintf(buf, TranslateU("%s from\n%s"), dat->him->m_szResourceName, dat->item->jid);
+ mir_snprintf(buf, TranslateU("%s from\n%s"), dat->him->m_szResourceName.get(), dat->item->jid);
SetDlgItemTextUtf(hwndDlg, IDC_HEADERBAR, buf);
SetDlgItemTextUtf(hwndDlg, IDC_TXT_NICK, dat->him->m_szResourceName);
@@ -998,7 +998,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
// do not use snprintf to avoid possible problems with % symbol
if (char *p = strstr(szMessage, "%s")) {
*p = 0;
- buf.Format("%s%s%s", szMessage, him->m_szResourceName, p + 2);
+ buf.Format("%s%s%s", szMessage.get(), him->m_szResourceName.get(), p + 2);
}
else buf = szMessage;
buf.Replace("%%", "%");
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp
index 936d97c7e9..8bc1189fdf 100644
--- a/protocols/JabberG/src/jabber_events.cpp
+++ b/protocols/JabberG/src/jabber_events.cpp
@@ -121,7 +121,7 @@ void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, MCONTACT
ptrA newNick(sttSettingToTchar(cws));
if (newNick && mir_strcmp(item->nick, newNick)) {
- debugLogA("Renaming contact %s: %s -> %s", item->jid, item->nick, newNick);
+ debugLogA("Renaming contact %s: %s -> %s", item->jid, item->nick, newNick.get());
AddContactToRoster(item->jid, newNick, item->group);
}
}
@@ -132,7 +132,7 @@ void __cdecl CJabberProto::OnAddContactForever(MCONTACT hContact)
if (jid == nullptr)
return;
- debugLogA("Add %s permanently to list", jid);
+ debugLogA("Add %s permanently to list", jid.get());
ptrA nick(db_get_utfa(hContact, "CList", "MyHandle"));
if (nick == nullptr)
nick = getUStringA(hContact, "Nick");
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp
index 1d0f2e007e..7d6d767e52 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -100,7 +100,7 @@ int CJabberProto::FileReceiveParse(filetransfer *ft, char* buffer, int datalen)
break;
}
- debugLogA("FT Got: %s", str);
+ debugLogA("FT Got: %s", str.get());
if (ft->state == FT_CONNECTING) {
// looking for "HTTP/1.1 200 OK"
if (sscanf(str, "HTTP/%*d.%*d %d %*s", &code) == 1 && code == 200) {
@@ -292,7 +292,7 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft)
}
char szAddr[256];
- mir_snprintf(szAddr, "http://%s:%d/%s", myAddr, nlb.wPort, pFileName.c_str());
+ mir_snprintf(szAddr, "http://%s:%d/%s", myAddr.get(), nlb.wPort, pFileName.c_str());
XmlNodeIq iq("set", ft->szId, MakeJid(ft->jid, ptszResource));
TiXmlElement *query = iq << XQUERY(JABBER_FEAT_OOB);
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 7e18ceae1b..d0758f3faf 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -457,7 +457,7 @@ public:
break;
char jid[JABBER_MAX_JID_LEN];
- mir_snprintf(jid, "%s@%s (%s)", info.m_room, info.m_server, info.m_nick ? info.m_nick : TranslateU("<no nick>"));
+ mir_snprintf(jid, "%s@%s (%s)", info.m_room.get(), info.m_server.get(), info.m_nick ? info.m_nick.get() : TranslateU("<no nick>"));
SetDlgItemTextUtf(m_hwnd, IDC_RECENT1 + i, jid);
}
sttJoinDlgShowRecentItems(m_hwnd, i);
@@ -737,7 +737,7 @@ static VOID CALLBACK JabberGroupchatChangeNickname(void* arg)
JABBER_LIST_ITEM *item = param->ppro->ListGetItemPtr(LIST_CHATROOM, param->jid);
if (item != nullptr) {
CMStringW szBuffer, szTitle;
- szTitle.Format(TranslateT("Change nickname in <%s>"), item->name ? item->name : Utf2T(item->jid));
+ szTitle.Format(TranslateT("Change nickname in <%s>"), item->name ? item->name : Utf2T(item->jid).get());
if (item->nick)
szBuffer = Utf2T(item->nick);
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index d390839d85..eb528f544b 100755
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -238,7 +238,7 @@ void CJabberProto::OnIqResultGetAuth(const TiXmlElement *iqNode, CJabberIqInfo*)
if (XmlFirstChild(queryNode, "digest") != nullptr && m_ThreadInfo->szStreamId) {
JabberShaStrBuf buf;
char text[200];
- mir_snprintf(text, "%s%s", m_ThreadInfo->szStreamId, m_ThreadInfo->conn.password);
+ mir_snprintf(text, "%s%s", m_ThreadInfo->szStreamId.get(), m_ThreadInfo->conn.password);
query << XCHILD("digest", JabberSha1(text, buf));
}
else if (XmlFirstChild(queryNode, "password") != nullptr)
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index bdd1684ca2..e2a35eb5c0 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -396,7 +396,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
}
CMStringW szTmp;
- szTmp.Format(L"%s [%s, %d]", Utf2T(r->m_szResourceName), Clist_GetStatusModeDescription(r->m_iStatus, 0), r->m_iPriority);
+ szTmp.Format(L"%s [%s, %d]", Utf2T(r->m_szResourceName).get(), Clist_GetStatusModeDescription(r->m_iStatus, 0), r->m_iPriority);
Menu_ModifyItem(m_phMenuResourceItems[i], szTmp, hIcon);
DestroyIcon(hIcon);
}
@@ -948,7 +948,7 @@ int CJabberProto::OnProcessSrmmIconClick(WPARAM hContact, LPARAM lParam)
wchar_t buf[256];
mir_snwprintf(buf, TranslateT("Last active (%s)"),
- LI->m_pLastSeenResource ? Utf2T(LI->m_pLastSeenResource->m_szResourceName) : TranslateT("No activity yet, use server's choice"));
+ LI->m_pLastSeenResource ? Utf2T(LI->m_pLastSeenResource->m_szResourceName.get()) : TranslateT("No activity yet, use server's choice"));
AppendMenu(hMenu, MF_STRING, MENUITEM_LASTSEEN, buf);
AppendMenu(hMenu, MF_STRING, MENUITEM_SERVER, TranslateT("Highest priority (server's choice)"));
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index b6ef4735d9..ed77e4595a 100755
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -135,7 +135,7 @@ BOOL CJabberProto::AddDbPresenceEvent(MCONTACT hContact, BYTE btEventType)
void CJabberProto::GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen)
{
- int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARSW(L"%miranda_avatarcache%"), m_szModuleName);
+ int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARSW(L"%miranda_avatarcache%").get(), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(pszDest);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
@@ -290,14 +290,14 @@ void CJabberProto::FormatMirVer(const pResourceStatus &resource, CMStringA &res)
// no caps info? set MirVer = resource name
if (resource->m_pCaps == nullptr) {
- debugLogA("JabberUpdateMirVer: for rc %s: %s", resource->m_szResourceName, resource->m_szResourceName);
+ debugLogA("JabberUpdateMirVer: for rc %s: %s", resource->m_szResourceName.get(), resource->m_szResourceName.get());
if (resource->m_szResourceName)
res = resource->m_szResourceName;
}
// XEP-0115 caps mode
else {
CJabberClientPartialCaps *pCaps = resource->m_pCaps;
- debugLogA("JabberUpdateMirVer: for rc %s: %s#%s", resource->m_szResourceName, pCaps->GetNode(), pCaps->GetHash());
+ debugLogA("JabberUpdateMirVer: for rc %s: %s#%s", resource->m_szResourceName.get(), pCaps->GetNode(), pCaps->GetHash());
// unknown software
const char *szDefaultName = GetSoftName(pCaps->GetNode());
@@ -331,7 +331,7 @@ void CJabberProto::FormatMirVer(const pResourceStatus &resource, CMStringA &res)
if (resource->m_szResourceName && !strstr(res, resource->m_szResourceName))
if (strstr(res, "Miranda IM") || strstr(res, "Miranda NG") || m_bShowForeignResourceInMirVer)
- res.AppendFormat(" [%s]", resource->m_szResourceName);
+ res.AppendFormat(" [%s]", resource->m_szResourceName.get());
}
void CJabberProto::UpdateMirVer(MCONTACT hContact, const pResourceStatus &r)
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index c8eb921250..c45e89aa23 100755
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -326,7 +326,7 @@ CCtrlEditJid::CCtrlEditJid(CDlgBase* dlg, int ctrlId):
static void sttStoreJidFromUI(CJabberProto *ppro, CCtrlEdit &txtUsername, CCtrlCombo &cbServer)
{
- ppro->setWString("jid", CMStringW(FORMAT, L"%s@%s", ptrW(txtUsername.GetText()), ptrW(cbServer.GetText())));
+ ppro->setWString("jid", CMStringW(FORMAT, L"%s@%s", ptrW(txtUsername.GetText()).get(), ptrW(cbServer.GetText()).get()));
}
class CDlgOptAccount : public CJabberDlgBase
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp
index 24bdfe9ce4..ee0e59b825 100644
--- a/protocols/JabberG/src/jabber_search.cpp
+++ b/protocols/JabberG/src/jabber_search.cpp
@@ -273,7 +273,7 @@ static void SearchReturnResults(CJabberProto *ppro, HANDLE id, LIST<UNIQUE_MAP>
Utf2T wszNick(nick);
wchar_t buff[200];
if (mir_wstrcmpi(wszNick, Results.psr.id.w))
- mir_snwprintf(buff, L"%s (%s)", wszNick, Results.psr.id.w);
+ mir_snwprintf(buff, L"%s (%s)", wszNick.get(), Results.psr.id.w);
else
wcsncpy_s(buff, wszNick, _TRUNCATE);
diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp
index 5d807f51d6..3e95bc9a39 100644
--- a/protocols/JabberG/src/jabber_secur.cpp
+++ b/protocols/JabberG/src/jabber_secur.cpp
@@ -197,7 +197,7 @@ char* TMD5Auth::getChallenge(const char *challenge)
int cbLen = mir_snprintf(buf, 8000,
"username=\"%s\",realm=\"%s\",nonce=\"%s\",cnonce=\"%s\",nc=%08d,"
"qop=auth,digest-uri=\"xmpp/%s\",charset=utf-8,response=%08x%08x%08x%08x",
- info->conn.username, realm, nonce, cnonce, iCallCount, serv,
+ info->conn.username, realm, nonce, cnonce, iCallCount, serv.get(),
htonl(digest[0]), htonl(digest[1]), htonl(digest[2]), htonl(digest[3]));
return mir_base64_encode(buf, cbLen);
@@ -276,7 +276,7 @@ char* TScramAuth::getChallenge(const char *challenge)
mir_sha1_finish(&ctx, storedKey);
char authmsg[4096];
- int authmsgLen = mir_snprintf(authmsg, "%s,%s,c=biws,r=%s", msg1, chl, snonce);
+ int authmsgLen = mir_snprintf(authmsg, "%s,%s,c=biws,r=%s", msg1, chl.get(), snonce.get());
BYTE clientSig[MIR_SHA1_HASH_SIZE];
HMAC(EVP_sha1(), storedKey, sizeof(storedKey), (BYTE*)authmsg, authmsgLen, clientSig, &len);
@@ -295,7 +295,7 @@ char* TScramAuth::getChallenge(const char *challenge)
char buf[4096];
ptrA encproof(mir_base64_encode(clientProof, sizeof(clientProof)));
- int cbLen = mir_snprintf(buf, "c=biws,r=%s,p=%s", snonce, encproof);
+ int cbLen = mir_snprintf(buf, "c=biws,r=%s,p=%s", snonce.get(), encproof.get());
return mir_base64_encode(buf, cbLen);
}
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index bd146d967a..57e18df43f 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -1541,7 +1541,7 @@ void CJabberProto::UpdateJidDbSettings(const char *jid)
item->getTemp()->m_iStatus = status;
if (nSelectedResource != -1) {
pResourceStatus r(item->arResources[nSelectedResource]);
- debugLogA("JabberUpdateJidDbSettings: updating jid %s to rc %s", item->jid, r->m_szResourceName);
+ debugLogA("JabberUpdateJidDbSettings: updating jid %s to rc %s", item->jid, r->m_szResourceName.get());
if (r->m_szStatusMessage)
db_set_utf(hContact, "CList", "StatusMsg", r->m_szStatusMessage);
else
@@ -1631,7 +1631,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, T2Utf(Clist_GetStatusModeDescription(status, 0)));
+ debugLogA("%s (%s) online, set contact status to %s", nick.get(), from, T2Utf(Clist_GetStatusModeDescription(status, 0)).get());
if (m_bEnableAvatars) {
bool bHasAvatar = false, bRemovedAvatar = false;
@@ -1739,7 +1739,7 @@ void CJabberProto::OnProcessPresence(const TiXmlElement *node, ThreadData *info)
RebuildInfoFrame();
}
else {
- debugLogA("%s (%s) requests authorization", szNick, from);
+ debugLogA("%s (%s) requests authorization", szNick.get(), from);
DBAddAuthRequest(from, szNick);
}
return;