summaryrefslogtreecommitdiff
path: root/protocols/MRA
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-09-23 08:48:10 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-09-23 08:48:10 +0000
commitb187dec174464107ab1e841bb57735f2244f805d (patch)
treeb4411113c881507eab0a86955703231f91a20538 /protocols/MRA
parent9e5810f34a7d813ea9d4c3026f06898d6fe7dc0b (diff)
- compilation fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@1632 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA')
-rw-r--r--protocols/MRA/Mra.cpp6
-rw-r--r--protocols/MRA/MraChat.cpp296
-rw-r--r--protocols/MRA/MraProto.cpp6
-rw-r--r--protocols/MRA/MraProto.h2
4 files changed, 114 insertions, 196 deletions
diff --git a/protocols/MRA/Mra.cpp b/protocols/MRA/Mra.cpp
index 52d05db75f..0a8bae22b6 100644
--- a/protocols/MRA/Mra.cpp
+++ b/protocols/MRA/Mra.cpp
@@ -92,11 +92,11 @@ extern "C" MRA_API int Load(void)
masMraSettings.szMirWorkDirPath[masMraSettings.dwMirWorkDirPathLen] = 0;
// load xstatus icons lib
- DWORD dwErrorCode = FindFile(masMraSettings.szMirWorkDirPath, masMraSettings.dwMirWorkDirPathLen, L"xstatus_MRA.dll", -1, szBuff, SIZEOF(szBuff), (DWORD*)&dwBuffLen);
+ DWORD dwErrorCode = FindFile(masMraSettings.szMirWorkDirPath, (DWORD)masMraSettings.dwMirWorkDirPathLen, L"xstatus_MRA.dll", -1, szBuff, SIZEOF(szBuff), (DWORD*)&dwBuffLen);
if (dwErrorCode == NO_ERROR) {
masMraSettings.hDLLXStatusIcons = LoadLibraryEx(szBuff, NULL, 0);
if (masMraSettings.hDLLXStatusIcons) {
- if ((dwBuffLen = LoadStringW(masMraSettings.hDLLXStatusIcons, IDS_IDENTIFY, szBuff, MAX_FILEPATH)) == 0 || CompareStringW( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, L"# Custom Status Icons #", 23, szBuff, dwBuffLen) != CSTR_EQUAL) {
+ if ((dwBuffLen = LoadStringW(masMraSettings.hDLLXStatusIcons, IDS_IDENTIFY, szBuff, MAX_FILEPATH)) == 0 || _wcsnicmp(L"# Custom Status Icons #", szBuff, 23)) {
FreeLibrary(masMraSettings.hDLLXStatusIcons);
masMraSettings.hDLLXStatusIcons = NULL;
}
@@ -104,7 +104,7 @@ extern "C" MRA_API int Load(void)
}
// load zlib
- dwErrorCode = FindFile(masMraSettings.szMirWorkDirPath, masMraSettings.dwMirWorkDirPathLen, L"zlib.dll", -1, szBuff, SIZEOF(szBuff), (DWORD*)&dwBuffLen);
+ dwErrorCode = FindFile(masMraSettings.szMirWorkDirPath, (DWORD)masMraSettings.dwMirWorkDirPathLen, L"zlib.dll", -1, szBuff, SIZEOF(szBuff), (DWORD*)&dwBuffLen);
if (dwErrorCode == NO_ERROR) {
masMraSettings.hDLLZLib = LoadLibraryEx(szBuff, NULL, 0);
if (masMraSettings.hDLLZLib) {
diff --git a/protocols/MRA/MraChat.cpp b/protocols/MRA/MraChat.cpp
index 4c2140347a..1dfb9dba8d 100644
--- a/protocols/MRA/MraChat.cpp
+++ b/protocols/MRA/MraChat.cpp
@@ -2,19 +2,12 @@
#include "MraChat.h"
#include "proto.h"
-
-
-//static COLORREF crCols[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
static LPWSTR lpwszStatuses[] = { L"Owners", L"Inviter", L"Visitors" };
#define MRA_CHAT_STATUS_OWNER 0
#define MRA_CHAT_STATUS_INVITER 1
#define MRA_CHAT_STATUS_VISITOR 2
-
-
-
-void MraChatSendPrivateMessage (LPWSTR lpwszEMail);
-
+void MraChatSendPrivateMessage(LPWSTR lpwszEMail);
void CMraProto::MraChatDllError()
{
@@ -39,14 +32,10 @@ BOOL CMraProto::MraChatRegister()
return TRUE;
}
-
INT_PTR CMraProto::MraChatSessionNew(HANDLE hContact)
{
- INT_PTR iRet = 1;
-
if (bChatExists)
- if (hContact)
- {
+ if (hContact) {
GCSESSION gcw = {0};
WCHAR wszEMail[MAX_EMAIL_LEN] = {0};
@@ -59,10 +48,7 @@ INT_PTR CMraProto::MraChatSessionNew(HANDLE hContact)
gcw.dwFlags = GC_UNICODE;
gcw.dwItemData = (DWORD)hContact;
mraGetStaticStringW(hContact, "e-mail", wszEMail, SIZEOF(wszEMail), NULL);
- iRet = CallServiceSync(MS_GC_NEWSESSION, NULL, (LPARAM)&gcw);
-
- if (iRet == 0)
- {
+ if ( !CallServiceSync(MS_GC_NEWSESSION, NULL, (LPARAM)&gcw)) {
CHAR szEMail[MAX_EMAIL_LEN] = {0};
size_t dwEMailSize;
GCDEST gcd = {0};
@@ -75,8 +61,7 @@ INT_PTR CMraProto::MraChatSessionNew(HANDLE hContact)
gce.cbSize = sizeof(GCEVENT);
gce.pDest = &gcd;
gce.dwFlags = GC_UNICODE;
- for (size_t i = 0;i<SIZEOF(lpwszStatuses);i++)
- {
+ for (int i = 0; i < SIZEOF(lpwszStatuses); i++) {
gce.ptszStatus = TranslateW(lpwszStatuses[i]);
CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
}
@@ -92,250 +77,188 @@ INT_PTR CMraProto::MraChatSessionNew(HANDLE hContact)
(*(DWORD*)wszEMail) = MULTICHAT_GET_MEMBERS;
mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize);
MraMessageW(FALSE, NULL, 0, MESSAGE_FLAG_MULTICHAT, szEMail, dwEMailSize, NULL, 0, (LPBYTE)wszEMail, 4);
+ return 0;
}
}
- return(iRet);
+ return 1;
}
-
void CMraProto::MraChatSessionDestroy(HANDLE hContact)
{
- if (bChatExists)
- {
- GCDEST gcd = {0};
- GCEVENT gce = {0};
- WCHAR wszEMail[MAX_EMAIL_LEN] = {0};
+ if ( !bChatExists)
+ return;
- gcd.pszModule = m_szModuleName;
- gcd.iType = GC_EVENT_CONTROL;
- if (hContact)
- {
- gcd.ptszID = (LPWSTR)wszEMail;
- mraGetStaticStringW(hContact, "e-mail", wszEMail, SIZEOF(wszEMail), NULL);
- }
- gce.cbSize = sizeof(GCEVENT);
- gce.pDest = &gcd;
- gce.dwFlags = GC_UNICODE;
+ GCDEST gcd = {0};
+ GCEVENT gce = {0};
+ WCHAR wszEMail[MAX_EMAIL_LEN] = {0};
- CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, (LPARAM)&gce);
- CallServiceSync(MS_GC_EVENT, WINDOW_CLEARLOG, (LPARAM)&gce);
+ gcd.pszModule = m_szModuleName;
+ gcd.iType = GC_EVENT_CONTROL;
+ if (hContact) {
+ gcd.ptszID = (LPWSTR)wszEMail;
+ mraGetStaticStringW(hContact, "e-mail", wszEMail, SIZEOF(wszEMail), NULL);
}
+ gce.cbSize = sizeof(GCEVENT);
+ gce.pDest = &gcd;
+ gce.dwFlags = GC_UNICODE;
+
+ CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, (LPARAM)&gce);
+ CallServiceSync(MS_GC_EVENT, WINDOW_CLEARLOG, (LPARAM)&gce);
}
INT_PTR CMraProto::MraChatSessionEventSendByHandle(HANDLE hContactChatSession, DWORD dwType, DWORD dwFlags, LPSTR lpszUID, size_t dwUIDSize, LPWSTR lpwszStatus, LPWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime)
{
- INT_PTR iRet = 1;
+ if (!bChatExists)
+ return 1;
- if (bChatExists)
- {
- GCDEST gcd = {0};
- GCEVENT gce = {0};
- WCHAR wszID[MAX_EMAIL_LEN] = {0}, wszUID[MAX_EMAIL_LEN] = {0}, wszNick[MAX_EMAIL_LEN] = {0};
-
- gcd.pszModule = m_szModuleName;
- if (hContactChatSession)
- {
- gcd.ptszID = (LPWSTR)wszID;
- mraGetStaticStringW(hContactChatSession, "e-mail", wszID, SIZEOF(wszID), NULL);
- }
- gcd.iType = dwType;
-
- gce.cbSize = sizeof(GCEVENT);
- gce.pDest = &gcd;
- gce.dwFlags = GC_UNICODE|dwFlags;
- gce.ptszUID = wszUID;
- gce.ptszStatus = lpwszStatus;
- gce.ptszText = lpwszMessage;
- gce.dwItemData = dwItemData;
- gce.time = dwTime;
-
- if (lpszUID && dwUIDSize)
- {
- gce.bIsMe = IsEMailMy(lpszUID, dwUIDSize);
- }else {
- gce.bIsMe = TRUE;
- }
+ WCHAR wszID[MAX_EMAIL_LEN] = {0}, wszUID[MAX_EMAIL_LEN] = {0}, wszNick[MAX_EMAIL_LEN] = {0};
- if (gce.bIsMe)
- {
- mraGetStaticStringW(NULL, "e-mail", wszUID, SIZEOF(wszUID), NULL);
- mraGetStaticStringW(NULL, "Nick", wszNick, SIZEOF(wszNick), NULL);
- gce.ptszNick = wszNick;
- }else {
- HANDLE hContactSender;
-
- hContactSender = MraHContactFromEmail(lpszUID, dwUIDSize, FALSE, TRUE, NULL);
- MultiByteToWideChar(MRA_CODE_PAGE, 0, lpszUID, dwUIDSize, wszUID, SIZEOF(wszUID));
- if (hContactSender)
- {
- gce.ptszNick = GetContactNameW(hContactSender);
- }else {
- gce.ptszNick = wszUID;
- }
- }
-
- iRet = CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
+ GCDEST gcd = {0};
+ gcd.pszModule = m_szModuleName;
+ if (hContactChatSession) {
+ gcd.ptszID = (LPWSTR)wszID;
+ mraGetStaticStringW(hContactChatSession, "e-mail", wszID, SIZEOF(wszID), NULL);
+ }
+ gcd.iType = dwType;
+
+ GCEVENT gce = {0};
+ gce.cbSize = sizeof(GCEVENT);
+ gce.pDest = &gcd;
+ gce.dwFlags = GC_UNICODE|dwFlags;
+ gce.ptszUID = wszUID;
+ gce.ptszStatus = lpwszStatus;
+ gce.ptszText = lpwszMessage;
+ gce.dwItemData = dwItemData;
+ gce.time = dwTime;
+
+ if (lpszUID && dwUIDSize)
+ gce.bIsMe = IsEMailMy(lpszUID, dwUIDSize);
+ else
+ gce.bIsMe = TRUE;
+
+ if (gce.bIsMe) {
+ mraGetStaticStringW(NULL, "e-mail", wszUID, SIZEOF(wszUID), NULL);
+ mraGetStaticStringW(NULL, "Nick", wszNick, SIZEOF(wszNick), NULL);
+ gce.ptszNick = wszNick;
}
-return(iRet);
+ else {
+ HANDLE hContactSender = MraHContactFromEmail(lpszUID, dwUIDSize, FALSE, TRUE, NULL);
+ MultiByteToWideChar(MRA_CODE_PAGE, 0, lpszUID, (DWORD)dwUIDSize, wszUID, SIZEOF(wszUID));
+ if (hContactSender)
+ gce.ptszNick = GetContactNameW(hContactSender);
+ else
+ gce.ptszNick = wszUID;
+ }
+
+ return CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
}
INT_PTR CMraProto::MraChatSessionInvite(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime)
{
- INT_PTR iRet = 1;
-
- if (hContactChatSession)
- {
- WCHAR wszEMailInMultiChat[MAX_EMAIL_LEN] = {0}, wszBuff[((MAX_EMAIL_LEN*2)+MAX_PATH)];
+ if (!hContactChatSession)
+ return 1;
- MultiByteToWideChar(MRA_CODE_PAGE, 0, lpszEMailInMultiChat, dwEMailInMultiChatSize, wszEMailInMultiChat, SIZEOF(wszEMailInMultiChat));
- mir_sntprintf(wszBuff, SIZEOF(wszBuff), L"[%s]: %s", wszEMailInMultiChat, TranslateW(L"invite sender"));
-
- iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, dwEMailInMultiChatSize, NULL, wszBuff, 0, dwTime);
- }
-return(iRet);
+ WCHAR wszBuff[((MAX_EMAIL_LEN*2)+MAX_PATH)];
+ mir_sntprintf(wszBuff, SIZEOF(wszBuff), L"[%s]: %s", _A2T(lpszEMailInMultiChat), TranslateW(L"invite sender"));
+ return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, dwEMailInMultiChatSize, NULL, wszBuff, 0, dwTime);
}
-
INT_PTR CMraProto::MraChatSessionMembersAdd(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime)
{
- INT_PTR iRet = 1;
-
- if (hContactChatSession)
- {
- WCHAR wszEMailInMultiChat[MAX_EMAIL_LEN] = {0}, wszBuff[((MAX_EMAIL_LEN*2)+MAX_PATH)];
-
- MultiByteToWideChar(MRA_CODE_PAGE, 0, lpszEMailInMultiChat, dwEMailInMultiChatSize, wszEMailInMultiChat, SIZEOF(wszEMailInMultiChat));
- mir_sntprintf(wszBuff, SIZEOF(wszBuff), L"[%s]: %s", wszEMailInMultiChat, TranslateW(L"invite new members"));
+ if (!hContactChatSession)
+ return 1;
- iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, dwEMailInMultiChatSize, NULL, wszBuff, 0, dwTime);
- }
-return(iRet);
+ WCHAR wszBuff[((MAX_EMAIL_LEN*2)+MAX_PATH)];
+ mir_sntprintf(wszBuff, SIZEOF(wszBuff), L"[%s]: %s", _A2T(lpszEMailInMultiChat), TranslateW(L"invite new members"));
+ return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, dwEMailInMultiChatSize, NULL, wszBuff, 0, dwTime);
}
-
INT_PTR CMraProto::MraChatSessionJoinUser(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime)
{
- INT_PTR iRet = 1;
-
if (hContactChatSession)
- {
- iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_JOIN, GCEF_ADDTOLOG, lpszEMailInMultiChat, dwEMailInMultiChatSize, lpwszStatuses[MRA_CHAT_STATUS_VISITOR], L"", 0, dwTime);
- }
-return(iRet);
-}
+ return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_JOIN, GCEF_ADDTOLOG, lpszEMailInMultiChat, dwEMailInMultiChatSize, lpwszStatuses[MRA_CHAT_STATUS_VISITOR], L"", 0, dwTime);
+ return 1;
+}
INT_PTR CMraProto::MraChatSessionLeftUser(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime)
{
- INT_PTR iRet = 1;
-
if (hContactChatSession)
- {
- iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_PART, GCEF_ADDTOLOG, lpszEMailInMultiChat, dwEMailInMultiChatSize, NULL, NULL, 0, dwTime);
- }
-return(iRet);
-}
+ return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_PART, GCEF_ADDTOLOG, lpszEMailInMultiChat, dwEMailInMultiChatSize, NULL, NULL, 0, dwTime);
+ return 1;
+}
INT_PTR CMraProto::MraChatSessionSetIviter(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize)
{
- INT_PTR iRet = 1;
-
if (hContactChatSession && lpszEMailInMultiChat && dwEMailInMultiChatSize)
- {
- //iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_REMOVESTATUS, 0, lpszEMailInMultiChat, dwEMailInMultiChatSize, lpwszStatuses[MRA_CHAT_STATUS_VISITOR], NULL, 0, 0);
- iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ADDSTATUS, 0, lpszEMailInMultiChat, dwEMailInMultiChatSize, lpwszStatuses[MRA_CHAT_STATUS_INVITER], NULL, 0, 0);
- }
-return(iRet);
-}
+ return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ADDSTATUS, 0, lpszEMailInMultiChat, dwEMailInMultiChatSize, lpwszStatuses[MRA_CHAT_STATUS_INVITER], NULL, 0, 0);
+ return 1;
+}
INT_PTR CMraProto::MraChatSessionSetOwner(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize)
{
- INT_PTR iRet = 1;
-
if (hContactChatSession && lpszEMailInMultiChat && dwEMailInMultiChatSize)
- {
- iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ADDSTATUS, 0, lpszEMailInMultiChat, dwEMailInMultiChatSize, lpwszStatuses[MRA_CHAT_STATUS_OWNER], NULL, 0, 0);
- }
-return(iRet);
+ return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ADDSTATUS, 0, lpszEMailInMultiChat, dwEMailInMultiChatSize, lpwszStatuses[MRA_CHAT_STATUS_OWNER], NULL, 0, 0);
+
+ return 1;
}
INT_PTR CMraProto::MraChatSessionMessageAdd(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, LPWSTR lpwszMessage, size_t dwMessageSize, DWORD dwTime)
{
- INT_PTR iRet = 1;
-
- if (hContactChatSession)
- {
- LPWSTR lpwszMessageLocal;
-
- lpwszMessageLocal = (LPWSTR)mir_calloc((dwMessageSize*sizeof(WCHAR)));
- if (lpwszMessageLocal)
- {// we need zeros after text allways
+ if (hContactChatSession) {
+ LPWSTR lpwszMessageLocal = (LPWSTR)_alloca((dwMessageSize*sizeof(WCHAR)));
+ if (lpwszMessageLocal) { // we need zeros after text allways
memmove((LPVOID)lpwszMessageLocal, lpwszMessage, (dwMessageSize*sizeof(WCHAR)));//gce.ptszText = lpwszMessage;
-
- iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_MESSAGE, GCEF_ADDTOLOG, lpszEMailInMultiChat, dwEMailInMultiChatSize, NULL, lpwszMessageLocal, 0, dwTime);
-
- mir_free(lpwszMessageLocal);
+ return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_MESSAGE, GCEF_ADDTOLOG, lpszEMailInMultiChat, dwEMailInMultiChatSize, NULL, lpwszMessageLocal, 0, dwTime);
}
}
-return(iRet);
+ return 1;
}
int CMraProto::MraChatGcEventHook(WPARAM, LPARAM lParam)
{
- int iRet = 0;
-
if (lParam)
- if (bChatExists)
- {
+ if (bChatExists) {
GCHOOK* gch = (GCHOOK*)lParam;
if ( !_stricmp(gch->pDest->pszModule, m_szModuleName)) {
switch (gch->pDest->iType) {
case GC_USER_MESSAGE:
- if (gch->ptszText && lstrlen(gch->ptszText))
- {
- BOOL bSlowSend;
+ if (gch->ptszText && lstrlen(gch->ptszText)) {
CHAR szEMail[MAX_EMAIL_LEN] = {0};
- DWORD dwFlags = 0;
- size_t dwEMailSize, dwMessageSize;
- INT_PTR iSendRet;
- HANDLE hContact;
- //rtrim(gch->ptszText);
- //TCHAR* buf = NEWTSTR_ALLOCA(gch->ptszText);
- //UnEscapeChatTags( buf );
-
- dwMessageSize = lstrlenW(gch->ptszText);
- dwEMailSize = (WideCharToMultiByte(MRA_CODE_PAGE, 0, gch->pDest->ptszID, -1, szEMail, SIZEOF(szEMail), NULL, NULL)-1);
- hContact = MraHContactFromEmail(szEMail, dwEMailSize, FALSE, TRUE, NULL);
- bSlowSend = mraGetByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND);
+ size_t dwMessageSize = lstrlenW(gch->ptszText);
+ size_t dwEMailSize = (WideCharToMultiByte(MRA_CODE_PAGE, 0, gch->pDest->ptszID, -1, szEMail, SIZEOF(szEMail), NULL, NULL)-1);
+ HANDLE hContact = MraHContactFromEmail(szEMail, dwEMailSize, FALSE, TRUE, NULL);
+ BOOL bSlowSend = mraGetByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND);
+ DWORD dwFlags = 0;
if (mraGetByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE) && (MraContactCapabilitiesGet(hContact)&FEATURE_FLAG_RTF_MESSAGE))
- {
dwFlags |= MESSAGE_FLAG_RTF;
- }
- iSendRet = MraMessageW(bSlowSend, hContact, ACKTYPE_MESSAGE, dwFlags, szEMail, dwEMailSize, gch->ptszText, dwMessageSize, NULL, 0);
+ INT_PTR iSendRet = MraMessageW(bSlowSend, hContact, ACKTYPE_MESSAGE, dwFlags, szEMail, dwEMailSize, gch->ptszText, dwMessageSize, NULL, 0);
if (bSlowSend == FALSE)
- {
ProtoBroadcastAckAsynchEx(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)iSendRet, (LPARAM)NULL, 0);
- }
MraChatSessionEventSendByHandle(hContact, GC_EVENT_MESSAGE, GCEF_ADDTOLOG, NULL, 0, NULL, gch->ptszText, 0, (DWORD)_time32(NULL));
}
break;
+
case GC_USER_PRIVMESS:
MraChatSendPrivateMessage(gch->ptszUID);
break;
+
case GC_USER_LOGMENU:
//sttLogListHook( this, item, gch );
break;
+
case GC_USER_NICKLISTMENU:
//sttNickListHook( this, item, gch );
break;
+
case GC_USER_CHANMGR:
//int iqId = SerialNext();
//IqAdd( iqId, IQ_PROC_NONE, &CJabberProto::OnIqResultGetMuc );
@@ -344,24 +267,19 @@ int CMraProto::MraChatGcEventHook(WPARAM, LPARAM lParam)
}
}
}
- return(iRet);
+ return 0;
}
void CMraProto::MraChatSendPrivateMessage(LPWSTR lpwszEMail)
{
- BOOL bAdded;
- HANDLE hContact;
CHAR szEMail[MAX_EMAIL_LEN] = {0};
- size_t dwEMailSize;
+ size_t dwEMailSize = WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszEMail, -1, szEMail, SIZEOF(szEMail), NULL, NULL)-1;
- dwEMailSize = (WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszEMail, -1, szEMail, SIZEOF(szEMail), NULL, NULL)-1);
- hContact = MraHContactFromEmail(szEMail, dwEMailSize, TRUE, TRUE, &bAdded);
+ BOOL bAdded;
+ HANDLE hContact = MraHContactFromEmail(szEMail, dwEMailSize, TRUE, TRUE, &bAdded);
+ if (bAdded)
+ DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
- if (bAdded) DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
CallService(MS_IGNORE_UNIGNORE, (WPARAM)hContact, IGNOREEVENT_ALL);
CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
}
-
-
-
-
diff --git a/protocols/MRA/MraProto.cpp b/protocols/MRA/MraProto.cpp
index 304a8499f5..5b4ea2ac4e 100644
--- a/protocols/MRA/MraProto.cpp
+++ b/protocols/MRA/MraProto.cpp
@@ -36,7 +36,7 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) :
CreateObjectSvc(PS_SET_LISTENINGTO, &CMraProto::MraSetListeningTo);
- CreateObjectSvc(PS_CREATEACCMGRUI, &CMraProto::SvcCreateAccMgrUI);
+ CreateObjectSvc(PS_CREATEACCMGRUI, &CMraProto::MraCreateAccMgrUI);
CreateObjectSvc(PS_GETAVATARCAPS, &CMraProto::MraGetAvatarCaps);
CreateObjectSvc(PS_GETAVATARINFOT, &CMraProto::MraGetAvatarInfo);
CreateObjectSvc(PS_GETMYAVATART, &CMraProto::MraGetMyAvatar);
@@ -116,10 +116,10 @@ CMraProto::~CMraProto()
DeleteCriticalSection(&csCriticalSectionSend);
}
-int CMraProto::SvcCreateAccMgrUI(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraCreateAccMgrUI(WPARAM wParam,LPARAM lParam)
{
return (int)CreateDialogParam(masMraSettings.hInstance, MAKEINTRESOURCE(IDD_MRAACCOUNT),
- (HWND)lParam, DlgProcAccount, LPARAM(this) );
+ (HWND)lParam, DlgProcAccount, LPARAM(this));
}
int CMraProto::OnModulesLoaded(WPARAM, LPARAM)
diff --git a/protocols/MRA/MraProto.h b/protocols/MRA/MraProto.h
index 44d8eb9c34..91b0d70994 100644
--- a/protocols/MRA/MraProto.h
+++ b/protocols/MRA/MraProto.h
@@ -84,7 +84,6 @@ struct CMraProto : public PROTO_INTERFACE, public MZeroedObject
virtual int __cdecl RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT* evt);
virtual int __cdecl SendAwayMsg(HANDLE hContact, HANDLE hProcess, const char* msg);
virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR* msg);
- virtual int __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
virtual int __cdecl UserIsTyping(HANDLE hContact, int type);
@@ -183,6 +182,7 @@ struct CMraProto : public PROTO_INTERFACE, public MZeroedObject
INT_PTR __cdecl MraViewVideo(WPARAM, LPARAM);
INT_PTR __cdecl MraAnswers(WPARAM, LPARAM);
INT_PTR __cdecl MraWorld(WPARAM, LPARAM);
+ INT_PTR __cdecl MraCreateAccMgrUI(WPARAM, LPARAM);
// ====| Events |======================================================================
int __cdecl OnModulesLoaded(WPARAM, LPARAM);