summaryrefslogtreecommitdiff
path: root/protocols/MSN
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-08-11 10:41:37 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-08-11 10:41:37 +0000
commit94dcc72f13094157f344f284aec4edf0c0f5faa1 (patch)
tree74c078daadd4abe5aea9e9e0a73b4dd7c4a7fde1 /protocols/MSN
parent42ff2169dbddd25d06404623dba2fff222d17c73 (diff)
ProtoGetAvatarFormat, ProtoGetAvatarFileFormat, ProtoGetBufferFormat, ProtoGetAvatarExtension - standard helpers for protocol avatars' processing instead of the zoo that existed previously
git-svn-id: http://svn.miranda-ng.org/main/trunk@5645 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN')
-rw-r--r--protocols/MSN/src/msn_avatar.cpp2
-rw-r--r--protocols/MSN/src/msn_contact.cpp2
-rw-r--r--protocols/MSN/src/msn_global.h2
-rw-r--r--protocols/MSN/src/msn_lists.cpp6
-rw-r--r--protocols/MSN/src/msn_menu.cpp2
-rw-r--r--protocols/MSN/src/msn_misc.cpp63
-rw-r--r--protocols/MSN/src/msn_msgqueue.cpp8
-rw-r--r--protocols/MSN/src/msn_p2p.cpp42
-rw-r--r--protocols/MSN/src/msn_p2ps.cpp34
-rw-r--r--protocols/MSN/src/msn_srv.cpp6
-rw-r--r--protocols/MSN/src/msn_std.cpp2
-rw-r--r--protocols/MSN/src/msn_svcs.cpp4
-rw-r--r--protocols/MSN/src/msn_threads.cpp24
13 files changed, 78 insertions, 119 deletions
diff --git a/protocols/MSN/src/msn_avatar.cpp b/protocols/MSN/src/msn_avatar.cpp
index 4543038281..eae7364de7 100644
--- a/protocols/MSN/src/msn_avatar.cpp
+++ b/protocols/MSN/src/msn_avatar.cpp
@@ -75,7 +75,7 @@ LBL_Error:
}
const TCHAR *szExt;
- int fmt = MSN_GetImageFormat(nlhrReply->pData, &szExt);
+ int fmt = ProtoGetBufferFormat(nlhrReply->pData, &szExt);
if (fmt == PA_FORMAT_UNKNOWN)
goto LBL_Error;
diff --git a/protocols/MSN/src/msn_contact.cpp b/protocols/MSN/src/msn_contact.cpp
index 630635e546..5739d96294 100644
--- a/protocols/MSN/src/msn_contact.cpp
+++ b/protocols/MSN/src/msn_contact.cpp
@@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "msn_global.h"
#include "msn_proto.h"
-HANDLE CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, bool addIfNeeded, bool temporary)
+HANDLE CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, bool addIfNeeded, bool temporary)
{
HANDLE hContact = NULL;
diff --git a/protocols/MSN/src/msn_global.h b/protocols/MSN/src/msn_global.h
index 99b4448964..ea44ab8228 100644
--- a/protocols/MSN/src/msn_global.h
+++ b/protocols/MSN/src/msn_global.h
@@ -173,8 +173,6 @@ void UrlEncode(const char* src, char* dest, size_t cbDest);
void __cdecl MSN_ConnectionProc(HANDLE hNewConnection, DWORD dwRemoteIP, void*);
char* MSN_GetAvatarHash(char* szContext, char** pszUrl = NULL);
-int MSN_GetImageFormat(void* buf, const TCHAR** ext);
-int MSN_GetImageFormat(const TCHAR* file);
bool MSN_MsgWndExist(HANDLE hContact);
#define MSN_SendNickname(a) MSN_SendNicknameUtf(UTF8(a))
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp
index f218a1171c..02eb12c80d 100644
--- a/protocols/MSN/src/msn_lists.cpp
+++ b/protocols/MSN/src/msn_lists.cpp
@@ -35,7 +35,7 @@ void CMsnProto::Lists_Uninit(void)
DeleteCriticalSection(&csLists);
}
-void CMsnProto::Lists_Wipe(void)
+void CMsnProto::Lists_Wipe(void)
{
EnterCriticalSection(&csLists);
contList.destroy();
@@ -220,7 +220,7 @@ int CMsnProto::Lists_Add(int list, int netId, const char* email, HANDLE hContact
return result;
}
-void CMsnProto::Lists_Remove(int list, const char* email)
+void CMsnProto::Lists_Remove(int list, const char* email)
{
EnterCriticalSection(&csLists);
int i = contList.getIndex((MsnContact*)&email);
@@ -236,7 +236,7 @@ void CMsnProto::Lists_Remove(int list, const char* email)
}
-void CMsnProto::Lists_Populate(void)
+void CMsnProto::Lists_Populate(void)
{
HANDLE hContact = db_find_first(m_szModuleName);
while (hContact) {
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp
index f8f56c334a..b6760000cb 100644
--- a/protocols/MSN/src/msn_menu.cpp
+++ b/protocols/MSN/src/msn_menu.cpp
@@ -350,7 +350,7 @@ void CMsnProto::MsnRemoveMainMenus(void)
CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)mainMenuRoot, 0);
}
-void CMsnProto::MSN_EnableMenuItems(bool bEnable)
+void CMsnProto::MSN_EnableMenuItems(bool bEnable)
{
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index 4f9c3a47e6..b765ff5e59 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////////////////
// MirandaStatusToMSN - status helper functions
-const char* CMsnProto::MirandaStatusToMSN(int status)
+const char* CMsnProto::MirandaStatusToMSN(int status)
{
switch(status)
{
@@ -44,7 +44,7 @@ const char* CMsnProto::MirandaStatusToMSN(int status)
default: return "NLN";
} }
-WORD CMsnProto::MSNStatusToMiranda(const char *status)
+WORD CMsnProto::MSNStatusToMiranda(const char *status)
{
switch((*(PDWORD)status&0x00FFFFFF) | 0x20000000)
{
@@ -60,7 +60,7 @@ WORD CMsnProto::MSNStatusToMiranda(const char *status)
}
}
-char** CMsnProto::GetStatusMsgLoc(int status)
+char** CMsnProto::GetStatusMsgLoc(int status)
{
static const int modes[MSN_NUM_MODES] =
{
@@ -84,7 +84,7 @@ char** CMsnProto::GetStatusMsgLoc(int status)
/////////////////////////////////////////////////////////////////////////////////////////
// MSN_AddAuthRequest - adds the authorization event to the database
-void CMsnProto::MSN_AddAuthRequest(const char *email, const char *nick, const char *reason)
+void CMsnProto::MSN_AddAuthRequest(const char *email, const char *nick, const char *reason)
{
//blob is: UIN=0(DWORD), hContact(DWORD), nick(ASCIIZ), ""(ASCIIZ), ""(ASCIIZ), email(ASCIIZ), ""(ASCIIZ)
@@ -197,7 +197,7 @@ char* MSN_GetAvatarHash(char* szContext, char** pszUrl)
/////////////////////////////////////////////////////////////////////////////////////////
// MSN_GetAvatarFileName - gets a file name for an contact's avatar
-void CMsnProto::MSN_GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext)
+void CMsnProto::MSN_GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext)
{
size_t tPathLen;
@@ -268,45 +268,7 @@ void CMsnProto::MSN_GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t c
else mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, ext);
}
-int MSN_GetImageFormat(void* buf, const TCHAR** ext)
-{
- if (*(unsigned short*)buf == 0xd8ff) {
- *ext = _T("jpg");
- return PA_FORMAT_JPEG;
- }
- if (*(unsigned short*)buf == 0x4d42) {
- *ext = _T("bmp");
- return PA_FORMAT_BMP;
- }
- if (*(unsigned*)buf == 0x474e5089) {
- *ext = _T("png");
- return PA_FORMAT_PNG;
- }
- if (*(unsigned*)buf == 0x38464947) {
- *ext = _T("gif");
- return PA_FORMAT_GIF;
- }
-
- *ext = _T("unk");
- return PA_FORMAT_UNKNOWN;
-}
-
-int MSN_GetImageFormat(const TCHAR* file)
-{
- const TCHAR *ext = _tcsrchr(file, '.');
- if (ext == NULL)
- return PA_FORMAT_UNKNOWN;
- if (_tcsicmp(ext, _T(".gif")) == 0)
- return PA_FORMAT_GIF;
- else if (_tcsicmp(ext, _T(".bmp")) == 0)
- return PA_FORMAT_BMP;
- else if (_tcsicmp(ext, _T(".png")) == 0)
- return PA_FORMAT_PNG;
- else
- return PA_FORMAT_JPEG;
-}
-
-int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen)
+int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen)
{
mir_sha1_ctx sha1ctx;
BYTE sha1c[MIR_SHA1_HASH_SIZE], sha1d[MIR_SHA1_HASH_SIZE];
@@ -363,8 +325,9 @@ int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen
free(szBuffer);
const TCHAR *szExt;
- int fmt = MSN_GetImageFormat(pData, &szExt);
- if (fmt == PA_FORMAT_UNKNOWN) return fmt;
+ int fmt = ProtoGetBufferFormat(pData, &szExt);
+ if (fmt == PA_FORMAT_UNKNOWN)
+ return fmt;
TCHAR szFileName[MAX_PATH];
MSN_GetAvatarFileName(NULL, szFileName, SIZEOF(szFileName), NULL);
@@ -395,7 +358,7 @@ int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen
/////////////////////////////////////////////////////////////////////////////////////////
// MSN_GetCustomSmileyFileName - gets a file name for an contact's custom smiley
-void CMsnProto::MSN_GetCustomSmileyFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const char* SmileyName, int type)
+void CMsnProto::MSN_GetCustomSmileyFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const char* SmileyName, int type)
{
size_t tPathLen;
@@ -629,7 +592,7 @@ static VOID CALLBACK TypingTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWO
}
-void CMsnProto::MSN_StartStopTyping(ThreadData* info, bool start)
+void CMsnProto::MSN_StartStopTyping(ThreadData* info, bool start)
{
if (start && info->mTimerId == 0) {
info->mTimerId = SetTimer(NULL, 0, 5000, TypingTimerProc);
@@ -654,7 +617,7 @@ static char * HtmlEncodeUTF8T(const TCHAR *src)
return HtmlEncode(UTF8(src));
}
-void CMsnProto::MSN_SendStatusMessage(const char* msg)
+void CMsnProto::MSN_SendStatusMessage(const char* msg)
{
if (!msnLoggedIn)
return;
@@ -770,7 +733,7 @@ int ThreadData::sendPacket(const char* cmd, const char* fmt,...)
/////////////////////////////////////////////////////////////////////////////////////////
// MSN_SetServerStatus - changes plugins status at the server
-void CMsnProto::MSN_SetServerStatus(int newStatus)
+void CMsnProto::MSN_SetServerStatus(int newStatus)
{
MSN_DebugLog("Setting MSN server status %d, logged in = %d", newStatus, msnLoggedIn);
diff --git a/protocols/MSN/src/msn_msgqueue.cpp b/protocols/MSN/src/msn_msgqueue.cpp
index a82cad6a49..040ceedc72 100644
--- a/protocols/MSN/src/msn_msgqueue.cpp
+++ b/protocols/MSN/src/msn_msgqueue.cpp
@@ -38,7 +38,7 @@ void CMsnProto::MsgQueue_Uninit(void)
DeleteCriticalSection(&csMsgQueue);
}
-int CMsnProto::MsgQueue_Add(const char* wlid, int msgType, const char* msg, int msgSize, filetransfer* ft, int flags, STRLIST *cnt)
+int CMsnProto::MsgQueue_Add(const char* wlid, int msgType, const char* msg, int msgSize, filetransfer* ft, int flags, STRLIST *cnt)
{
EnterCriticalSection(&csMsgQueue);
@@ -112,7 +112,7 @@ const char* CMsnProto::MsgQueue_GetNextRecipient(void)
}
//deletes from list. Must mir_free() return value
-bool CMsnProto::MsgQueue_GetNext(const char* wlid, MsgQueueEntry& retVal)
+bool CMsnProto::MsgQueue_GetNext(const char* wlid, MsgQueueEntry& retVal)
{
int i;
@@ -131,7 +131,7 @@ bool CMsnProto::MsgQueue_GetNext(const char* wlid, MsgQueueEntry& retVal)
return res;
}
-int CMsnProto::MsgQueue_NumMsg(const char* wlid)
+int CMsnProto::MsgQueue_NumMsg(const char* wlid)
{
int res = 0;
EnterCriticalSection(&csMsgQueue);
@@ -143,7 +143,7 @@ int CMsnProto::MsgQueue_NumMsg(const char* wlid)
return res;
}
-void CMsnProto::MsgQueue_Clear(const char* wlid, bool msg)
+void CMsnProto::MsgQueue_Clear(const char* wlid, bool msg)
{
int i;
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp
index 9c3c60489b..a67a378f16 100644
--- a/protocols/MSN/src/msn_p2p.cpp
+++ b/protocols/MSN/src/msn_p2p.cpp
@@ -219,8 +219,7 @@ void CMsnProto::p2p_savePicture2disk(filetransfer* ft)
if (p2p_IsDlFileOk(ft))
{
int fileId = _topen(ft->std.tszCurrentFile, O_RDONLY | _O_BINARY, _S_IREAD);
- if (fileId == -1)
- {
+ if (fileId == -1) {
p2p_pictureTransferFailed(ft);
return;
}
@@ -232,9 +231,8 @@ void CMsnProto::p2p_savePicture2disk(filetransfer* ft)
int bytes = _read(fileId, buf, sizeof(buf));
_close(fileId);
if (bytes > 4)
- format = MSN_GetImageFormat(buf, &ext);
- else
- {
+ format = ProtoGetBufferFormat(buf, &ext);
+ else {
p2p_pictureTransferFailed(ft);
return;
}
@@ -293,7 +291,7 @@ void CMsnProto::p2p_savePicture2disk(filetransfer* ft)
static const char sttVoidSession[] = "ACHTUNG!!! an attempt made to send a message via the empty session";
-void CMsnProto::p2p_sendMsg(const char *wlid, unsigned appId, P2PB_Header& hdrdata, char* msgbody, size_t msgsz)
+void CMsnProto::p2p_sendMsg(const char *wlid, unsigned appId, P2PB_Header& hdrdata, char* msgbody, size_t msgsz)
{
ThreadData* info = MSN_GetP2PThreadByContact(wlid);
if (info == NULL)
@@ -304,7 +302,7 @@ void CMsnProto::p2p_sendMsg(const char *wlid, unsigned appId, P2PB_Header& hdrd
p2p_sendMsg(info, wlid, appId, hdrdata, msgbody, msgsz);
}
-void CMsnProto::p2p_sendMsg(ThreadData* info, const char *wlid, unsigned appId, P2PB_Header& hdrdata, char* msgbody, size_t msgsz)
+void CMsnProto::p2p_sendMsg(ThreadData* info, const char *wlid, unsigned appId, P2PB_Header& hdrdata, char* msgbody, size_t msgsz)
{
unsigned msgType;
@@ -416,7 +414,7 @@ void CMsnProto::p2p_sendMsg(ThreadData* info, const char *wlid, unsigned appId,
}
-void CMsnProto::p2p_sendAck(const char *wlid, P2PB_Header* hdr)
+void CMsnProto::p2p_sendAck(const char *wlid, P2PB_Header* hdr)
{
if (hdr == NULL) return;
@@ -448,7 +446,7 @@ void CMsnProto::p2p_sendAck(const char *wlid, P2PB_Header* hdr)
/////////////////////////////////////////////////////////////////////////////////////////
// p2p_sendEndSession - sends MSN P2P file transfer end packet
-void CMsnProto::p2p_sendAbortSession(filetransfer* ft)
+void CMsnProto::p2p_sendAbortSession(filetransfer* ft)
{
if (ft == NULL)
{
@@ -480,7 +478,7 @@ void CMsnProto::p2p_sendAbortSession(filetransfer* ft)
ft->ts = time(NULL);
}
-void CMsnProto::p2p_sendRedirect(filetransfer* ft)
+void CMsnProto::p2p_sendRedirect(filetransfer* ft)
{
if (ft == NULL)
{
@@ -507,7 +505,7 @@ void CMsnProto::p2p_sendRedirect(filetransfer* ft)
/////////////////////////////////////////////////////////////////////////////////////////
// p2p_sendSlp - send MSN P2P SLP packet
-void CMsnProto::p2p_sendSlp(int iKind, filetransfer *ft, MimeHeaders &pHeaders,
+void CMsnProto::p2p_sendSlp(int iKind, filetransfer *ft, MimeHeaders &pHeaders,
MimeHeaders &pContent, const char *wlid)
{
if (ft == NULL)
@@ -602,7 +600,7 @@ void CMsnProto::p2p_sendSlp(int iKind, filetransfer *ft, MimeHeaders &pHeaders,
/////////////////////////////////////////////////////////////////////////////////////////
// p2p_sendBye - closes P2P session
-void CMsnProto::p2p_sendBye(filetransfer* ft)
+void CMsnProto::p2p_sendBye(filetransfer* ft)
{
if (ft == NULL)
{
@@ -623,13 +621,13 @@ void CMsnProto::p2p_sendBye(filetransfer* ft)
p2p_sendSlp(-1, ft, tHeaders, chdrs);
}
-void CMsnProto::p2p_sendCancel(filetransfer* ft)
+void CMsnProto::p2p_sendCancel(filetransfer* ft)
{
p2p_sendBye(ft);
p2p_sendAbortSession(ft);
}
-void CMsnProto::p2p_sendNoCall(filetransfer* ft)
+void CMsnProto::p2p_sendNoCall(filetransfer* ft)
{
if (ft == NULL)
{
@@ -653,7 +651,7 @@ void CMsnProto::p2p_sendNoCall(filetransfer* ft)
/////////////////////////////////////////////////////////////////////////////////////////
// p2p_sendStatus - send MSN P2P status and its description
-void CMsnProto::p2p_sendStatus(filetransfer* ft, long lStatus)
+void CMsnProto::p2p_sendStatus(filetransfer* ft, long lStatus)
{
if (ft == NULL)
{
@@ -681,7 +679,7 @@ void CMsnProto::p2p_sendStatus(filetransfer* ft, long lStatus)
p2p_sendSlp(lStatus, ft, tHeaders, chdrs);
}
-void CMsnProto::p2p_sendAvatarInit(filetransfer* ft)
+void CMsnProto::p2p_sendAvatarInit(filetransfer* ft)
{
unsigned body = 0;
@@ -888,7 +886,7 @@ LBL_Error:
return true;
}
-LONG CMsnProto::p2p_sendPortion(filetransfer* ft, ThreadData* T, bool isV2)
+LONG CMsnProto::p2p_sendPortion(filetransfer* ft, ThreadData* T, bool isV2)
{
LONG trid;
char databuf[1500], *p = databuf;
@@ -1068,7 +1066,7 @@ void __cdecl CMsnProto::p2p_sendFeedThread(void* arg)
}
-void CMsnProto::p2p_sendFeedStart(filetransfer* ft)
+void CMsnProto::p2p_sendFeedStart(filetransfer* ft)
{
if (ft->std.flags & PFTS_SENDING)
{
@@ -1860,7 +1858,7 @@ void CMsnProto::p2p_processSIP(ThreadData* info, char* msgbody, P2PB_Header* hdr
/////////////////////////////////////////////////////////////////////////////////////////
// p2p_processMsg - processes all MSN P2P incoming messages
-void CMsnProto::p2p_processMsgV2(ThreadData* info, char* msgbody, const char* wlid)
+void CMsnProto::p2p_processMsgV2(ThreadData* info, char* msgbody, const char* wlid)
{
P2PV2_Header hdrdata;
@@ -1966,7 +1964,7 @@ void CMsnProto::p2p_processMsgV2(ThreadData* info, char* msgbody, const char*
}
}
-void CMsnProto::p2p_processMsg(ThreadData* info, char* msgbody, const char* wlid)
+void CMsnProto::p2p_processMsg(ThreadData* info, char* msgbody, const char* wlid)
{
P2P_Header hdrdata;
msgbody = hdrdata.parseMsg(msgbody);
@@ -2153,7 +2151,7 @@ void CMsnProto::p2p_processMsg(ThreadData* info, char* msgbody, const char* wl
/////////////////////////////////////////////////////////////////////////////////////////
// p2p_invite - invite another side to transfer an avatar
-void CMsnProto::p2p_invite(unsigned iAppID, filetransfer* ft, const char *wlid)
+void CMsnProto::p2p_invite(unsigned iAppID, filetransfer* ft, const char *wlid)
{
const char* szAppID;
switch(iAppID)
@@ -2394,7 +2392,7 @@ void CMsnProto::p2p_sendSessionAck(filetransfer* ft)
p2p_sendSlp(-3, ft, tResult, chdrs);
}
*/
-void CMsnProto::p2p_sessionComplete(filetransfer* ft)
+void CMsnProto::p2p_sessionComplete(filetransfer* ft)
{
if (ft->p2p_appID != MSN_APPID_FILE)
p2p_unregisterSession(ft);
diff --git a/protocols/MSN/src/msn_p2ps.cpp b/protocols/MSN/src/msn_p2ps.cpp
index 4bfb86d1ee..b642180695 100644
--- a/protocols/MSN/src/msn_p2ps.cpp
+++ b/protocols/MSN/src/msn_p2ps.cpp
@@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////////////////
// add file session to a list
-void CMsnProto::p2p_registerSession(filetransfer* ft)
+void CMsnProto::p2p_registerSession(filetransfer* ft)
{
EnterCriticalSection(&sessionLock);
sessionList.insert(ft);
@@ -36,7 +36,7 @@ void CMsnProto::p2p_registerSession(filetransfer* ft)
/////////////////////////////////////////////////////////////////////////////////////////
// remove file session from a list
-void CMsnProto::p2p_unregisterSession(filetransfer* ft)
+void CMsnProto::p2p_unregisterSession(filetransfer* ft)
{
EnterCriticalSection(&sessionLock);
// int idx = sessionList.getIndex(ft);
@@ -48,7 +48,7 @@ void CMsnProto::p2p_unregisterSession(filetransfer* ft)
/////////////////////////////////////////////////////////////////////////////////////////
// get session by some parameter
-filetransfer* CMsnProto::p2p_getSessionByID(unsigned id)
+filetransfer* CMsnProto::p2p_getSessionByID(unsigned id)
{
if (id == 0)
return NULL;
@@ -73,7 +73,7 @@ filetransfer* CMsnProto::p2p_getSessionByID(unsigned id)
return ft;
}
-filetransfer* CMsnProto::p2p_getSessionByUniqueID(unsigned id)
+filetransfer* CMsnProto::p2p_getSessionByUniqueID(unsigned id)
{
if (id == 0)
return NULL;
@@ -99,7 +99,7 @@ filetransfer* CMsnProto::p2p_getSessionByUniqueID(unsigned id)
}
-bool CMsnProto::p2p_sessionRegistered(filetransfer* ft)
+bool CMsnProto::p2p_sessionRegistered(filetransfer* ft)
{
if (ft != NULL && ft->p2p_appID == 0)
return true;
@@ -110,7 +110,7 @@ bool CMsnProto::p2p_sessionRegistered(filetransfer* ft)
return idx > -1;
}
-filetransfer* CMsnProto::p2p_getThreadSession(HANDLE hContact, TInfoType mType)
+filetransfer* CMsnProto::p2p_getThreadSession(HANDLE hContact, TInfoType mType)
{
EnterCriticalSection(&sessionLock);
@@ -129,7 +129,7 @@ filetransfer* CMsnProto::p2p_getThreadSession(HANDLE hContact, TInfoType mType)
return result;
}
-void CMsnProto::p2p_clearThreadSessions(HANDLE hContact, TInfoType mType)
+void CMsnProto::p2p_clearThreadSessions(HANDLE hContact, TInfoType mType)
{
EnterCriticalSection(&sessionLock);
@@ -147,7 +147,7 @@ void CMsnProto::p2p_clearThreadSessions(HANDLE hContact, TInfoType mType)
LeaveCriticalSection(&sessionLock);
}
-filetransfer* CMsnProto::p2p_getAvatarSession(HANDLE hContact)
+filetransfer* CMsnProto::p2p_getAvatarSession(HANDLE hContact)
{
EnterCriticalSection(&sessionLock);
@@ -165,7 +165,7 @@ filetransfer* CMsnProto::p2p_getAvatarSession(HANDLE hContact)
return result;
}
-bool CMsnProto::p2p_isAvatarOnly(HANDLE hContact)
+bool CMsnProto::p2p_isAvatarOnly(HANDLE hContact)
{
EnterCriticalSection(&sessionLock);
@@ -180,7 +180,7 @@ bool CMsnProto::p2p_isAvatarOnly(HANDLE hContact)
return result;
}
-void CMsnProto::p2p_clearDormantSessions(void)
+void CMsnProto::p2p_clearDormantSessions(void)
{
EnterCriticalSection(&sessionLock);
@@ -204,7 +204,7 @@ void CMsnProto::p2p_clearDormantSessions(void)
LeaveCriticalSection(&sessionLock);
}
-void CMsnProto::p2p_redirectSessions(const char *wlid)
+void CMsnProto::p2p_redirectSessions(const char *wlid)
{
EnterCriticalSection(&sessionLock);
@@ -232,7 +232,7 @@ void CMsnProto::p2p_redirectSessions(const char *wlid)
LeaveCriticalSection(&sessionLock);
}
-void CMsnProto::p2p_startSessions(const char* wlid)
+void CMsnProto::p2p_startSessions(const char* wlid)
{
EnterCriticalSection(&sessionLock);
@@ -254,7 +254,7 @@ void CMsnProto::p2p_startSessions(const char* wlid)
LeaveCriticalSection(&sessionLock);
}
-void CMsnProto::p2p_cancelAllSessions(void)
+void CMsnProto::p2p_cancelAllSessions(void)
{
EnterCriticalSection(&sessionLock);
@@ -267,7 +267,7 @@ void CMsnProto::p2p_cancelAllSessions(void)
LeaveCriticalSection(&sessionLock);
}
-filetransfer* CMsnProto::p2p_getSessionByCallID(const char* CallID, const char* wlid)
+filetransfer* CMsnProto::p2p_getSessionByCallID(const char* CallID, const char* wlid)
{
if (CallID == NULL)
return NULL;
@@ -301,21 +301,21 @@ filetransfer* CMsnProto::p2p_getSessionByCallID(const char* CallID, const char*
}
-void CMsnProto::p2p_registerDC(directconnection* dc)
+void CMsnProto::p2p_registerDC(directconnection* dc)
{
EnterCriticalSection(&sessionLock);
dcList.insert(dc);
LeaveCriticalSection(&sessionLock);
}
-void CMsnProto::p2p_unregisterDC(directconnection* dc)
+void CMsnProto::p2p_unregisterDC(directconnection* dc)
{
EnterCriticalSection(&sessionLock);
dcList.remove(dc);
LeaveCriticalSection(&sessionLock);
}
-directconnection* CMsnProto::p2p_getDCByCallID(const char* CallID, const char* wlid)
+directconnection* CMsnProto::p2p_getDCByCallID(const char* CallID, const char* wlid)
{
if (CallID == NULL)
return NULL;
diff --git a/protocols/MSN/src/msn_srv.cpp b/protocols/MSN/src/msn_srv.cpp
index 5e92edd0f9..984f49d2c6 100644
--- a/protocols/MSN/src/msn_srv.cpp
+++ b/protocols/MSN/src/msn_srv.cpp
@@ -227,7 +227,7 @@ void CMsnProto::MSN_RenameServerGroup(LPCSTR szId, const char* newName)
/////////////////////////////////////////////////////////////////////////////////////////
// MSN_UploadServerGroups - adds a group to the server list and contacts into the group
-void CMsnProto::MSN_UploadServerGroups(char* group)
+void CMsnProto::MSN_UploadServerGroups(char* group)
{
if (!MyOptions.ManageServer) return;
@@ -314,7 +314,7 @@ void CMsnProto::MSN_SyncContactToServerGroup(HANDLE hContact, const char* szCont
/////////////////////////////////////////////////////////////////////////////////////////
// Msn_SendNickname - update our own nickname on the server
-void CMsnProto::MSN_SendNicknameUtf(const char* nickname)
+void CMsnProto::MSN_SendNicknameUtf(const char* nickname)
{
if (nickname[0])
setStringUtf(NULL, "Nick", nickname);
@@ -326,7 +326,7 @@ void CMsnProto::MSN_SendNicknameUtf(const char* nickname)
ForkThread(&CMsnProto::msn_storeProfileThread, (void*)1);
}
-void CMsnProto::MSN_SetNicknameUtf(const char* nickname)
+void CMsnProto::MSN_SetNicknameUtf(const char* nickname)
{
const size_t urlNickSz = strlen(nickname) * 3 + 1;
char* urlNick = (char*)alloca(urlNickSz);
diff --git a/protocols/MSN/src/msn_std.cpp b/protocols/MSN/src/msn_std.cpp
index 2b7d56a6df..06f6d9c9eb 100644
--- a/protocols/MSN/src/msn_std.cpp
+++ b/protocols/MSN/src/msn_std.cpp
@@ -34,7 +34,7 @@ int CMsnProto::getStringUtf(const char* name, DBVARIANT* result)
{ return db_get_utf(NULL, m_szModuleName, name, result);
}
-int CMsnProto::getStaticString(HANDLE hContact, const char* valueName, char* dest, unsigned dest_len)
+int CMsnProto::getStaticString(HANDLE hContact, const char* valueName, char* dest, unsigned dest_len)
{
DBVARIANT dbv;
dbv.pszVal = dest;
diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp
index ee59fdccde..5f1db4ff16 100644
--- a/protocols/MSN/src/msn_svcs.cpp
+++ b/protocols/MSN/src/msn_svcs.cpp
@@ -77,7 +77,7 @@ INT_PTR CMsnProto::GetAvatarInfo(WPARAM wParam,LPARAM lParam)
if (AI->hContact == NULL || _stricmp(cont->email, MyOptions.szEmail) == 0) {
MSN_GetAvatarFileName(NULL, filename, SIZEOF(filename), NULL);
- AI->format = MSN_GetImageFormat(filename);
+ AI->format = ProtoGetAvatarFormat(filename);
if (AI->format != PA_FORMAT_UNKNOWN)
_tcscpy(AI->filename, filename);
return AI->format == PA_FORMAT_UNKNOWN ? GAIR_NOAVATAR : GAIR_SUCCESS;
@@ -92,7 +92,7 @@ INT_PTR CMsnProto::GetAvatarInfo(WPARAM wParam,LPARAM lParam)
else return GAIR_NOAVATAR;
MSN_GetAvatarFileName(AI->hContact, filename, SIZEOF(filename), NULL);
- AI->format = MSN_GetImageFormat(filename);
+ AI->format = ProtoGetAvatarFormat(filename);
if (AI->format != PA_FORMAT_UNKNOWN) {
bool needupdate = true;
diff --git a/protocols/MSN/src/msn_threads.cpp b/protocols/MSN/src/msn_threads.cpp
index 8640a40140..e25bbb7085 100644
--- a/protocols/MSN/src/msn_threads.cpp
+++ b/protocols/MSN/src/msn_threads.cpp
@@ -300,12 +300,12 @@ LBL_Exit:
MSN_DebugLog("Thread [%08X] ending now", GetCurrentThreadId());
}
-void CMsnProto::MSN_InitThreads(void)
+void CMsnProto::MSN_InitThreads(void)
{
InitializeCriticalSection(&sttLock);
}
-void CMsnProto::MSN_CloseConnections(void)
+void CMsnProto::MSN_CloseConnections(void)
{
EnterCriticalSection(&sttLock);
@@ -349,7 +349,7 @@ void CMsnProto::Threads_Uninit(void)
DeleteCriticalSection(&sttLock);
}
-ThreadData* CMsnProto::MSN_GetThreadByContact(const char* wlid, TInfoType type)
+ThreadData* CMsnProto::MSN_GetThreadByContact(const char* wlid, TInfoType type)
{
ThreadData* result = NULL;
EnterCriticalSection(&sttLock);
@@ -393,7 +393,7 @@ ThreadData* CMsnProto::MSN_GetThreadByContact(const char* wlid, TInfoType type)
return result;
}
-ThreadData* CMsnProto::MSN_GetThreadByChatId(const TCHAR* chatId)
+ThreadData* CMsnProto::MSN_GetThreadByChatId(const TCHAR* chatId)
{
ThreadData* result = NULL;
EnterCriticalSection(&sttLock);
@@ -413,7 +413,7 @@ ThreadData* CMsnProto::MSN_GetThreadByChatId(const TCHAR* chatId)
return result;
}
-ThreadData* CMsnProto::MSN_GetThreadByTimer(UINT timerId)
+ThreadData* CMsnProto::MSN_GetThreadByTimer(UINT timerId)
{
ThreadData* result = NULL;
EnterCriticalSection(&sttLock);
@@ -432,7 +432,7 @@ ThreadData* CMsnProto::MSN_GetThreadByTimer(UINT timerId)
return result;
}
-ThreadData* CMsnProto::MSN_GetP2PThreadByContact(const char *wlid)
+ThreadData* CMsnProto::MSN_GetP2PThreadByContact(const char *wlid)
{
ThreadData *result = NULL;
@@ -479,7 +479,7 @@ ThreadData* CMsnProto::MSN_GetP2PThreadByContact(const char *wlid)
}
-void CMsnProto::MSN_StartP2PTransferByContact(const char* wlid)
+void CMsnProto::MSN_StartP2PTransferByContact(const char* wlid)
{
EnterCriticalSection(&sttLock);
@@ -499,7 +499,7 @@ void CMsnProto::MSN_StartP2PTransferByContact(const char* wlid)
}
-ThreadData* CMsnProto::MSN_GetOtherContactThread(ThreadData* thread)
+ThreadData* CMsnProto::MSN_GetOtherContactThread(ThreadData* thread)
{
ThreadData* result = NULL;
EnterCriticalSection(&sttLock);
@@ -521,7 +521,7 @@ ThreadData* CMsnProto::MSN_GetOtherContactThread(ThreadData* thread)
return result;
}
-ThreadData* CMsnProto::MSN_GetUnconnectedThread(const char* wlid, TInfoType type)
+ThreadData* CMsnProto::MSN_GetUnconnectedThread(const char* wlid, TInfoType type)
{
ThreadData* result = NULL;
EnterCriticalSection(&sttLock);
@@ -567,7 +567,7 @@ ThreadData* CMsnProto::MSN_StartSB(const char* wlid, bool& isOffline)
-int CMsnProto::MSN_GetActiveThreads(ThreadData** parResult)
+int CMsnProto::MSN_GetActiveThreads(ThreadData** parResult)
{
int tCount = 0;
EnterCriticalSection(&sttLock);
@@ -583,7 +583,7 @@ int CMsnProto::MSN_GetActiveThreads(ThreadData** parResult)
return tCount;
}
-ThreadData* CMsnProto::MSN_GetThreadByConnection(HANDLE s)
+ThreadData* CMsnProto::MSN_GetThreadByConnection(HANDLE s)
{
ThreadData* tResult = NULL;
EnterCriticalSection(&sttLock);
@@ -602,7 +602,7 @@ ThreadData* CMsnProto::MSN_GetThreadByConnection(HANDLE s)
return tResult;
}
-ThreadData* CMsnProto::MSN_GetThreadByPort(WORD wPort)
+ThreadData* CMsnProto::MSN_GetThreadByPort(WORD wPort)
{
ThreadData* result = NULL;
EnterCriticalSection(&sttLock);