diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/AimOscar/src/avatars.cpp | 5 | ||||
-rw-r--r-- | protocols/FacebookRM/src/proto.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/gg_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/IRCG/src/irclib.cpp | 4 | ||||
-rw-r--r-- | protocols/IRCG/src/ircproto.cpp | 4 | ||||
-rw-r--r-- | protocols/IRCG/src/options.cpp | 2 | ||||
-rw-r--r-- | protocols/IRCG/src/services.cpp | 6 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_avatar.cpp | 4 | ||||
-rw-r--r-- | protocols/MRA/src/MraAvatars.cpp | 2 | ||||
-rw-r--r-- | protocols/MSN/src/msn_misc.cpp | 4 | ||||
-rw-r--r-- | protocols/Skype/src/skype_utils.cpp | 4 | ||||
-rw-r--r-- | protocols/Twitter/src/proto.cpp | 6 | ||||
-rw-r--r-- | protocols/Yahoo/src/avatar.cpp | 146 |
13 files changed, 93 insertions, 98 deletions
diff --git a/protocols/AimOscar/src/avatars.cpp b/protocols/AimOscar/src/avatars.cpp index 91b5ccec23..f8017684a7 100644 --- a/protocols/AimOscar/src/avatars.cpp +++ b/protocols/AimOscar/src/avatars.cpp @@ -171,11 +171,8 @@ void CAimProto::init_custom_folders(void) TCHAR AvatarsFolder[MAX_PATH];
- TCHAR *tszModuleName = mir_a2t(m_szModuleName);
- mir_sntprintf(AvatarsFolder, SIZEOF(AvatarsFolder), _T("%%miranda_avatarcache%%\\%s"), tszModuleName);
+ mir_sntprintf(AvatarsFolder, SIZEOF(AvatarsFolder), _T("%%miranda_avatarcache%%\\%S"), m_szModuleName);
hAvatarsFolder = FoldersRegisterCustomPathT("Avatars", m_szModuleName, AvatarsFolder);
- mir_free(tszModuleName);
-
init_cst_fld_ran = true;
}
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 776fe875fc..7b91d554a7 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -71,7 +71,7 @@ FacebookProto::FacebookProto(const char* proto_name,const TCHAR* username) SkinAddNewSoundExT( "OtherEvent", m_tszUserName, LPGENT( "Other Event" ));
def_avatar_folder_ = std::tstring( VARST( _T("%miranda_avatarcache%"))) + _T("\\") + m_tszUserName;
- hAvatarFolder_ = FoldersRegisterCustomPathT("Avatars", m_tszUserName, def_avatar_folder_.c_str());
+ hAvatarFolder_ = FoldersRegisterCustomPathT("Avatars", m_szModuleName, def_avatar_folder_.c_str());
// Set all contacts offline -- in case we crashed
SetAllContactStatuses( ID_STATUS_OFFLINE, true );
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 35e5159510..6db86eca5a 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -684,7 +684,7 @@ void __cdecl GGPROTO::getawaymsgthread(void *hContact) if (!db_get_s(hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_TCHAR))
{
ProtoBroadcastAck(m_szModuleName, hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE) 1, (LPARAM) dbv.ptszVal);
- netlog("getawaymsgthread(): Reading away msg <" TCHAR_STR_PARAM ">.", dbv.ptszVal);
+ netlog("getawaymsgthread(): Reading away msg <%S>.", dbv.ptszVal);
DBFreeVariant(&dbv);
} else {
ProtoBroadcastAck(m_szModuleName, hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE) 1, (LPARAM) NULL);
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index 217861ba90..1f13b5159f 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -197,7 +197,7 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info) con = (HANDLE) CallService( MS_NETLIB_OPENCONNECTION, (WPARAM) hNetlib, (LPARAM) & ncon);
if (con == NULL) {
TCHAR szTemp[300];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\0035%s \002%s\002 (") _T(TCHAR_STR_PARAM) _T(": %u)."),
+ mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\0035%s \002%s\002 (%S: %u)."),
TranslateT("Failed to connect to"), si.sNetwork.c_str(), si.sServer.c_str(), si.iPort);
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
return false;
@@ -1471,7 +1471,7 @@ LBL_Parse: {
if (PeerPortNrRcvd == g_Instances[i]->m_info.iPort && LocalPortNrRcvd == g_Instances[i]->m_myLocalPort)
{
- cbLen = mir_snprintf(buf, SIZEOF(buf), "%s : USERID : " TCHAR_STR_PARAM " : " TCHAR_STR_PARAM "\r\n",
+ cbLen = mir_snprintf(buf, SIZEOF(buf), "%s : USERID : %S : %S\r\n",
szBuf, g_Instances[i]->m_info.sIdentServerType.c_str() , g_Instances[i]->m_info.sUserID.c_str());
break;
}
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 0f8aa6e1bb..42aeddb16e 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -268,7 +268,7 @@ int CIrcProto::OnModulesLoaded( WPARAM, LPARAM ) }
TCHAR szTemp[MAX_PATH];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%miranda_path%%\\Plugins\\") _T(TCHAR_STR_PARAM) _T("_perform.ini"), m_szModuleName);
+ mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%miranda_path%%\\Plugins\\%S_perform.ini"), m_szModuleName);
TCHAR *szLoadFileName = Utils_ReplaceVarsT( szTemp );
char* pszPerformData = IrcLoadFile( szLoadFileName );
if ( pszPerformData != NULL ) {
@@ -782,7 +782,7 @@ HANDLE __cdecl CIrcProto::SendFile( HANDLE hContact, const TCHAR*, TCHAR** ppszF index++;
while( ppszFiles[index] ) {
if ( _taccess(ppszFiles[index], 0) == 0 ) {
- PostIrcMessage( _T("/DCC SEND %s ") _T(TCHAR_STR_PARAM), dci->sContactName.c_str(), ppszFiles[index]);
+ PostIrcMessage( _T("/DCC SEND %s %S"), dci->sContactName.c_str(), ppszFiles[index]);
}
index++;
}
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index a01e34822b..db56f9aded 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -1362,7 +1362,7 @@ static LRESULT CALLBACK ListviewSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, void CIrcProto::InitIgnore( void )
{
TCHAR szTemp[ MAX_PATH ];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%miranda_path%%\\Plugins\\") _T(TCHAR_STR_PARAM) _T("_ignore.ini"), m_szModuleName);
+ mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%miranda_path%%\\Plugins\\%S_ignore.ini"), m_szModuleName);
TCHAR *szLoadFileName = Utils_ReplaceVarsT( szTemp );
char* pszIgnoreData = IrcLoadFile(szLoadFileName);
if ( pszIgnoreData != NULL ) {
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index e1987e9e0f..d0e6814dd8 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -353,7 +353,7 @@ INT_PTR __cdecl CIrcProto::OnMenuIgnore(WPARAM wp, LPARAM) S = "+qnidcm";
else
S = "+qnidc";
- PostIrcMessage( _T("/IGNORE %%question=\"%s\",\"%s\",\"*!*@") _T(TCHAR_STR_PARAM) _T("\" %s"),
+ PostIrcMessage( _T("/IGNORE %%question=\"%s\",\"%s\",\"*!*@%S\" %s"),
TranslateT("Please enter the hostmask (nick!user@host) \nNOTE! Contacts on your contact list are never ignored"),
TranslateT("Ignore"), host, S.c_str());
DBFreeVariant(&dbv1);
@@ -1170,7 +1170,7 @@ void CIrcProto::ConnectToServer(void) InterlockedIncrement((long *) &m_bConnectRequested);
TCHAR szTemp[300];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\0033%s \002%s\002 (") _T(TCHAR_STR_PARAM) _T(": %u)"),
+ mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\0033%s \002%s\002 (%S: %u)"),
TranslateT("Connecting to"), si.sNetwork.c_str(), si.sServer.c_str(), si.iPort);
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
}
@@ -1222,7 +1222,7 @@ VOID CALLBACK RetryTimerProc( HWND, UINT, UINT_PTR idEvent, DWORD ) ppro->si.iPort = ppro->m_portCount;
TCHAR szTemp[300];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\0033%s \002%s\002 (") _T(TCHAR_STR_PARAM) _T(": %u, try %u)"),
+ mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\0033%s \002%s\002 (%S: %u, try %u)"),
TranslateT("Reconnecting to"), ppro->si.sNetwork.c_str(), ppro->si.sServer.c_str(), ppro->si.iPort, ppro->m_iRetryCount);
ppro->DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index 53f7ee59c4..f302d3df81 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -92,7 +92,7 @@ void CIcqProto::InitAvatars() // check if it does make sense
TCHAR tszPath[MAX_PATH * 2];
- null_snprintf(tszPath, MAX_PATH * 2, _T("%%miranda_avatarcache%%\\") _T(TCHAR_STR_PARAM) _T("\\"), m_szModuleName);
+ null_snprintf(tszPath, MAX_PATH * 2, _T("%%miranda_avatarcache%%\\%S\\"), m_szModuleName);
hAvatarsFolder = FoldersRegisterCustomPathT("Avatars", m_szModuleName, tszPath);
}
@@ -134,7 +134,7 @@ void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, if (CallService(MS_FOLDERS_GET_PATH, (WPARAM)hAvatarsFolder, (LPARAM)&fgd))
{
TCHAR *tmpPath = Utils_ReplaceVarsT(_T("%miranda_avatarcache%"));
- null_snprintf(szPath, MAX_PATH * 2, _T("%s\\") _T(TCHAR_STR_PARAM) _T("\\"), tmpPath, m_szModuleName);
+ null_snprintf(szPath, MAX_PATH * 2, _T("%s\\%S\\"), tmpPath, m_szModuleName);
mir_free(tmpPath);
}
else
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index bf287cea67..30d1ee6d35 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -90,7 +90,7 @@ DWORD CMraProto::MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle) if (pmraaqAvatarsQueue->hNetlibUser) {
TCHAR tszPath[ MAX_PATH ];
mir_sntprintf( tszPath, SIZEOF(tszPath), _T("%%miranda_avatarcache%%\\%s"), m_tszUserName);
- pmraaqAvatarsQueue->hAvatarsPath = FoldersRegisterCustomPathT("Avatars", m_tszUserName, tszPath);
+ pmraaqAvatarsQueue->hAvatarsPath = FoldersRegisterCustomPathT("Avatars", m_szModuleName, tszPath);
InterlockedExchange((volatile LONG*)&pmraaqAvatarsQueue->bIsRunning, TRUE);
pmraaqAvatarsQueue->hThreadEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index feaea0851c..2b5860dadc 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -142,10 +142,10 @@ void CMsnProto::InitCustomFolders(void) TCHAR *tszModuleName = mir_a2t(m_szModuleName);
mir_sntprintf(folder, SIZEOF(folder), _T("%%miranda_userdata%%\\Avatars\\%s"), tszModuleName);
- hMSNAvatarsFolder = FoldersRegisterCustomPathT("Avatars", m_tszUserName, folder);
+ hMSNAvatarsFolder = FoldersRegisterCustomPathT("Avatars", m_szModuleName, folder);
mir_sntprintf(folder, SIZEOF(folder), _T("%%miranda_userdata%%\\Avatars\\%s"), tszModuleName);
- hCustomSmileyFolder = FoldersRegisterCustomPathT(m_szModuleName, "Custom Smiley", folder);
+ hCustomSmileyFolder = FoldersRegisterCustomPathT("Custom Smileys", m_szModuleName, folder);
mir_free(tszModuleName);
InitCstFldRan = true;
diff --git a/protocols/Skype/src/skype_utils.cpp b/protocols/Skype/src/skype_utils.cpp index ed8f920abc..534f4b2087 100644 --- a/protocols/Skype/src/skype_utils.cpp +++ b/protocols/Skype/src/skype_utils.cpp @@ -330,7 +330,7 @@ void CSkypeProto::InitCustomFolders() m_bInitDone = true;
TCHAR AvatarsFolder[MAX_PATH];
- mir_sntprintf(AvatarsFolder, SIZEOF(AvatarsFolder), _T("%%miranda_avatarcache%%\\") _T(TCHAR_STR_PARAM), this->m_szModuleName);
+ mir_sntprintf(AvatarsFolder, SIZEOF(AvatarsFolder), _T("%%miranda_avatarcache%%\\%S"), this->m_szModuleName);
m_hAvatarsFolder = ::FoldersRegisterCustomPathT("Avatars", m_szModuleName, AvatarsFolder);
}
@@ -343,7 +343,7 @@ wchar_t* CSkypeProto::GetContactAvatarFilePath(HANDLE hContact) if (m_hAvatarsFolder == NULL || FoldersGetCustomPathT(m_hAvatarsFolder, path, MAX_PATH, _T("")))
{
wchar_t *tmpPath = ::Utils_ReplaceVarsT(L"%miranda_avatarcache%");
- ::mir_sntprintf(path, MAX_PATH, _T("%s\\") _T(TCHAR_STR_PARAM), tmpPath, this->m_szModuleName);
+ ::mir_sntprintf(path, MAX_PATH, _T("%s\\%S"), tmpPath, this->m_szModuleName);
mir_free(tmpPath);
}
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index 86d958f82d..373662c543 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -48,10 +48,8 @@ TwitterProto::TwitterProto(const char *proto_name,const TCHAR *username) HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &TwitterProto::OnBuildStatusMenu, this);
HookProtoEvent(ME_OPT_INITIALISE, &TwitterProto::OnOptionsInit, this);
- TCHAR *profile = Utils_ReplaceVarsT( _T("%miranda_avatarcache%"));
- def_avatar_folder_ = std::tstring(profile) + _T("\\") + m_tszUserName;
- mir_free(profile);
- hAvatarFolder_ = FoldersRegisterCustomPathT("Avatars", m_tszUserName, def_avatar_folder_.c_str());
+ def_avatar_folder_ = std::tstring( VARST( _T("%miranda_avatarcache%"))) + _T("\\") + m_tszUserName;
+ hAvatarFolder_ = FoldersRegisterCustomPathT("Avatars", m_szModuleName, def_avatar_folder_.c_str());
// Initialize hotkeys
char text[512];
diff --git a/protocols/Yahoo/src/avatar.cpp b/protocols/Yahoo/src/avatar.cpp index 3af58910f5..7386810eb1 100644 --- a/protocols/Yahoo/src/avatar.cpp +++ b/protocols/Yahoo/src/avatar.cpp @@ -1,9 +1,9 @@ /*
* $Id: avatar.cpp 14178 2012-03-11 15:02:54Z borkra $
*
- * myYahoo Miranda Plugin
+ * myYahoo Miranda Plugin
*
- * Authors: Gennady Feldman (aka Gena01)
+ * Authors: Gennady Feldman (aka Gena01)
* Laurent Marechal (aka Peorth)
*
* This code is under GPL and is based on AIM, MSN and Miranda source code.
@@ -26,9 +26,9 @@ int YAHOO_avt_hash(const char *key, DWORD len)
{
- /*
+ /*
Thank you Pidgin and Kopete devs. It seems that both clients are using this code now.
-
+
*/
const unsigned char *p = (const unsigned char *)key;
@@ -42,7 +42,7 @@ int YAHOO_avt_hash(const char *key, DWORD len) checksum &= ~g;
}
-
+
return checksum;
}
@@ -103,7 +103,7 @@ void upload_avt(int id, int fd, int error, void *data) LOG(("File send complete!"));
}
-void __cdecl CYahooProto::send_avt_thread(void *psf)
+void __cdecl CYahooProto::send_avt_thread(void *psf)
{
struct yahoo_file_info *sf = ( yahoo_file_info* )psf;
if (sf == NULL) {
@@ -150,7 +150,7 @@ struct avatar_info{ int cksum;
};
-void __cdecl CYahooProto::recv_avatarthread(void *pavt)
+void __cdecl CYahooProto::recv_avatarthread(void *pavt)
{
PROTO_AVATAR_INFORMATIONT AI;
struct avatar_info *avt = ( avatar_info* )pavt;
@@ -234,12 +234,12 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt) if (GetDword(hContact, "PictCK", 0) != avt->cksum) {
LOG(("WARNING: Checksum updated during download?!"));
error = 1; /* don't use this one? */
- }
+ }
SetDword(hContact, "PictLoading", 0);
LOG(("File download complete!?"));
- if (error)
+ if (error)
buf[0]='\0';
free(avt->who);
@@ -250,8 +250,8 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt) AI.format = PA_FORMAT_PNG;
AI.hContact = hContact;
_tcsncpy(AI.filename, buf, SIZEOF(AI.filename));
-
- if (error)
+
+ if (error)
SetDword(hContact, "PictCK", 0);
ProtoBroadcastAck(m_szModuleName, hContact, ACKTYPE_AVATAR, !error ? ACKRESULT_SUCCESS:ACKRESULT_FAILED,(HANDLE) &AI, 0);
@@ -260,29 +260,29 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt) void CYahooProto::ext_got_picture(const char *me, const char *who, const char *pic_url, int cksum, int type)
{
HANDLE hContact = 0;
-
+
LOG(("[ext_yahoo_got_picture] for %s with url %s (checksum: %d) type: %d", who, pic_url, cksum, type));
-
+
/*
Type:
-
+
1 - Send Avatar Info
2 - Got Avatar Info
3 - YIM6 didn't like my avatar? Expired? We need to invalidate and re-load
*/
switch (type) {
- case 1:
+ case 1:
{
int cksum=0;
DBVARIANT dbv;
-
+
/* need to send avatar info */
if (!GetByte("ShowAvatars", 1 )) {
LOG(("[ext_yahoo_got_picture] We are not using/showing avatars!"));
yahoo_send_picture_update(m_id, who, 0); // no avatar (disabled)
return;
}
-
+
LOG(("[ext_yahoo_got_picture] Getting ready to send info!"));
/* need to read CheckSum */
cksum = GetDword("AvatarHash", 0);
@@ -295,7 +295,7 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p break;
} else
LOG(("No AvatarURL???"));
-
+
/*
* Try to re-upload the avatar
*/
@@ -303,39 +303,39 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p // NO avatar URL??
if (!DBGetContactSettingTString(NULL, m_szModuleName, "AvatarFile", &dbv)) {
struct _stat statbuf;
-
+
if (_tstat( dbv.ptszVal, &statbuf ) != 0) {
LOG(("[ext_yahoo_got_picture] Avatar File Missing? Can't find file: %s", dbv.ptszVal));
} else {
db_set_s(NULL, m_szModuleName, "AvatarInv", who);
SendAvatar(dbv.ptszVal);
}
-
+
DBFreeVariant(&dbv);
} else {
LOG(("[ext_yahoo_got_picture] No Local Avatar File??? "));
}
- } else
+ } else
LOG(("[ext_yahoo_got_picture] Another avatar upload in progress?"));
}
}
break;
case 2: /*
- * We got Avatar Info for our buddy.
+ * We got Avatar Info for our buddy.
*/
if (!GetByte("ShowAvatars", 1 )) {
LOG(("[ext_yahoo_got_picture] We are not using/showing avatars!"));
return;
}
-
+
/* got avatar info, so set miranda up */
hContact = getbuddyH(who);
-
+
if (!hContact) {
LOG(("[ext_yahoo_got_picture] Buddy not on my buddy list?."));
return;
}
-
+
if (!cksum && pic_url) {
const char *chk = strstr(pic_url, "chksum=");
if (chk)
@@ -345,19 +345,19 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p if (!cksum || cksum == -1) {
LOG(("[ext_yahoo_got_picture] Resetting avatar."));
db_set_dw(hContact, m_szModuleName, "PictCK", 0);
-
+
reset_avatar(hContact);
} else {
if (pic_url == NULL) {
LOG(("[ext_yahoo_got_picture] WARNING: Empty URL for avatar?"));
return;
}
-
+
TCHAR z[1024];
GetAvatarFileName(hContact, z, 1024, db_get_b(hContact, m_szModuleName,"AvatarType", 0));
-
+
if (db_get_dw(hContact, m_szModuleName,"PictCK", 0) != cksum || _taccess( z, 0) != 0) {
-
+
DebugLog("[ext_yahoo_got_picture] Checksums don't match or avatar file is missing. Current: %d, New: %d",(int)db_get_dw(hContact, m_szModuleName,"PictCK", 0), cksum);
struct avatar_info *avt = ( avatar_info* )malloc(sizeof(struct avatar_info));
@@ -370,7 +370,7 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p }
break;
- case 3:
+ case 3:
/*
* Our Avatar is not good anymore? Need to re-upload??
*/
@@ -378,14 +378,14 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p {
int mcksum=0;
DBVARIANT dbv;
-
+
/* need to send avatar info */
if (!GetByte("ShowAvatars", 1 )) {
LOG(("[ext_yahoo_got_picture] We are not using/showing avatars!"));
yahoo_send_picture_update(m_id, who, 0); // no avatar (disabled)
return;
}
-
+
LOG(("[ext_yahoo_got_picture] Getting ready to send info!"));
/* need to read CheckSum */
mcksum = GetDword("AvatarHash", 0);
@@ -395,34 +395,34 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p yahoo_send_picture_update(m_id, who, 0); // no avatar (disabled)
return;
}
-
+
LOG(("[ext_yahoo_got_picture] My Checksum: %d", mcksum));
-
+
if (!GetString("AvatarURL", &dbv)) {
if (lstrcmpiA(pic_url, dbv.pszVal) == 0) {
DBVARIANT dbv2;
/*time_t ts;
DWORD ae;*/
-
+
if (mcksum != cksum)
- LOG(("[ext_yahoo_got_picture] WARNING: Checksums don't match!"));
-
+ LOG(("[ext_yahoo_got_picture] WARNING: Checksums don't match!"));
+
/*time(&ts);
ae = GetDword("AvatarExpires", 0);
-
+
if (ae != 0 && ae > (ts - 300)) {
LOG(("[ext_yahoo_got_picture] Current Time: %lu Expires: %lu ", ts, ae));
LOG(("[ext_yahoo_got_picture] We just reuploaded! Stop screwing with Yahoo FT. "));
-
+
// don't leak stuff
DBFreeVariant(&dbv);
break;
}*/
-
+
LOG(("[ext_yahoo_got_picture] Buddy: %s told us this is bad??Expired??. Re-uploading", who));
db_unset(NULL, m_szModuleName, "AvatarURL");
-
+
if (!DBGetContactSettingTString(NULL, m_szModuleName, "AvatarFile", &dbv2)) {
db_set_s(NULL, m_szModuleName, "AvatarInv", who);
SendAvatar(dbv2.ptszVal);
@@ -444,7 +444,7 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p default:
LOG(("[ext_yahoo_got_picture] Unknown request/packet type exiting!"));
}
-
+
LOG(("ext_yahoo_got_picture exiting"));
}
@@ -526,7 +526,7 @@ void CYahooProto::ext_got_picture_status(const char *me, const char *who, int bu void CYahooProto::ext_got_picture_upload(const char *me, const char *url,unsigned int ts)
{
int cksum = 0;
- DBVARIANT dbv;
+ DBVARIANT dbv;
LOG(("[ext_yahoo_got_picture_upload] url: %s timestamp: %d", url, ts));
@@ -605,7 +605,7 @@ void CYahooProto::request_avatar(const char* who) /*
* time() - in seconds ( 60*60 = 1 hour)
*/
- if (db_get_dw(hContact, m_szModuleName,"PictCK", 0) == 0 ||
+ if (db_get_dw(hContact, m_szModuleName,"PictCK", 0) == 0 ||
last_chk == 0 || (cur_time - last_chk) > 60) {
db_set_dw(hContact, m_szModuleName, "PictLastCheck", (DWORD)cur_time);
@@ -620,12 +620,12 @@ void CYahooProto::request_avatar(const char* who) void CYahooProto::InitCustomFolders(void)
{
if (InitCstFldRan)
- return;
+ return;
InitCstFldRan = true;
TCHAR AvatarsFolder[MAX_PATH];
- mir_sntprintf(AvatarsFolder, MAX_PATH, _T("%%miranda_avatarcache%%\\") _T(TCHAR_STR_PARAM), m_szModuleName);
+ mir_sntprintf(AvatarsFolder, MAX_PATH, _T("%%miranda_avatarcache%%\\%S"), m_szModuleName);
hYahooAvatarsFolder = FoldersRegisterCustomPathT("Avatars", m_szModuleName, AvatarsFolder);
}
@@ -642,7 +642,7 @@ void CYahooProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, int cbLen, tPathLen = _tcslen( pszDest );
} else {
TCHAR *tmpPath = Utils_ReplaceVarsT( _T("%miranda_avatarcache%"));
- tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\") _T(TCHAR_STR_PARAM), tmpPath, m_szModuleName);
+ tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), tmpPath, m_szModuleName);
mir_free(tmpPath);
}
@@ -653,9 +653,9 @@ void CYahooProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, int cbLen, int ck_sum = db_get_dw(hContact, m_szModuleName,"PictCK", 0);
tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\%lX"), ck_sum);
} else {
- tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\") _T(TCHAR_STR_PARAM) _T(" avatar"), m_szModuleName);
+ tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\%S avatar"), m_szModuleName);
}
-
+
mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("%s"), type == 1 ? _T(".swf") : _T(".png"));
}
@@ -688,17 +688,17 @@ INT_PTR __cdecl CYahooProto::GetAvatarInfo(WPARAM wParam,LPARAM lParam) return GAIR_NOAVATAR;
}
- if (db_get_dw(AI->hContact, m_szModuleName,"PictCK", 0) == 0)
+ if (db_get_dw(AI->hContact, m_szModuleName,"PictCK", 0) == 0)
return GAIR_NOAVATAR;
GetAvatarFileName(AI->hContact, AI->filename, SIZEOF(AI->filename), db_get_b(AI->hContact, m_szModuleName,"AvatarType", 0));
AI->format = PA_FORMAT_PNG;
DebugLog("[YAHOO_GETAVATARINFO] filename: %s", AI->filename);
- if (_taccess( AI->filename, 0) == 0)
+ if (_taccess( AI->filename, 0) == 0)
return GAIR_SUCCESS;
- if (( wParam & GAIF_FORCE ) != 0 && AI->hContact != NULL) {
+ if (( wParam & GAIF_FORCE ) != 0 && AI->hContact != NULL) {
/* need to request it again? */
if (GetDword(AI->hContact, "PictLoading", 0) != 0 &&
(time(NULL) - GetDword(AI->hContact, "PictLastCheck", 0) < 500)) {
@@ -732,7 +732,7 @@ INT_PTR __cdecl CYahooProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam) int res = 0;
switch (wParam) {
- case AF_MAXSIZE:
+ case AF_MAXSIZE:
LOG(("[YahooGetAvatarCaps] AF_MAXSIZE"));
((POINT*)lParam)->x = 96;
@@ -740,7 +740,7 @@ INT_PTR __cdecl CYahooProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam) break;
- case AF_PROPORTION:
+ case AF_PROPORTION:
LOG(("[YahooGetAvatarCaps] AF_PROPORTION"));
res = PIP_NONE;
@@ -828,13 +828,13 @@ INT_PTR __cdecl CYahooProto::SetMyAvatar(WPARAM wParam, LPARAM lParam) GetAvatarFileName(NULL, tszMyFile, MAX_PATH, 2);
if (tszFile == NULL) {
- DebugLog("[Deleting Avatar Info]");
+ DebugLog("[Deleting Avatar Info]");
/* remove ALL our Avatar Info Keys */
- db_unset(NULL, m_szModuleName, "AvatarFile");
+ db_unset(NULL, m_szModuleName, "AvatarFile");
db_unset(NULL, m_szModuleName, "AvatarHash");
- db_unset(NULL, m_szModuleName, "AvatarURL");
- db_unset(NULL, m_szModuleName, "AvatarTS");
+ db_unset(NULL, m_szModuleName, "AvatarURL");
+ db_unset(NULL, m_szModuleName, "AvatarTS");
/* Send a Yahoo packet saying we don't got an avatar anymore */
yahoo_send_picture_status(m_id, 0);
@@ -848,12 +848,12 @@ INT_PTR __cdecl CYahooProto::SetMyAvatar(WPARAM wParam, LPARAM lParam) unsigned int hash;
HANDLE hFile;
- hFile = CreateFile(tszFile,
- GENERIC_READ,
- FILE_SHARE_READ|FILE_SHARE_WRITE,
- NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
+ hFile = CreateFile(tszFile,
+ GENERIC_READ,
+ FILE_SHARE_READ|FILE_SHARE_WRITE,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
0);
if ( hFile == INVALID_HANDLE_VALUE )
@@ -866,13 +866,13 @@ INT_PTR __cdecl CYahooProto::SetMyAvatar(WPARAM wParam, LPARAM lParam) ReadFile( hFile, pResult, dwPngSize, &dw, NULL);
CloseHandle( hFile );
- hFile = CreateFile(tszMyFile,
- GENERIC_WRITE,
- FILE_SHARE_WRITE,
- NULL,
- OPEN_ALWAYS,
+ hFile = CreateFile(tszMyFile,
+ GENERIC_WRITE,
+ FILE_SHARE_WRITE,
+ NULL,
+ OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL, 0);
- if ( hFile == INVALID_HANDLE_VALUE )
+ if ( hFile == INVALID_HANDLE_VALUE )
return 1;
WriteFile( hFile, pResult, dwPngSize, &dw, NULL);
@@ -883,7 +883,7 @@ INT_PTR __cdecl CYahooProto::SetMyAvatar(WPARAM wParam, LPARAM lParam) free( pResult );
if ( hash ) {
- LOG(("[YAHOO_SetAvatar] File: '%s' CK: %d", tszMyFile, hash));
+ LOG(("[YAHOO_SetAvatar] File: '%s' CK: %d", tszMyFile, hash));
/* now check and make sure we don't reupload same thing over again */
if (hash != GetDword("AvatarHash", 0)) {
@@ -897,8 +897,8 @@ INT_PTR __cdecl CYahooProto::SetMyAvatar(WPARAM wParam, LPARAM lParam) }
SendAvatar(tszMyFile);
- }
- else LOG(("[YAHOO_SetAvatar] Same checksum and avatar on YahooFT. Not Reuploading."));
+ }
+ else LOG(("[YAHOO_SetAvatar] Same checksum and avatar on YahooFT. Not Reuploading."));
} }
return 0;
|