diff options
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r-- | protocols/JabberG/src/jabber_byte.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_caps.cpp | 6 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_events.cpp | 6 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_icolib.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_iq.cpp | 4 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_iq_handlers.cpp | 4 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_iqid.cpp | 18 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_message_manager.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_misc.cpp | 37 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_password.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.cpp | 10 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.h | 3 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_secur.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_svc.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_thread.cpp | 26 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_userinfo.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_vcard.cpp | 10 |
17 files changed, 68 insertions, 70 deletions
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index dc1e7f2c08..2f795f0872 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -641,7 +641,7 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt) if (jbt->streamhostJID) mir_free(jbt->streamhostJID);
jbt->streamhostJID = mir_tstrdup(str);
- Log("bytestream_recv connecting to " TCHAR_STR_PARAM ":%d", szHost, port);
+ Log("bytestream_recv connecting to %S:%d", szHost, port);
NETLIBOPENCONNECTION nloc = { 0 };
nloc.cbSize = sizeof(nloc);
nloc.szHost = mir_t2a(szHost);
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp index ac1399cf9a..62de2039b7 100644 --- a/protocols/JabberG/src/jabber_caps.cpp +++ b/protocols/JabberG/src/jabber_caps.cpp @@ -575,12 +575,12 @@ JabberCapsBits CJabberClientCapsManager::GetClientCaps(TCHAR *szNode, TCHAR *szV CJabberClientCaps *pClient = FindClient(szNode);
if ( !pClient) {
Unlock();
- ppro->Log("CAPS: get no caps for: " TCHAR_STR_PARAM ", " TCHAR_STR_PARAM, szNode, szVer);
+ ppro->Log("CAPS: get no caps for: %S, %S", szNode, szVer);
return JABBER_RESOURCE_CAPS_UNINIT;
}
JabberCapsBits jcbCaps = pClient->GetPartialCaps(szVer);
Unlock();
- ppro->Log("CAPS: get caps %I64x for: " TCHAR_STR_PARAM ", " TCHAR_STR_PARAM, jcbCaps, szNode, szVer);
+ ppro->Log("CAPS: get caps %I64x for: %S, %S", jcbCaps, szNode, szVer);
return jcbCaps;
}
@@ -599,7 +599,7 @@ BOOL CJabberClientCapsManager::SetClientCaps(const TCHAR *szNode, const TCHAR *s }
BOOL bOk = pClient->SetPartialCaps(szVer, jcbCaps, nIqId);
Unlock();
- ppro->Log("CAPS: set caps %I64x for: " TCHAR_STR_PARAM ", " TCHAR_STR_PARAM, jcbCaps, szNode, szVer);
+ ppro->Log("CAPS: set caps %I64x for: %S, %S", jcbCaps, szNode, szVer);
return bOk;
}
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp index 290b756e71..32e71215ea 100644 --- a/protocols/JabberG/src/jabber_events.cpp +++ b/protocols/JabberG/src/jabber_events.cpp @@ -117,7 +117,7 @@ void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING* cws, HANDLE hCon else {
TCHAR* p = sttSettingToTchar(cws);
if (cws->value.pszVal != NULL && lstrcmp(p, item->group)) {
- Log("Group set to " TCHAR_STR_PARAM, p);
+ Log("Group set to %S", p);
if (p)
AddContactToRoster(item->jid, nick, p);
}
@@ -147,7 +147,7 @@ void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING* cws, HANDLE hC TCHAR* newNick = sttSettingToTchar(cws);
if (newNick) {
if (lstrcmp(item->nick, newNick)) {
- Log("Renaming contact " TCHAR_STR_PARAM ": " TCHAR_STR_PARAM " -> " TCHAR_STR_PARAM, item->jid, item->nick, newNick);
+ Log("Renaming contact %S: %S -> %S", item->jid, item->nick, newNick);
AddContactToRoster(item->jid, newNick, item->group);
}
mir_free(newNick);
@@ -163,7 +163,7 @@ void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING* cws, HANDL return;
TCHAR *nick;
- Log("Add " TCHAR_STR_PARAM " permanently to list", jid.pszVal);
+ Log("Add %S permanently to list", jid.pszVal);
if ( !DBGetContactSettingTString(hContact, "CList", "MyHandle", &dbv)) {
nick = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 57ae08257b..b6d2525fcf 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -325,7 +325,7 @@ int CJabberProto::LoadAdvancedIcons(int iID) int first=-1;
HICON empty=LoadSmallIcon(NULL,MAKEINTRESOURCE(102));
- mir_sntprintf(Group, SIZEOF(Group), _T("Status Icons/%s/") _T(TCHAR_STR_PARAM) _T(" %s"), m_tszUserName, proto, TranslateT("transport"));
+ mir_sntprintf(Group, SIZEOF(Group), _T("Status Icons/%s/%S %s"), m_tszUserName, proto, TranslateT("transport"));
mir_snprintf(defFile, SIZEOF(defFile), "proto_%s.dll",proto);
if ( !hAdvancedStatusIcon)
hAdvancedStatusIcon=(HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST,0,0);
diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp index a92ba930fe..6be5980c54 100644 --- a/protocols/JabberG/src/jabber_iq.cpp +++ b/protocols/JabberG/src/jabber_iq.cpp @@ -232,7 +232,7 @@ void CJabberIqManager::ExpireInfo(CJabberIqInfo* pInfo, void*) if ((pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_HCONTACT) && (pInfo->m_szFrom))
pInfo->m_hContact = ppro->HContactFromJID(pInfo->m_szFrom , 3);
- ppro->Log("Expiring iq id %d, sent to " TCHAR_STR_PARAM, pInfo->m_nIqId, pInfo->m_szReceiver ? pInfo->m_szReceiver : _T("server"));
+ ppro->Log("Expiring iq id %d, sent to %S", pInfo->m_nIqId, pInfo->m_szReceiver ? pInfo->m_szReceiver : _T("server"));
pInfo->m_nIqType = JABBER_IQ_TYPE_FAIL;
(ppro->*(pInfo->m_pHandler))(NULL, pInfo);
@@ -360,7 +360,7 @@ BOOL CJabberIqManager::HandleIqPermanent(HXML pNode) if ((pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_HCONTACT) && (iqInfo.m_szFrom))
iqInfo.m_hContact = ppro->HContactFromJID(iqInfo.m_szFrom, 3);
- ppro->Log("Handling iq id " TCHAR_STR_PARAM ", type " TCHAR_STR_PARAM ", from " TCHAR_STR_PARAM, iqInfo.m_szId, szType, iqInfo.m_szFrom);
+ ppro->Log("Handling iq id %S, type %S, from %S", iqInfo.m_szId, szType, iqInfo.m_szFrom);
if ((ppro->*(pInfo->m_pHandler))(pNode, &iqInfo)) {
bStopHandling = TRUE;
break;
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 459f917fbe..5868e93f82 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -555,7 +555,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo) // invalid JID
if ( !bRetVal) {
- Log("<iq/> attempt to hack via roster push from " TCHAR_STR_PARAM, pInfo->GetFrom());
+ Log("<iq/> attempt to hack via roster push from %S", pInfo->GetFrom());
return TRUE;
}
}
@@ -631,7 +631,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo) else if ( !_tcscmp(str, _T("to"))) item->subscription = SUB_TO;
else if ( !_tcscmp(str, _T("from"))) item->subscription = SUB_FROM;
else item->subscription = SUB_NONE;
- Log("Roster push for jid=" TCHAR_STR_PARAM ", set subscription to " TCHAR_STR_PARAM, jid, str);
+ Log("Roster push for jid=%S, set subscription to %S", jid, str);
// subscription = remove is to remove from roster list
// but we will just set the contact to offline and not actually
// remove, so that history will be retained.
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 628c9018d0..56f181e658 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -308,9 +308,9 @@ void CJabberProto::OnIqResultBind(HXML iqNode, CJabberIqInfo* pInfo) LPCTSTR szJid = XPathT(iqNode, "bind[@xmlns='urn:ietf:params:xml:ns:xmpp-bind']/jid");
if (szJid) {
if ( !_tcsncmp(m_ThreadInfo->fullJID, szJid, SIZEOF(m_ThreadInfo->fullJID)))
- Log("Result Bind: " TCHAR_STR_PARAM " confirmed ", m_ThreadInfo->fullJID);
+ Log("Result Bind: %S confirmed ", m_ThreadInfo->fullJID);
else {
- Log("Result Bind: " TCHAR_STR_PARAM " changed to " TCHAR_STR_PARAM, m_ThreadInfo->fullJID, szJid);
+ Log("Result Bind: %S changed to %S", m_ThreadInfo->fullJID, szJid);
_tcsncpy(m_ThreadInfo->fullJID, szJid, SIZEOF(m_ThreadInfo->fullJID));
}
}
@@ -542,7 +542,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo* pInfo) DBVARIANT dbv;
if ( !JGetStringT(hContact, "jid", &dbv)) {
if ( !ListExist(LIST_ROSTER, dbv.ptszVal)) {
- Log("Syncing roster: preparing to delete " TCHAR_STR_PARAM " (hContact=0x%x)", dbv.ptszVal, hContact);
+ Log("Syncing roster: preparing to delete %S (hContact=0x%x)", dbv.ptszVal, hContact);
if (listSize >= listAllocSize) {
listAllocSize = listSize + 100;
if ((list=(HANDLE *) mir_realloc(list, listAllocSize * sizeof(HANDLE))) == NULL) {
@@ -688,7 +688,7 @@ LBL_Ret: TCHAR szAvatarFileName[MAX_PATH];
GetAvatarFileName(hContact, szAvatarFileName, SIZEOF(szAvatarFileName));
- Log("Picture file name set to " TCHAR_STR_PARAM, szAvatarFileName);
+ Log("Picture file name set to %S", szAvatarFileName);
HANDLE hFile = CreateFile(szAvatarFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
goto LBL_Ret;
@@ -705,7 +705,7 @@ LBL_Ret: hasPhoto = TRUE;
CallService(MS_AV_SETMYAVATART, (WPARAM)m_szModuleName, (LPARAM)szAvatarFileName);
- Log("My picture saved to " TCHAR_STR_PARAM, szAvatarFileName);
+ Log("My picture saved to %S", szAvatarFileName);
}
else {
DBVARIANT dbv;
@@ -720,7 +720,7 @@ LBL_Ret: if (item->photoFileName && _tcscmp(item->photoFileName, szAvatarFileName))
DeleteFile(item->photoFileName);
replaceStrT(item->photoFileName, szAvatarFileName);
- Log("Contact's picture saved to " TCHAR_STR_PARAM, szAvatarFileName);
+ Log("Contact's picture saved to %S", szAvatarFileName);
OnIqResultGotAvatar(hContact, o, xmlGetText(m));
}
@@ -1254,7 +1254,7 @@ void CJabberProto::OnIqResultSetSearch(HXML iqNode) _tcsncpy(jsr.jid, jid, SIZEOF(jsr.jid));
jsr.jid[ SIZEOF(jsr.jid)-1] = '\0';
jsr.hdr.id = (TCHAR*)jid;
- Log("Result jid = " TCHAR_STR_PARAM, jid);
+ Log("Result jid = %S", jid);
if ((n=xmlGetChild(itemNode , "nick"))!=NULL && xmlGetText(n)!=NULL)
jsr.hdr.nick = (TCHAR*)xmlGetText(n);
else
@@ -1325,7 +1325,7 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode) if ( !lstrcmp(fieldName, _T("jid"))) {
_tcsncpy(jsr.jid, xmlGetText(n), SIZEOF(jsr.jid));
jsr.jid[SIZEOF(jsr.jid)-1] = '\0';
- Log("Result jid = " TCHAR_STR_PARAM, jsr.jid);
+ Log("Result jid = %S", jsr.jid);
}
else if ( !lstrcmp(fieldName, _T("nickname")))
jsr.hdr.nick = (xmlGetText(n) != NULL) ? (TCHAR*)xmlGetText(n) : _T("");
@@ -1523,7 +1523,7 @@ void CJabberProto::OnIqResultGotAvatar(HANDLE hContact, HXML n, const TCHAR *mim else if ( !lstrcmp(mimeType, _T("image/bmp"))) pictureType = PA_FORMAT_BMP;
else {
LBL_ErrFormat:
- Log("Invalid mime type specified for picture: " TCHAR_STR_PARAM, mimeType);
+ Log("Invalid mime type specified for picture: %S", mimeType);
mir_free(body);
return;
} }
diff --git a/protocols/JabberG/src/jabber_message_manager.cpp b/protocols/JabberG/src/jabber_message_manager.cpp index 2f7b6ab035..f260004f87 100644 --- a/protocols/JabberG/src/jabber_message_manager.cpp +++ b/protocols/JabberG/src/jabber_message_manager.cpp @@ -92,7 +92,7 @@ BOOL CJabberMessageManager::HandleMessagePermanent(HXML node, ThreadData *pThrea messageInfo.m_hContact = ppro->HContactFromJID(messageInfo.m_szFrom, 3);
if (messageInfo.m_szFrom)
- ppro->Log("Handling message from " TCHAR_STR_PARAM, messageInfo.m_szFrom);
+ ppro->Log("Handling message from %S", messageInfo.m_szFrom);
if ((ppro->*(pInfo->m_pHandler))(node, pThreadData, &messageInfo)) {
bStopHandling = TRUE;
break;
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index ce13696af7..f2b4b12c42 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -202,7 +202,7 @@ HANDLE CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL t db_set_b(hContact, "CList", "NotOnList", 1);
else
SendGetVcard(s);
- Log("Create Jabber contact jid=" TCHAR_STR_PARAM ", nick=" TCHAR_STR_PARAM, s, nick);
+ Log("Create Jabber contact jid=%S, nick=%S", s, nick);
DBCheckIsTransportedContact(s,hContact);
}
@@ -246,18 +246,15 @@ BOOL CJabberProto::AddDbPresenceEvent(HANDLE hContact, BYTE btEventType) ///////////////////////////////////////////////////////////////////////////////
// JabberGetAvatarFileName() - gets a file name for the avatar image
-static HANDLE hJabberAvatarsFolder = NULL;
-static bool bInitDone = false;
-
void CJabberProto::InitCustomFolders(void)
{
- if (bInitDone)
+ if (m_bFoldersInitDone)
return;
- bInitDone = true;
+ m_bFoldersInitDone = true;
TCHAR AvatarsFolder[MAX_PATH];
- mir_sntprintf(AvatarsFolder, SIZEOF(AvatarsFolder), _T("%%miranda_avatarcache%%\\Jabber"));
- hJabberAvatarsFolder = FoldersRegisterCustomPathT(m_szModuleName, "Avatars", AvatarsFolder);
+ mir_sntprintf(AvatarsFolder, SIZEOF(AvatarsFolder), _T("%%miranda_avatarcache%%\\%S"), m_szModuleName);
+ m_hJabberAvatarsFolder = FoldersRegisterCustomPathT("Avatars", m_szModuleName, AvatarsFolder);
}
void CJabberProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen)
@@ -267,12 +264,10 @@ void CJabberProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbL InitCustomFolders();
- if (hJabberAvatarsFolder == NULL || FoldersGetCustomPathT(hJabberAvatarsFolder, path, (int)cbLen, _T(""))) {
- TCHAR *tmpPath = Utils_ReplaceVarsT(_T("%miranda_avatarcache%"));
- tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\Jabber"), tmpPath);
- mir_free(tmpPath);
- }
- else tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s"), path);
+ if (m_hJabberAvatarsFolder == NULL || FoldersGetCustomPathT(m_hJabberAvatarsFolder, path, (int)cbLen, _T("")))
+ tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), (TCHAR*)VARST(_T("%miranda_avatarcache%")), m_szModuleName);
+ else
+ tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s"), path);
DWORD dwAttributes = GetFileAttributes(pszDest);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
@@ -299,18 +294,18 @@ void CJabberProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbL else _i64toa((LONG_PTR)hContact, str, 10);
char* hash = JabberSha1(str);
- mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, _T(TCHAR_STR_PARAM) _T(".") _T(TCHAR_STR_PARAM), hash, szFileType);
+ mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, _T("%S.%S"), hash, szFileType);
mir_free(hash);
}
else if (m_ThreadInfo != NULL) {
- mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, _T("%s@") _T(TCHAR_STR_PARAM) _T(" avatar.") _T(TCHAR_STR_PARAM),
+ mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, _T("%s@%S avatar.%S"),
m_ThreadInfo->username, m_ThreadInfo->server, szFileType);
}
else {
DBVARIANT dbv1, dbv2;
BOOL res1 = DBGetContactSettingString(NULL, m_szModuleName, "LoginName", &dbv1);
BOOL res2 = DBGetContactSettingString(NULL, m_szModuleName, "LoginServer", &dbv2);
- mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, _T(TCHAR_STR_PARAM) _T("@") _T(TCHAR_STR_PARAM) _T(" avatar.") _T(TCHAR_STR_PARAM),
+ mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, _T("%S@%S avatar.%S"),
res1 ? "noname" : dbv1.pszVal,
res2 ? m_szModuleName : dbv2.pszVal,
szFileType);
@@ -463,7 +458,7 @@ void CJabberProto::UpdateMirVer(JABBER_LIST_ITEM *item) if ( !hContact)
return;
- Log("JabberUpdateMirVer: for jid " TCHAR_STR_PARAM, item->jid);
+ Log("JabberUpdateMirVer: for jid %S", item->jid);
int resource = -1;
if (item->resourceMode == RSMODE_LASTSEEN)
@@ -484,7 +479,7 @@ void CJabberProto::FormatMirVer(JABBER_RESOURCE_STATUS *resource, TCHAR *buf, in // jabber:iq:version info requested and exists?
if (resource->dwVersionRequestTime && resource->software) {
- Log("JabberUpdateMirVer: for iq:version rc " TCHAR_STR_PARAM ": " TCHAR_STR_PARAM, resource->resourceName, resource->software);
+ Log("JabberUpdateMirVer: for iq:version rc %S: %S", resource->resourceName, resource->software);
if ( !resource->version || _tcsstr(resource->software, resource->version))
lstrcpyn(buf, resource->software, bufSize);
else
@@ -492,13 +487,13 @@ void CJabberProto::FormatMirVer(JABBER_RESOURCE_STATUS *resource, TCHAR *buf, in }
// no version info and no caps info? set MirVer = resource name
else if ( !resource->szCapsNode || !resource->szCapsVer) {
- Log("JabberUpdateMirVer: for rc " TCHAR_STR_PARAM ": " TCHAR_STR_PARAM, resource->resourceName, resource->resourceName);
+ Log("JabberUpdateMirVer: for rc %S: %S", resource->resourceName, resource->resourceName);
if (resource->resourceName)
lstrcpyn(buf, resource->resourceName, bufSize);
}
// XEP-0115 caps mode
else {
- Log("JabberUpdateMirVer: for rc " TCHAR_STR_PARAM ": " TCHAR_STR_PARAM "#" TCHAR_STR_PARAM, resource->resourceName, resource->szCapsNode, resource->szCapsVer);
+ Log("JabberUpdateMirVer: for rc %S: %S#%S", resource->resourceName, resource->szCapsNode, resource->szCapsVer);
int i;
diff --git a/protocols/JabberG/src/jabber_password.cpp b/protocols/JabberG/src/jabber_password.cpp index 341788cf29..e0da9c6fd3 100644 --- a/protocols/JabberG/src/jabber_password.cpp +++ b/protocols/JabberG/src/jabber_password.cpp @@ -49,7 +49,7 @@ static INT_PTR CALLBACK JabberChangePasswordDlgProc(HWND hwndDlg, UINT msg, WPAR TranslateDialogDefault(hwndDlg);
if (ppro->m_bJabberOnline && ppro->m_ThreadInfo!=NULL) {
TCHAR text[1024];
- mir_sntprintf(text, SIZEOF(text), _T("%s %s@") _T(TCHAR_STR_PARAM), TranslateT("Set New Password for"), ppro->m_ThreadInfo->username, ppro->m_ThreadInfo->server);
+ mir_sntprintf(text, SIZEOF(text), _T("%s %s@%S"), TranslateT("Set New Password for"), ppro->m_ThreadInfo->username, ppro->m_ThreadInfo->server);
SetWindowText(hwndDlg, text);
}
return TRUE;
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 7eeeb47a52..eb81e2002a 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -360,12 +360,12 @@ HANDLE CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags) HANDLE hContact;
TCHAR* jid, *nick;
- Log("AddToListByJID jid = " TCHAR_STR_PARAM, newJid);
+ Log("AddToListByJID jid = %S", newJid);
if ((hContact=HContactFromJID(newJid)) == NULL) {
// not already there: add
jid = mir_tstrdup(newJid);
- Log("Add new jid to contact jid = " TCHAR_STR_PARAM, jid);
+ Log("Add new jid to contact jid = %S", jid);
hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
JSetStringT(hContact, "jid", jid);
@@ -473,7 +473,7 @@ int CJabberProto::Authorize(HANDLE hDbEvent) char *lastName = firstName + strlen(firstName) + 1;
char *jid = lastName + strlen(lastName) + 1;
- Log("Send 'authorization allowed' to " TCHAR_STR_PARAM, jid);
+ Log("Send 'authorization allowed' to %S", jid);
TCHAR *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeT(jid) : mir_a2t(jid);
@@ -485,7 +485,7 @@ int CJabberProto::Authorize(HANDLE hDbEvent) JABBER_LIST_ITEM *item;
if ((item = ListGetItemPtr(LIST_ROSTER, newJid)) == NULL || (item->subscription != SUB_BOTH && item->subscription != SUB_TO)) {
- Log("Try adding contact automatically jid = " TCHAR_STR_PARAM, jid);
+ Log("Try adding contact automatically jid = %S", jid);
if ((hContact = AddToListByJID(newJid, 0)) != NULL) {
// Trigger actual add by removing the "NotOnList" added by AddToListByJID()
// See AddToListByJID() and JabberDbSettingChanged().
@@ -1417,7 +1417,7 @@ int __cdecl CJabberProto::SendAwayMsg(HANDLE /*hContact*/, HANDLE /*hProcess*/, int __cdecl CJabberProto::SetAwayMsg(int status, const TCHAR *msg)
{
- Log("SetAwayMsg called, wParam=%d lParam=" TCHAR_STR_PARAM, status, msg);
+ Log("SetAwayMsg called, wParam=%d lParam=%S", status, msg);
EnterCriticalSection(&m_csModeMsgMutex);
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 09a037573c..f37f1f264d 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -991,6 +991,9 @@ private: DWORD m_lastTicks;
+ HANDLE m_hJabberAvatarsFolder;
+ BOOL m_bFoldersInitDone;
+
CRITICAL_SECTION m_csSerial;
unsigned int m_nSerial;
diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp index e15e7eb1a9..eaf8076f2d 100644 --- a/protocols/JabberG/src/jabber_secur.cpp +++ b/protocols/JabberG/src/jabber_secur.cpp @@ -109,7 +109,7 @@ bool TNtlmAuth::getSpn(TCHAR* szSpn, size_t dwSpnLen) mir_free(connectHostT);
}
- Netlib_Logf(NULL, "SPN: " TCHAR_STR_PARAM, szSpn);
+ Netlib_Logf(NULL, "SPN: %S", szSpn);
return true;
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index b9bde4c8bb..af28a302d2 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -164,7 +164,7 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam) }
else lstrcpyn(szJid, dbv.ptszVal, SIZEOF(szJid));
- Log("Rereading %s for " TCHAR_STR_PARAM, isXVcard ? JABBER_FEAT_VCARD_TEMP : JABBER_FEAT_AVATAR, szJid);
+ Log("Rereading %s for %S", isXVcard ? JABBER_FEAT_VCARD_TEMP : JABBER_FEAT_AVATAR, szJid);
int iqId = SerialNext();
if (isXVcard)
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index bea9519b96..eb0e65926f 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -339,7 +339,7 @@ LBL_FatalError: }
TCHAR jidStr[512];
- mir_sntprintf(jidStr, SIZEOF(jidStr), _T("%s@") _T(TCHAR_STR_PARAM) _T("/%s"), info->username, info->server, info->resource);
+ mir_sntprintf(jidStr, SIZEOF(jidStr), _T("%s@%S/%s"), info->username, info->server, info->resource);
_tcsncpy(info->fullJID, jidStr, SIZEOF(info->fullJID)-1);
if (m_options.SavePassword == FALSE) {
@@ -348,7 +348,7 @@ LBL_FatalError: info->password[ SIZEOF(info->password)-1] = '\0';
}
else {
- mir_sntprintf(jidStr, SIZEOF(jidStr), _T("%s@") _T(TCHAR_STR_PARAM), info->username, info->server);
+ mir_sntprintf(jidStr, SIZEOF(jidStr), _T("%s@%S"), info->username, info->server);
JabberPasswordDlgParam param;
param.pro = this;
@@ -459,7 +459,7 @@ LBL_FatalError: m_bJabberConnected = TRUE;
size_t len = _tcslen(info->username) + strlen(info->server)+1;
m_szJabberJID = (TCHAR*)mir_alloc(sizeof(TCHAR)*(len+1));
- mir_sntprintf(m_szJabberJID, len+1, _T("%s@") _T(TCHAR_STR_PARAM), info->username, info->server);
+ mir_sntprintf(m_szJabberJID, len+1, _T("%s@%S"), info->username, info->server);
m_bSendKeepAlive = m_options.KeepAlive != 0;
JSetStringT(NULL, "jid", m_szJabberJID); // store jid in database
}
@@ -744,7 +744,7 @@ void CJabberProto::PerformAuthentication(ThreadData* info) }
TCHAR text[1024];
- mir_sntprintf(text, SIZEOF(text), _T("%s %s@")_T(TCHAR_STR_PARAM)_T("."), TranslateT("Authentication failed for"), info->username, info->server);
+ mir_sntprintf(text, SIZEOF(text), _T("%s %s@%S."), TranslateT("Authentication failed for"), info->username, info->server);
MsgPopup(NULL, text, TranslateT("Jabber Authentication"));
JSendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
info->send("</stream:stream>");
@@ -928,7 +928,7 @@ void CJabberProto::OnProcessSuccess(HXML node, ThreadData* info) db_free(&dbv);
xmlStreamInitialize("after successful sasl");
}
- else Log("Success: unknown action "TCHAR_STR_PARAM".",type);
+ else Log("Success: unknown action %S.",type);
}
void CJabberProto::OnProcessChallenge(HXML node, ThreadData* info)
@@ -1516,7 +1516,7 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node) if ((from = xmlGetAttrValue(node, _T("from"))) == NULL)
return;
- Log("presence: for jid " TCHAR_STR_PARAM, from);
+ Log("presence: for jid %S", from);
JABBER_RESOURCE_STATUS *r = ResourceInfoFromJID(from);
if (r == NULL) return;
@@ -1579,7 +1579,7 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid) }
item->itemResource.status = status;
if (nSelectedResource != -1) {
- Log("JabberUpdateJidDbSettings: updating jid " TCHAR_STR_PARAM " to rc " TCHAR_STR_PARAM, item->jid, item->resource[nSelectedResource].resourceName);
+ Log("JabberUpdateJidDbSettings: updating jid %S to rc %S", item->jid, item->resource[nSelectedResource].resourceName);
if (item->resource[nSelectedResource].statusMessage)
db_set_ts(hContact, "CList", "StatusMsg", item->resource[nSelectedResource].statusMessage);
else
@@ -1638,14 +1638,14 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info) if ((hContact = HContactFromJID(from)) == NULL) {
if ( !_tcsicmp(info->fullJID, from) || (!bSelfPresence && !ListExist(LIST_ROSTER, from))) {
- Log("SKIP Receive presence online from "TCHAR_STR_PARAM" (who is not in my roster and not in list - skiping)", from);
+ Log("SKIP Receive presence online from %S (who is not in my roster and not in list - skiping)", from);
mir_free(nick);
return;
}
hContact = DBCreateContact(from, nick, TRUE, TRUE);
}
if ( !ListExist(LIST_ROSTER, from)) {
- Log("Receive presence online from "TCHAR_STR_PARAM" (who is not in my roster)", from);
+ Log("Receive presence online from %S (who is not in my roster)", from);
ListAdd(LIST_ROSTER, from);
}
DBCheckIsTransportedContact(from, hContact);
@@ -1677,7 +1677,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info) if (_tcschr(from, '@')==NULL) {
UI_SAFE_NOTIFY(m_pDlgServiceDiscovery, WM_JABBER_TRANSPORT_REFRESH);
}
- Log(TCHAR_STR_PARAM " (" TCHAR_STR_PARAM ") online, set contact status to %s", nick, from, CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM)status,0));
+ Log("%S (%S) online, set contact status to %s", nick, from, CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM)status,0));
mir_free(nick);
HXML xNode;
@@ -1762,7 +1762,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info) replaceStrT(item->itemResource.statusMessage, NULL);
}
}
- else Log("SKIP Receive presence offline from " TCHAR_STR_PARAM " (who is not in my roster)", from);
+ else Log("SKIP Receive presence offline from %S (who is not in my roster)", from);
UpdateJidDbSettings(from);
@@ -1784,7 +1784,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info) if (m_options.AutoAdd == TRUE) {
if ((item = ListGetItemPtr(LIST_ROSTER, from)) == NULL || (item->subscription != SUB_BOTH && item->subscription != SUB_TO)) {
- Log("Try adding contact automatically jid = " TCHAR_STR_PARAM, from);
+ Log("Try adding contact automatically jid = %S", from);
if ((hContact=AddToListByJID(from, 0)) != NULL) {
// Trigger actual add by removing the "NotOnList" added by AddToListByJID()
// See AddToListByJID() and JabberDbSettingChanged().
@@ -1796,7 +1796,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info) HXML n = xmlGetChild(node , "nick");
nick = (n == NULL) ? JabberNickFromJID(from) : mir_tstrdup(xmlGetText(n));
if (nick != NULL) {
- Log(TCHAR_STR_PARAM " (" TCHAR_STR_PARAM ") requests authorization", nick, from);
+ Log("%S (%S) requests authorization", nick, from);
DBAddAuthRequest(from, nick);
mir_free(nick);
} }
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 2e1a142191..ac7a4e0e79 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -660,7 +660,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP item = photoInfo->ppro->ListGetItemPtr(LIST_ROSTER, jid);
if (item != NULL) {
if (item->photoFileName) {
- photoInfo->ppro->Log("Showing picture from " TCHAR_STR_PARAM, item->photoFileName);
+ photoInfo->ppro->Log("Showing picture from %S", item->photoFileName);
char* p = mir_t2a(item->photoFileName);
photoInfo->hBitmap = (HBITMAP) CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)p);
mir_free(p);
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index 4835b87245..ed7adff6f9 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -298,7 +298,7 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (GetTempPath(SIZEOF(szTempPath), szTempPath) <= 0)
_tcscpy(szTempPath, _T(".\\"));
if (GetTempFileName(szTempPath, _T("jab"), 0, szTempFileName) > 0) {
- dat->ppro->Log("Temp file = " TCHAR_STR_PARAM, szTempFileName);
+ dat->ppro->Log("Temp file = %S", szTempFileName);
if (CopyFile(szAvatarFileName, szTempFileName, FALSE) == TRUE) {
char* p = mir_t2a(szTempFileName);
if ((dat->hBitmap=(HBITMAP) CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)p)) != NULL) {
@@ -343,7 +343,7 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR struct _stat st;
HBITMAP hNewBitmap;
- dat->ppro->Log("File selected is " TCHAR_STR_PARAM, szFileName);
+ dat->ppro->Log("File selected is %S", szFileName);
if (_tstat(szFileName, &st)<0 || st.st_size>40*1024) {
MessageBox(hwndDlg, TranslateT("Only JPG, GIF, and BMP image files smaller than 40 KB are supported."), TranslateT("Jabber vCard"), MB_OK|MB_SETFOREGROUND);
break;
@@ -351,7 +351,7 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (GetTempPath(SIZEOF(szTempPath), szTempPath) <= 0)
_tcscpy(szTempPath, _T(".\\"));
if (GetTempFileName(szTempPath, _T("jab"), 0, szTempFileName) > 0) {
- dat->ppro->Log("Temp file = " TCHAR_STR_PARAM, szTempFileName);
+ dat->ppro->Log("Temp file = %S", szTempFileName);
if (CopyFile(szFileName, szTempFileName, FALSE) == TRUE) {
char* pszTemp = mir_t2a(szTempFileName);
if ((hNewBitmap=(HBITMAP) CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)pszTemp)) != NULL) {
@@ -1136,7 +1136,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName) szFileName = szAvatarName;
// Set photo element, also update the global jabberVcardPhotoFileName to reflect the update
- Log("Before update, file name = " TCHAR_STR_PARAM, szFileName);
+ Log("Before update, file name = %S", szFileName);
if (szFileName == NULL || szFileName[0] == 0) {
v << XCHILD(_T("PHOTO"));
DeleteFile(szAvatarName);
@@ -1149,7 +1149,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName) char* buffer, *str;
DWORD nRead;
- Log("Saving picture from " TCHAR_STR_PARAM, szFileName);
+ Log("Saving picture from %S", szFileName);
if (_tstat(szFileName, &st) >= 0) {
// Note the FILE_SHARE_READ attribute so that the CopyFile can succeed
if ((hFile=CreateFile(szFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE) {
|