diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-03-07 13:43:51 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-03-07 13:43:51 +0000 |
commit | 4036e52a03cba9c3bd345796407a851153377279 (patch) | |
tree | feb45ccd58f06bd39f5c08de00ffb02758b987ae | |
parent | 8a185f9f579656ea621956937bc3dd8b73356205 (diff) |
MRA
+ Add: hidden option "xStatusShowAll" to allow select x-status Dating
* Fix: Blog status icon does not display
* Fix: SetContactStatus for contacts without authorization on user info update* code cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@8445 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/MRA/res/resource.rc | 1 | ||||
-rw-r--r-- | protocols/MRA/src/Mra.h | 9 | ||||
-rw-r--r-- | protocols/MRA/src/MraAvatars.cpp | 2 | ||||
-rw-r--r-- | protocols/MRA/src/MraConstans.h | 18 | ||||
-rw-r--r-- | protocols/MRA/src/MraIcons.cpp | 16 | ||||
-rw-r--r-- | protocols/MRA/src/MraProto.cpp | 2 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_menus.cpp | 10 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_proto.cpp | 266 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_svcs.cpp | 23 | ||||
-rw-r--r-- | protocols/MRA/src/proto.h | 280 | ||||
-rw-r--r-- | protocols/MRA/xstatus_MRA/res/xstatus_MRA.rc | 1 | ||||
-rw-r--r-- | protocols/MRA/xstatus_MRA/src/resource.h | 3 |
12 files changed, 313 insertions, 318 deletions
diff --git a/protocols/MRA/res/resource.rc b/protocols/MRA/res/resource.rc index 0a8cf2a10c..dec2c6899d 100644 --- a/protocols/MRA/res/resource.rc +++ b/protocols/MRA/res/resource.rc @@ -41,6 +41,7 @@ IDI_MRA_POSTCARD ICON "PostCards.ico" IDI_MRA_PHOTO ICON "Photo.ico"
IDI_MRA_CHAT ICON "Chat.ico"
IDI_MRA_PHONE ICON "Phone.ico"
+IDI_BLOGSTATUS ICON "BlogStatus.ico"
IDI_MRA_ALARM ICON "Alarm.ico"
IDI_MRA_VIDEO ICON "video.ico"
IDI_MRA_ANSWERS ICON "answers.ico"
diff --git a/protocols/MRA/src/Mra.h b/protocols/MRA/src/Mra.h index b2276778f4..457d421ed7 100644 --- a/protocols/MRA/src/Mra.h +++ b/protocols/MRA/src/Mra.h @@ -33,8 +33,6 @@ #include <time.h>
#include <commctrl.h>
-#define bzero(pvDst, count) memset(pvDst, 0, count)
-
#include "../../plugins/zlib/src/zlib.h"
#include <newpluginapi.h>
@@ -204,14 +202,12 @@ CMStringA MraGetSelfVersionString(); #define SetBit(bytes, bitpos) bytes |= (1<<bitpos)
#define GetBit(bytes, bitpos) ((bytes&(1<<bitpos))? TRUE:FALSE)
-#define IsXStatusValid(XStatus) (((XStatus) && (XStatus)<MRA_XSTATUS_COUNT))
+#define IsXStatusValid(XStatus) (((XStatus) && (XStatus) < MRA_XSTATUS_COUNT))
-#define GET_CURRENT_COMBO_DATA(hWndDlg, ControlID) SendDlgItemMessage(hWndDlg, ControlID, CB_GETITEMDATA, SendDlgItemMessage(hWndDlg, ControlID, CB_GETCURSEL, 0, 0), 0)
+#define GET_CURRENT_COMBO_DATA(hWndDlg, ControlID) SendDlgItemMessage(hWndDlg, ControlID, CB_GETITEMDATA, SendDlgItemMessage(hWndDlg, ControlID, CB_GETCURSEL, 0, 0), 0)
#define IsFileExist(FileName) (GetFileAttributes(FileName) != INVALID_FILE_ATTRIBUTES)
-#define IsThreadAlive(hThread) (GetThreadPriority(hThread) != THREAD_PRIORITY_ERROR_RETURN)
-
void MraAddrListFree(MRA_ADDR_LIST *pmalAddrList);
DWORD MraAddrListGetFromBuff(const CMStringA &szAddresses, MRA_ADDR_LIST *pmalAddrList);
CMStringA MraAddrListGetToBuff(MRA_ADDR_LIST *pmalAddrList);
@@ -238,7 +234,6 @@ bool MraRequestXStatusDetails(DWORD dwXStatus); bool MraSendReplyBlogStatus(MCONTACT hContact);
DWORD GetYears(CONST PSYSTEMTIME pcstSystemTime);
DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD dwFileNameLen, LPWSTR lpszRetFilePathName, DWORD dwRetFilePathLen, DWORD *pdwRetFilePathLen);
-DWORD MemFillRandom(LPVOID lpBuff, size_t dwBuffSize);
DWORD GetMraStatusFromMiradaStatus(DWORD dwMirandaStatus, DWORD dwXStatusMir, DWORD *pdwXStatusMra);
DWORD GetMirandaStatusFromMraStatus(DWORD dwMraStatus, DWORD dwXStatusMra, DWORD *pdwXStatusMir);
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index ad70e838cc..0743fda45f 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -381,7 +381,7 @@ DWORD MraAvatarsHttpTransaction(HANDLE m_hConnection, DWORD dwRequestType, LPCST if (pbKeepAlive) *pbKeepAlive = FALSE;
if (pdwFormat) *pdwFormat = PA_FORMAT_UNKNOWN;
if (pdwAvatarSize) *pdwAvatarSize = 0;
- if (pitLastModifiedTime) bzero(pitLastModifiedTime, sizeof(INTERNET_TIME));
+ if (pitLastModifiedTime) memset(pitLastModifiedTime, 0, sizeof(INTERNET_TIME));
if (!m_hConnection)
return ERROR_INVALID_HANDLE;
diff --git a/protocols/MRA/src/MraConstans.h b/protocols/MRA/src/MraConstans.h index 493206d0a2..e68f4dcfc5 100644 --- a/protocols/MRA/src/MraConstans.h +++ b/protocols/MRA/src/MraConstans.h @@ -27,8 +27,8 @@ static const LPSTR lpcszMailRuDomains[] = #define MAX_EMAIL_LEN 1024
#define MAX_FILEPATH 32768 //internal
-#define BUFF_SIZE_RCV 65535 //internal
-#define BUFF_SIZE_RCV_MIN_FREE 16384 //internal
+#define BUFF_SIZE_RCV (64 * 1024) //internal
+#define BUFF_SIZE_RCV_MIN_FREE (16 * 1024) //internal
#define BUFF_SIZE_BLOB 16384 //internal
#define BUFF_SIZE_URL 4096 //internal
#define NETLIB_SELECT_TIMEOUT 250 //internal // время ожидания событий на сокете
@@ -182,6 +182,8 @@ static const LPSTR lpcszMailRuDomains[] = #define MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY FALSE
#define MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX FALSE
+#define MRA_DEFAULT_SHOW_ALL_XSTATUSES FALSE /* Do not display some x statuses (like dating) in menu. */
+
#define MRA_AVT_DEFAULT_ENABLE TRUE
#define MRA_AVT_DEFAULT_WRK_THREAD_COUNTS 4 // hidden
#define MRA_AVT_DEFAULT_SERVER "obraz.foto.mail.ru"
@@ -229,20 +231,22 @@ static const LPSTR lpcszMailRuDomains[] = extern const LPSTR lpcszStatusUri[];
extern const LPWSTR lpcszXStatusNameDef[];
-#define MRA_XSTATUS_MENU "/menuXStatus"
-#define MRA_XSTATUS_COUNT 49
+#define MRA_XSTATUS_COUNT 50 /* index = 0 - virtual status "none" */
+#define MRA_XSTATUS_OFF_CLI_COUNT 49 /* MRA_XSTATUS_COUNT - dating */
#define MRA_MIR_XSTATUS_NONE 0
#define MRA_MIR_XSTATUS_UNKNOWN MRA_XSTATUS_COUNT
+/* Indexes in lpcszStatusUrip[]. */
#define MRA_XSTATUS_OFFLINE 0
#define MRA_XSTATUS_ONLINE 1
#define MRA_XSTATUS_AWAY 2
#define MRA_XSTATUS_INVISIBLE 3
#define MRA_XSTATUS_DND 4
#define MRA_XSTATUS_CHAT 5
-#define MRA_XSTATUS_MOBILE 54
-#define MRA_XSTATUS_UNKNOWN 100
+#define MRA_XSTATUS_MOBILE 6
+#define MRA_XSTATUS_UNKNOWN 255
+#define MRA_XSTATUS_UNKNOWN_STR "mra_xstatus50" // For icon name, keep sync with MRA_XSTATUS_COUNT
-#define MRA_XSTATUS_INDEX_OFFSET 6
+#define MRA_XSTATUS_INDEX_OFFSET 7
#endif // !defined(AFX_MRA_CONSTANS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp index 693ebadd3d..89f957f69d 100644 --- a/protocols/MRA/src/MraIcons.cpp +++ b/protocols/MRA/src/MraIcons.cpp @@ -36,11 +36,11 @@ IconItem gdiContactMenuItems[CONTACT_MENU_ITEMS_COUNT] = IconItem gdiExtraStatusIconsItems[ADV_ICON_MAX] =
{
- { ADV_ICON_DELETED_STR, ADV_ICON_DELETED_ID, IDI_DELETED },
- { ADV_ICON_NOT_ON_SERVER_STR, ADV_ICON_NOT_ON_SERVER_ID, IDI_AUTHGRANT },
- { ADV_ICON_NOT_AUTHORIZED_STR, ADV_ICON_NOT_AUTHORIZED_ID, IDI_AUTHRUGUEST },
- { ADV_ICON_PHONE_STR, ADV_ICON_PHONE_ID, IDI_MRA_PHONE },
- { ADV_ICON_BLOGSTATUS_STR, ADV_ICON_BLOGSTATUS_ID, IDI_BLOGSTATUS }
+ { ADV_ICON_DELETED_STR, ADV_ICON_DELETED_ID, IDI_DELETED },
+ { ADV_ICON_NOT_ON_SERVER_STR, ADV_ICON_NOT_ON_SERVER_ID, IDI_AUTHGRANT },
+ { ADV_ICON_NOT_AUTHORIZED_STR, ADV_ICON_NOT_AUTHORIZED_ID, IDI_AUTHRUGUEST },
+ { ADV_ICON_PHONE_STR, ADV_ICON_PHONE_ID, IDI_MRA_PHONE },
+ { ADV_ICON_BLOGSTATUS_STR, ADV_ICON_BLOGSTATUS_ID, IDI_BLOGSTATUS }
};
//////////////////////////////////////////////////////////////////////////////////////
@@ -108,7 +108,7 @@ void InitXStatusIcons() sid.flags = SIDF_ALL_TCHAR;
hXStatusAdvancedStatusIcons[0] = NULL;
- for (int i = 1; i < MRA_XSTATUS_COUNT+1; i++) {
+ for (DWORD i = 1; i < MRA_XSTATUS_COUNT+1; i++) {
char szBuff[MAX_PATH];
mir_snprintf(szBuff, SIZEOF(szBuff), "mra_xstatus%ld", i);
sid.pszName = szBuff;
@@ -125,10 +125,10 @@ void DestroyXStatusIcons() {
char szBuff[MAX_PATH];
- for (size_t i = 1; i < MRA_XSTATUS_COUNT+1; i++) {
+ for (DWORD i = 1; i < MRA_XSTATUS_COUNT+1; i++) {
mir_snprintf(szBuff, SIZEOF(szBuff), "mra_xstatus%ld", i);
Skin_RemoveIcon(szBuff);
}
- bzero(hXStatusAdvancedStatusIcons, sizeof(hXStatusAdvancedStatusIcons));
+ memset(hXStatusAdvancedStatusIcons, 0, sizeof(hXStatusAdvancedStatusIcons));
}
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index 54f9c5efe7..c7c36cb1ba 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -54,7 +54,7 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) : HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &CMraProto::MraRebuildStatusMenu);
hExtraXstatusIcon = ExtraIcon_Register("MRAXstatus", LPGEN("Mail.ru Xstatus"), "mra_xstatus25");
- hExtraInfo = ExtraIcon_Register("MRAStatus", LPGEN("Mail.ru extra info"), "mra_xstatus49");
+ hExtraInfo = ExtraIcon_Register("MRAStatus", LPGEN("Mail.ru extra info"), MRA_XSTATUS_UNKNOWN_STR);
bHideXStatusUI = FALSE;
m_iXStatus = getByte(DBSETTING_XSTATUSID, MRA_MIR_XSTATUS_NONE);
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp index 1171f147bd..d4fa5a7c16 100644 --- a/protocols/MRA/src/Mra_menus.cpp +++ b/protocols/MRA/src/Mra_menus.cpp @@ -290,9 +290,13 @@ int CMraProto::MraRebuildStatusMenu(WPARAM wParam, LPARAM lParam) mi.pszContactOwner = m_szModuleName;
CMStringW szStatusTitle;
- for (size_t i = 0; i < MRA_XSTATUS_COUNT; i++) {
+
+ DWORD dwCount = MRA_XSTATUS_OFF_CLI_COUNT;
+ if (getByte(NULL, "xStatusShowAll", MRA_DEFAULT_SHOW_ALL_XSTATUSES))
+ dwCount = MRA_XSTATUS_COUNT;
+ for (DWORD i = 0; i < dwCount; i ++) {
mir_snprintf(pszServiceFunctionName, 100, "/menuXStatus%ld", i);
- mi.position++;
+ mi.position ++;
if (i) {
mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldName", i);
if (mraGetStringW(NULL, szValueName, szStatusTitle))
@@ -386,7 +390,7 @@ void CMraProto::InitMenus() hContactMenuRoot = CListCreateMenu(-2000001001, -500050000, FALSE, gdiContactMenuItems, CONTACT_MENU_ITEMS_COUNT, hContactMenuItems);
// xstatus menu
- for (int i = 0; i < MRA_XSTATUS_COUNT; i++) {
+ for (DWORD i = 0; i < MRA_XSTATUS_COUNT; i++) {
char szServiceName[100];
mir_snprintf(szServiceName, SIZEOF(szServiceName), "/menuXStatus%d", i);
CreateProtoServiceParam(szServiceName, &CMraProto::MraXStatusMenu, i);
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 704bec82a9..76d576dd8d 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -217,133 +217,125 @@ DWORD CMraProto::MraNetworkDispatcher() m_dwThreadWorkerLastPingTime = GetTickCount();
while (m_iStatus != ID_STATUS_OFFLINE && bContinue) {
DWORD dwSelectRet = CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls);
- switch (dwSelectRet) {
- case SOCKET_ERROR:
+ if (SOCKET_ERROR == dwSelectRet) {
if (m_iStatus != ID_STATUS_OFFLINE) {
dwRetErrorCode = GetLastError();
ShowFormattedErrorMessage(L"Disconnected, socket error", dwRetErrorCode);
}
- bContinue = FALSE;
break;
-
- case 0:// Time out
- case 1:
- m_dwThreadWorkerLastPingTime = GetTickCount();
- // server ping
- if (m_dwNextPingSendTickTime <= m_dwThreadWorkerLastPingTime) {
- m_dwNextPingSendTickTime = (m_dwThreadWorkerLastPingTime + (m_dwPingPeriod * 1000));
- MraSendCMD(MRIM_CS_PING, NULL, 0);
- }
- {
- DWORD dwCMDNum, dwFlags, dwAckType;
- MCONTACT hContact;
- LPBYTE lpbData;
- size_t dwDataSize;
- while (!MraSendQueueFindOlderThan(hSendQueueHandle, SEND_QUEUE_TIMEOUT, &dwCMDNum, &dwFlags, &hContact, &dwAckType, &lpbData, &dwDataSize)) {
- switch (dwAckType) {
- case ACKTYPE_ADDED:
- case ACKTYPE_AUTHREQ:
- case ACKTYPE_CONTACTS:
- //nothing to do
- break;
- case ACKTYPE_MESSAGE:
- ProtoBroadcastAck(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)dwCMDNum, (LPARAM)"Undefined message deliver error, time out");
- break;
- case ACKTYPE_GETINFO:
- ProtoBroadcastAck(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)1, 0);
- break;
- case ACKTYPE_SEARCH:
- ProtoBroadcastAck(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)dwCMDNum, 0);
- break;
- case ICQACKTYPE_SMS:
- ProtoBroadcastAck(NULL, dwAckType, ACKRESULT_FAILED, (HANDLE)dwCMDNum, 0);
- mir_free(lpbData);
- break;
- }
- MraSendQueueFree(hSendQueueHandle, dwCMDNum);
+ }
+ // Time out or normal
+ m_dwThreadWorkerLastPingTime = GetTickCount();
+ /* Server ping. */
+ if (m_dwNextPingSendTickTime <= m_dwThreadWorkerLastPingTime) {
+ m_dwNextPingSendTickTime = (m_dwThreadWorkerLastPingTime + (m_dwPingPeriod * 1000));
+ MraSendCMD(MRIM_CS_PING, NULL, 0);
+ }
+ { /* Remove old items from send queue. */
+ DWORD dwCMDNum, dwFlags, dwAckType;
+ MCONTACT hContact;
+ LPBYTE lpbData;
+ size_t dwDataSize;
+ while (!MraSendQueueFindOlderThan(hSendQueueHandle, SEND_QUEUE_TIMEOUT, &dwCMDNum, &dwFlags, &hContact, &dwAckType, &lpbData, &dwDataSize)) {
+ switch (dwAckType) {
+ case ACKTYPE_ADDED:
+ case ACKTYPE_AUTHREQ:
+ case ACKTYPE_CONTACTS:
+ //nothing to do
+ break;
+ case ACKTYPE_MESSAGE:
+ ProtoBroadcastAck(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)dwCMDNum, (LPARAM)"Undefined message deliver error, time out");
+ break;
+ case ACKTYPE_GETINFO:
+ ProtoBroadcastAck(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)1, 0);
+ break;
+ case ACKTYPE_SEARCH:
+ ProtoBroadcastAck(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)dwCMDNum, 0);
+ break;
+ case ICQACKTYPE_SMS:
+ ProtoBroadcastAck(NULL, dwAckType, ACKRESULT_FAILED, (HANDLE)dwCMDNum, 0);
+ mir_free(lpbData);
+ break;
}
+ MraSendQueueFree(hSendQueueHandle, dwCMDNum);
}
+ }
- if (dwSelectRet == 0) // Time out
- break;
+ if (dwSelectRet == 0) // Time out
+ continue;
- // expand receive buffer dynamically
- if ((dwRcvBuffSize - dwRcvBuffSizeUsed) < BUFF_SIZE_RCV_MIN_FREE) {
- dwRcvBuffSize += BUFF_SIZE_RCV;
- lpbBufferRcv = (LPBYTE)mir_realloc(lpbBufferRcv, dwRcvBuffSize);
+ // expand receive buffer dynamically
+ if ((dwRcvBuffSize - dwRcvBuffSizeUsed) < BUFF_SIZE_RCV_MIN_FREE) {
+ dwRcvBuffSize += BUFF_SIZE_RCV;
+ lpbBufferRcv = (LPBYTE)mir_realloc(lpbBufferRcv, dwRcvBuffSize);
+ }
+
+ DWORD dwBytesReceived = Netlib_Recv(nls.hReadConns[0], (LPSTR)(lpbBufferRcv + dwRcvBuffSizeUsed), (dwRcvBuffSize - dwRcvBuffSizeUsed), 0);
+ if ( !dwBytesReceived && dwBytesReceived == SOCKET_ERROR) { // disconnected
+ if (m_iStatus != ID_STATUS_OFFLINE) {
+ dwRetErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Disconnected, socket read error", dwRetErrorCode);
}
+ break;
+ }
- DWORD dwBytesReceived = Netlib_Recv(nls.hReadConns[0], (LPSTR)(lpbBufferRcv + dwRcvBuffSizeUsed), (dwRcvBuffSize - dwRcvBuffSizeUsed), 0);
- if (dwBytesReceived && dwBytesReceived != SOCKET_ERROR) {
- dwRcvBuffSizeUsed += dwBytesReceived;
-
- while (TRUE) {
- dwDataCurrentBuffSize = (dwRcvBuffSize - dwDataCurrentBuffOffset);
- dwDataCurrentBuffSizeUsed = (dwRcvBuffSizeUsed - dwDataCurrentBuffOffset);
- pmaHeader = (mrim_packet_header_t*)(lpbBufferRcv + dwDataCurrentBuffOffset);
-
- // packet header received
- if (dwDataCurrentBuffSizeUsed >= sizeof(mrim_packet_header_t)) {
- // packet OK
- if (pmaHeader->magic == CS_MAGIC) {
- // full packet received, may be more than one
- if ((dwDataCurrentBuffSizeUsed - sizeof(mrim_packet_header_t)) >= pmaHeader->dlen) {
-
- bContinue = MraCommandDispatcher(pmaHeader);
-
- // move pointer to next packet in buffer
- if (dwDataCurrentBuffSizeUsed - sizeof(mrim_packet_header_t) > pmaHeader->dlen)
- dwDataCurrentBuffOffset += sizeof(mrim_packet_header_t)+pmaHeader->dlen;
- // move pointer to begin of buffer
- else {
- // динамическое уменьшение буффера приёма
- if (dwRcvBuffSize > BUFF_SIZE_RCV) {
- dwRcvBuffSize = BUFF_SIZE_RCV;
- lpbBufferRcv = (LPBYTE)mir_realloc(lpbBufferRcv, dwRcvBuffSize);
- }
- dwDataCurrentBuffOffset = 0;
- dwRcvBuffSizeUsed = 0;
- break;
- }
- }
- // not all packet received, continue receiving
- else {
- if (dwDataCurrentBuffOffset) {
- memmove(lpbBufferRcv, (lpbBufferRcv + dwDataCurrentBuffOffset), dwDataCurrentBuffSizeUsed);
- dwRcvBuffSizeUsed = dwDataCurrentBuffSizeUsed;
- dwDataCurrentBuffOffset = 0;
- }
- debugLogW(L"Not all packet received, continue receiving\n");
- break;
- }
- }
- // bad packet
+ dwRcvBuffSizeUsed += dwBytesReceived;
+ while (TRUE) {
+ dwDataCurrentBuffSize = (dwRcvBuffSize - dwDataCurrentBuffOffset);
+ dwDataCurrentBuffSizeUsed = (dwRcvBuffSizeUsed - dwDataCurrentBuffOffset);
+ pmaHeader = (mrim_packet_header_t*)(lpbBufferRcv + dwDataCurrentBuffOffset);
+
+ // packet header received
+ if (dwDataCurrentBuffSizeUsed >= sizeof(mrim_packet_header_t)) {
+ // packet OK
+ if (pmaHeader->magic == CS_MAGIC) {
+ // full packet received, may be more than one
+ if ((dwDataCurrentBuffSizeUsed - sizeof(mrim_packet_header_t)) >= pmaHeader->dlen) {
+
+ bContinue = MraCommandDispatcher(pmaHeader);
+
+ // move pointer to next packet in buffer
+ if (dwDataCurrentBuffSizeUsed - sizeof(mrim_packet_header_t) > pmaHeader->dlen)
+ dwDataCurrentBuffOffset += sizeof(mrim_packet_header_t)+pmaHeader->dlen;
+ // move pointer to begin of buffer
else {
- debugLogW(L"Bad packet\n");
+ // динамическое уменьшение буффера приёма
+ if (dwRcvBuffSize > BUFF_SIZE_RCV) {
+ dwRcvBuffSize = BUFF_SIZE_RCV;
+ lpbBufferRcv = (LPBYTE)mir_realloc(lpbBufferRcv, dwRcvBuffSize);
+ }
dwDataCurrentBuffOffset = 0;
dwRcvBuffSizeUsed = 0;
break;
}
}
- // packet to small, continue receiving
+ // not all packet received, continue receiving
else {
- debugLogW(L"Packet to small, continue receiving\n");
- memmove(lpbBufferRcv, (lpbBufferRcv + dwDataCurrentBuffOffset), dwDataCurrentBuffSizeUsed);
- dwRcvBuffSizeUsed = dwDataCurrentBuffSizeUsed;
- dwDataCurrentBuffOffset = 0;
+ if (dwDataCurrentBuffOffset) {
+ memmove(lpbBufferRcv, (lpbBufferRcv + dwDataCurrentBuffOffset), dwDataCurrentBuffSizeUsed);
+ dwRcvBuffSizeUsed = dwDataCurrentBuffSizeUsed;
+ dwDataCurrentBuffOffset = 0;
+ }
+ debugLogW(L"Not all packet received, continue receiving\n");
break;
}
}
+ // bad packet
+ else {
+ debugLogW(L"Bad packet\n");
+ dwDataCurrentBuffOffset = 0;
+ dwRcvBuffSizeUsed = 0;
+ break;
+ }
}
- // disconnected
+ // packet to small, continue receiving
else {
- if (m_iStatus != ID_STATUS_OFFLINE) {
- dwRetErrorCode = GetLastError();
- ShowFormattedErrorMessage(L"Disconnected, socket read error", dwRetErrorCode);
- }
- bContinue = FALSE;
+ debugLogW(L"Packet to small, continue receiving\n");
+ memmove(lpbBufferRcv, (lpbBufferRcv + dwDataCurrentBuffOffset), dwDataCurrentBuffSizeUsed);
+ dwRcvBuffSizeUsed = dwDataCurrentBuffSizeUsed;
+ dwDataCurrentBuffOffset = 0;
+ break;
}
- break;
}
}
mir_free(lpbBufferRcv);
@@ -783,14 +775,19 @@ bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf) case MRIM_ANKETA_INFO_STATUS_OK:
// поиск успешно завершен
DWORD dwFieldsNum, dwMaxRows, dwServerTime;
+ DWORD dwID, dwContactSeverFlags, dwStatus, dwXStatus;
buf >> dwFieldsNum >> dwMaxRows >> dwServerTime;
CMStringA *pmralpsFields = new CMStringA[dwFieldsNum];
CMStringA val;
- CMStringW valW;
+ CMStringW valW, StatusNameW, StatusMsgW;
+
+ /* Default contact statuses in mail.ru format. */
+ dwStatus = STATUS_OFFLINE;
+ dwXStatus = MRA_XSTATUS_OFFLINE;
// read headers name
- for (unsigned i = 0; i < dwFieldsNum; i++) {
+ for (DWORD i = 0; i < dwFieldsNum; i++) {
buf >> pmralpsFields[i];
debugLogA("%s ", pmralpsFields[i]);
}
@@ -800,7 +797,7 @@ bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf) if (dwAckType == ACKTYPE_GETINFO && hContact) {
setDword(hContact, "InfoTS", (DWORD)_time32(NULL));
//MRA_LPS mralpsUsernameValue;
- for (unsigned i = 0; i < dwFieldsNum; i++) {
+ for (DWORD i = 0; i < dwFieldsNum; i++) {
CMStringA &fld = pmralpsFields[i];
if (fld == "Nickname") {
buf >> valW;
@@ -900,49 +897,36 @@ bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf) }
else if (fld == "mrim_status") {
buf >> val;
- if (val.GetLength()) {
- DWORD dwID, dwContactSeverFlags;
- GetContactBasicInfoW(hContact, &dwID, NULL, NULL, &dwContactSeverFlags, NULL, NULL, NULL, NULL);
- // для авторизованного нам и так присылают правильный статус
- if (dwID == -1 || (dwContactSeverFlags & CONTACT_INTFLAG_NOT_AUTHORIZED)) {
- MraSetContactStatus(hContact, GetMirandaStatusFromMraStatus(atoi(val), MRA_MIR_XSTATUS_NONE, NULL));
- setByte(hContact, DBSETTING_XSTATUSID, (BYTE)MRA_MIR_XSTATUS_NONE);
- }
- }
+ if (val.GetLength())
+ dwStatus = atoi(val);
}
else if (fld == "status_uri") {
buf >> val;
- if (val.GetLength()) {
- DWORD dwID, dwContactSeverFlags, dwXStatus;
- GetContactBasicInfoW(hContact, &dwID, NULL, NULL, &dwContactSeverFlags, NULL, NULL, NULL, NULL);
- if (dwID == -1 || (dwContactSeverFlags & CONTACT_INTFLAG_NOT_AUTHORIZED)) {
- MraSetContactStatus(hContact, GetMirandaStatusFromMraStatus(atoi(val), GetMraXStatusIDFromMraUriStatus(val), &dwXStatus));
- setByte(hContact, DBSETTING_XSTATUSID, (BYTE)dwXStatus);
- }
- }
+ if (val.GetLength())
+ dwXStatus = GetMraXStatusIDFromMraUriStatus(val);
}
else if (fld == "status_title") {
- buf >> valW;
- if (valW.GetLength()) {
- DWORD dwID, dwContactSeverFlags;
- GetContactBasicInfoW(hContact, &dwID, NULL, NULL, &dwContactSeverFlags, NULL, NULL, NULL, NULL);
- if (dwID == -1 || (dwContactSeverFlags & CONTACT_INTFLAG_NOT_AUTHORIZED))
- mraSetStringW(hContact, DBSETTING_XSTATUSNAME, valW);
- }
+ buf >> StatusNameW;
}
else if (fld == "status_desc") {
- buf >> valW;
- if (valW.GetLength()) {
- DWORD dwID, dwContactSeverFlags;
- GetContactBasicInfoW(hContact, &dwID, NULL, NULL, &dwContactSeverFlags, NULL, NULL, NULL, NULL);
- if (dwID == -1 || dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
- mraSetStringW(hContact, DBSETTING_XSTATUSMSG, valW);
- }
+ buf >> StatusMsgW;
}
else {// for DEBUG ONLY
buf >> val;
debugLogA("%s = %s\n", fld, val);
}
+ } /* for */
+ // для авторизованного нам и так присылают правильный статус
+ GetContactBasicInfoW(hContact, &dwID, NULL, NULL, &dwContactSeverFlags, NULL, NULL, NULL, NULL);
+ if (dwID == -1 || (dwContactSeverFlags & CONTACT_INTFLAG_NOT_AUTHORIZED)) {
+ /* Convert mail.ru statuses to miranda. */
+ dwStatus = GetMirandaStatusFromMraStatus(dwStatus, dwXStatus, &dwXStatus);
+ MraSetContactStatus(hContact, dwStatus);
+ setByte(hContact, DBSETTING_XSTATUSID, (BYTE)dwXStatus);
+ if (StatusNameW.GetLength())
+ mraSetStringW(hContact, DBSETTING_XSTATUSNAME, StatusNameW);
+ if (StatusMsgW.GetLength())
+ mraSetStringW(hContact, DBSETTING_XSTATUSMSG, StatusMsgW);
}
}
else if (dwAckType == ACKTYPE_SEARCH) {
@@ -961,7 +945,7 @@ bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf) psr.email = szEmail;
psr.id = szEmail;
- for (unsigned i = 0; i < dwFieldsNum; i++) {
+ for (DWORD i = 0; i < dwFieldsNum; i++) {
CMStringA &fld = pmralpsFields[i];
if (fld == "Username") {
buf >> val;
@@ -1893,11 +1877,11 @@ DWORD GetMirandaStatusFromMraStatus(DWORD dwMraStatus, DWORD dwXStatusMra, DWORD }
if (pdwXStatusMir) *pdwXStatusMir = dwXStatusMra - MRA_XSTATUS_INDEX_OFFSET + 1;
return ID_STATUS_ONLINE;
+ default:
+ if (dwMraStatus & STATUS_FLAG_INVISIBLE)
+ return ID_STATUS_INVISIBLE;
}
- if (dwMraStatus & STATUS_FLAG_INVISIBLE)
- return ID_STATUS_INVISIBLE;
-
return ID_STATUS_OFFLINE;
}
diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index 73b1401a55..fdfeb52429 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -9,10 +9,11 @@ const LPSTR lpcszStatusUri[] = "STATUS_INVISIBLE", // "status_3",
"status_dnd",
"status_chat",
- "status_4",
+ "status_mobile",
+ "status_4", // first xstatus
"status_5",
"status_6",
- "status_7",
+ "status_7", // 10
"status_8",
"status_9",
"status_10",
@@ -22,7 +23,7 @@ const LPSTR lpcszStatusUri[] = "status_14",
"status_15",
"status_16",
- "status_17",
+ "status_17", // 20
"status_18",
"status_19",
"status_20",
@@ -33,7 +34,7 @@ const LPSTR lpcszStatusUri[] = //"status_25", // chat/dnd
"status_26",
"status_27",
- "status_28",
+ "status_28", // 30
"status_29",
"status_30",
//"status_31", // chat/dnd
@@ -44,7 +45,7 @@ const LPSTR lpcszStatusUri[] = "status_36",
"status_37",
"status_38",
- "status_39",
+ "status_39", // 40
"status_40",
"status_41",
"status_42",
@@ -54,12 +55,12 @@ const LPSTR lpcszStatusUri[] = "status_46",
"status_47",
"status_48",
- "status_49",
+ "status_49", // 50
"status_50",
"status_51",
"status_52",
"status_53",
- "status_mobile",
+ "status_dating",
NULL
};
@@ -114,6 +115,7 @@ const LPWSTR lpcszXStatusNameDef[] = LPGENT("Squirrel"),
LPGENT("Star"),
LPGENT("Music"),
+ LPGENT("Dating"),
NULL
};
@@ -435,7 +437,10 @@ INT_PTR CMraProto::MraSetXStatusEx(WPARAM wParam, LPARAM lParam) // hide menu items
if (pData->flags & CSSF_DISABLE_UI) {
bHideXStatusUI = (*pData->wParam) ? FALSE : TRUE;
- for (DWORD i = 0; i < MRA_XSTATUS_COUNT; i++)
+ DWORD dwCount = MRA_XSTATUS_OFF_CLI_COUNT;
+ if (getByte(NULL, "xStatusShowAll", MRA_DEFAULT_SHOW_ALL_XSTATUSES))
+ dwCount = MRA_XSTATUS_COUNT;
+ for (DWORD i = 0; i < dwCount; i++)
Menu_ShowItem(hXStatusMenuItems[i], !bHideXStatusUI);
}
}
@@ -507,6 +512,8 @@ INT_PTR CMraProto::MraGetXStatusIcon(WPARAM wParam, LPARAM lParam) {
if (wParam == 0)
wParam = m_iXStatus;
+ if ( !IsXStatusValid(wParam))
+ return 0;
return (INT_PTR)IconLibGetIconEx(hXStatusAdvancedStatusIcons[wParam], lParam);
}
diff --git a/protocols/MRA/src/proto.h b/protocols/MRA/src/proto.h index 9bcce264ef..c089cabe08 100644 --- a/protocols/MRA/src/proto.h +++ b/protocols/MRA/src/proto.h @@ -16,11 +16,11 @@ typedef struct mrim_packet_header_t u_long seq; // Sequence
u_long msg; // Тип пакета
u_long dlen; // Длина данных
- u_char reserved[24]; // Зарезервировано
+ u_char reserved[24]; // Зарезервировано
}
mrim_packet_header_t;
-#define CS_MAGIC 0xDEADBEEF // Клиентский Magic ( C <-> S )
+#define CS_MAGIC 0xDEADBEEF // Клиентский Magic ( C <-> S )
// UNICODE = (UTF-16LE) ( >= 1.17)
@@ -31,115 +31,113 @@ mrim_packet_header_t; ***************************************************************************/
-#define MRIM_CS_HELLO 0x1001 // C -> S
+#define MRIM_CS_HELLO 0x1001 // C->S
// empty
-#define MRIM_CS_HELLO_ACK 0x1002 // S -> C
+#define MRIM_CS_HELLO_ACK 0x1002 // S->C
// mrim_connection_params_t
-#define MRIM_CS_LOGIN_ACK 0x1004 // S -> C
+#define MRIM_CS_LOGIN_ACK 0x1004 // S->C
// empty
-#define MRIM_CS_LOGIN_REJ 0x1005 // S -> C
+#define MRIM_CS_LOGIN_REJ 0x1005 // S->C
// LPS reason ???
-#define MRIM_CS_PING 0x1006 // C -> S
+#define MRIM_CS_PING 0x1006 // C->S
// empty
-#define MRIM_CS_MESSAGE 0x1008 // C -> S
+#define MRIM_CS_MESSAGE 0x1008 // C->S
// UL flags
#define MESSAGE_FLAG_OFFLINE 0x00000001
- #define MESSAGE_FLAG_NORECV 0x00000004
- #define MESSAGE_FLAG_AUTHORIZE 0x00000008 // X-MRIM-Flags: 00000008
- #define MESSAGE_FLAG_SYSTEM 0x00000040
- #define MESSAGE_FLAG_RTF 0x00000080
+ #define MESSAGE_FLAG_NORECV 0x00000004
+ #define MESSAGE_FLAG_AUTHORIZE 0x00000008 // X-MRIM-Flags: 00000008
+ #define MESSAGE_FLAG_SYSTEM 0x00000040
+ #define MESSAGE_FLAG_RTF 0x00000080
#define MESSAGE_FLAG_CONTACT 0x00000200
- #define MESSAGE_FLAG_NOTIFY 0x00000400
- #define MESSAGE_FLAG_SMS 0x00000800
+ #define MESSAGE_FLAG_NOTIFY 0x00000400
+ #define MESSAGE_FLAG_SMS 0x00000800
#define MESSAGE_FLAG_MULTICAST 0x00001000
#define MESSAGE_SMS_DELIVERY_REPORT 0x00002000
- #define MESSAGE_FLAG_ALARM 0x00004000
- #define MESSAGE_FLAG_FLASH 0x00008000
- #define MESSAGE_FLAG_SPAMF_SPAM 0x00020000 // report spam back to the server
- #define MESSAGE_FLAG_MULTICHAT 0x00400000 //
- #define MULTICHAT_MESSAGE 0 // received message (s->c)
+ #define MESSAGE_FLAG_ALARM 0x00004000
+ #define MESSAGE_FLAG_FLASH 0x00008000
+ #define MESSAGE_FLAG_SPAMF_SPAM 0x00020000 // report spam back to the server
+ #define MESSAGE_FLAG_MULTICHAT 0x00400000 //
+ #define MULTICHAT_MESSAGE 0 // received message (s->c)
#define MULTICHAT_GET_MEMBERS 1 // request members list from server (c->s)
- #define MULTICHAT_MEMBERS 2 // members list from server (s->c)
+ #define MULTICHAT_MEMBERS 2 // members list from server (s->c)
#define MULTICHAT_ADD_MEMBERS 3 //
- #define MULTICHAT_ATTACHED 4 // user joined to chat (s->c)
- #define MULTICHAT_DETACHED 5 // user leave chat (s->c)
- #define MULTICHAT_DESTROYED 6 //
- #define MULTICHAT_INVITE 7 //
- #define MESSAGE_FLAG_v1p16 0x00100000 // для перекодировки юникода
- #define MESSAGE_FLAG_CP1251 0x00200000
+ #define MULTICHAT_ATTACHED 4 // user joined to chat (s->c)
+ #define MULTICHAT_DETACHED 5 // user leave chat (s->c)
+ #define MULTICHAT_DESTROYED 6 //
+ #define MULTICHAT_INVITE 7 //
+ #define MESSAGE_FLAG_v1p16 0x00100000 // для перекодировки юникода
+ #define MESSAGE_FLAG_CP1251 0x00200000
// LPS to e-mail ANSI
// LPS message ANSI/UNICODE (see flags)
// LPS rtf-formatted message ( >= 1.1) ???
// LPS multichat_data ( >= 1.20) ???
#define MAX_MULTICAST_RECIPIENTS 50
- #define MESSAGE_USERFLAGS_MASK 0x000036A8 // Flags that user is allowed to set himself
+ #define MESSAGE_USERFLAGS_MASK 0x000036A8 // Flags that user is allowed to set himself
-#define MRIM_CS_MESSAGE_ACK 0x1009 // S -> C
+#define MRIM_CS_MESSAGE_ACK 0x1009 // S->C
// UL msg_id
// UL flags
// LPS from e-mail ANSI
// LPS message UNICODE
// LPS rtf-formatted message ( >= 1.1) - MESSAGE_FLAG_RTF
-// //BASE64( - MESSAGE_FLAG_AUTHORIZE
-// UL parts count = 2
-// LPS auth_sender_nick UNICODE
-// LPS auth_request_text UNICODE
-//[ LPS multichat_data ] ( >= 1.20) - MESSAGE_FLAG_MULTICHAT
-// UL type
-// LPS multichat_name
-// switch (type) {
-// MULTICHAT_MESSAGE {
-// LPS sender ANSI
-// }
-// MULTICHAT_MEMBERS {
-// CLPS members
-// [ LPS owner ]
-// }
-// MULTICHAT_ADD_MEMBERS {
-// LPS sender ANSI
-// CLPS members
-// }
-// MULTICHAT_ATTACHED {
-// LPS member ANSI
-// }
-// MULTICHAT_DETACHED {
-// LPS member ANSI
-// }
-// MULTICHAT_INVITE {
-// LPS sender ANSI
-// }
-// }
+// BASE64( - MESSAGE_FLAG_AUTHORIZE
+// UL parts count = 2
+// LPS auth_sender_nick UNICODE
+// LPS auth_request_text UNICODE
+//[ LPS multichat_data ] ( >= 1.20) - MESSAGE_FLAG_MULTICHAT
+// UL type
+// LPS multichat_name
+// switch (type) {
+// MULTICHAT_MESSAGE {
+// LPS sender ANSI
+// }
+// MULTICHAT_MEMBERS {
+// CLPS members
+// [ LPS owner ]
+// }
+// MULTICHAT_ADD_MEMBERS {
+// LPS sender ANSI
+// CLPS members
+// }
+// MULTICHAT_ATTACHED {
+// LPS member ANSI
+// }
+// MULTICHAT_DETACHED {
+// LPS member ANSI
+// }
+// MULTICHAT_INVITE {
+// LPS sender ANSI
+// }
+// }
// )
-#define MRIM_CS_MESSAGE_RECV 0x1011 // C -> S
+#define MRIM_CS_MESSAGE_RECV 0x1011 // C->S
// LPS from e-mail ANSI
// UL msg_id
-#define MRIM_CS_MESSAGE_STATUS 0x1012 // S -> C
+#define MRIM_CS_MESSAGE_STATUS 0x1012 // S->C
// UL status
- #define MESSAGE_DELIVERED 0x0000 // Message delivered directly to user
- #define MESSAGE_REJECTED_NOUSER 0x8001 // Message rejected - no such user
- #define MESSAGE_REJECTED_INTERR 0x8003 // Internal server error
+ #define MESSAGE_DELIVERED 0x0000 // Message delivered directly to user
+ #define MESSAGE_REJECTED_NOUSER 0x8001 // Message rejected - no such user
+ #define MESSAGE_REJECTED_INTERR 0x8003 // Internal server error
#define MESSAGE_REJECTED_LIMIT_EXCEEDED 0x8004 // Offline messages limit exceeded
- #define MESSAGE_REJECTED_TOO_LARGE 0x8005 // Message is too large
+ #define MESSAGE_REJECTED_TOO_LARGE 0x8005 // Message is too large
#define MESSAGE_REJECTED_DENY_OFFMSG 0x8006 // User does not accept offline messages
#define MESSAGE_REJECTED_DENY_OFFFLSH 0x8007 // User does not accept offline flash animation
- //#define MESSAGE_REJECTED_DENY_OFFFLSH 0x8008 // User does not accept offline flash animation
- //#define MESSAGE_REJECTED_DENY_OFFFLSH 0x8009 // User does not accept offline flash animation
-#define MRIM_CS_USER_STATUS 0x100F // S -> C
+#define MRIM_CS_USER_STATUS 0x100F // S->C
// UL status
#define STATUS_OFFLINE 0x00000000
#define STATUS_ONLINE 0x00000001
@@ -184,14 +182,14 @@ mrim_packet_header_t; // "protocol" - MMP protocol number by format "<major>.<minor>".
-#define MRIM_CS_LOGOUT 0x1013 // S -> C
+#define MRIM_CS_LOGOUT 0x1013 // S->C
// UL reason
- #define LOGOUT_NO_RELOGIN_FLAG 0x0010 // Logout due to double login
+ #define LOGOUT_NO_RELOGIN_FLAG 0x0010 // Logout due to double login
-#define MRIM_CS_CONNECTION_PARAMS 0x1014 // S -> C (>1.16 depricated ?)
+#define MRIM_CS_CONNECTION_PARAMS 0x1014 // S->C (>1.16 depricated ?)
// mrim_connection_params_t
-#define MRIM_CS_USER_INFO 0x1015 // S -> C
+#define MRIM_CS_USER_INFO 0x1015 // S->C
// (LPS key, LPS value)* X ???
// MESSAGES.TOTAL - num UNICODE
// MESSAGES.UNREAD - num UNICODE
@@ -199,53 +197,53 @@ mrim_packet_header_t; // client.endpoint - ip:port UNICODE
-#define MRIM_CS_ADD_CONTACT 0x1019 // C -> S
+#define MRIM_CS_ADD_CONTACT 0x1019 // C->S
// UL flags (group(2) or usual(0)
#define CONTACT_FLAG_REMOVED 0x00000001
- #define CONTACT_FLAG_GROUP 0x00000002
+ #define CONTACT_FLAG_GROUP 0x00000002
#define CONTACT_FLAG_INVISIBLE 0x00000004
#define CONTACT_FLAG_VISIBLE 0x00000008
- #define CONTACT_FLAG_IGNORE 0x00000010
- #define CONTACT_FLAG_SHADOW 0x00000020
+ #define CONTACT_FLAG_IGNORE 0x00000010
+ #define CONTACT_FLAG_SHADOW 0x00000020
#define CONTACT_FLAG_AUTHORIZED 0x00000040 // ( >= 1.15)
- #define CONTACT_FLAG_MULTICHAT 0x00000080 // ( >= 1.20) = 128
- #define CONTACT_FLAG_UNICODE_NAME 0x00000200 // = 512
- #define CONTACT_FLAG_PHONE 0x00100000
+ #define CONTACT_FLAG_MULTICHAT 0x00000080 // ( >= 1.20) = 128
+ #define CONTACT_FLAG_UNICODE_NAME 0x00000200 // = 512
+ #define CONTACT_FLAG_PHONE 0x00100000
// UL group id (unused if contact is group)
// LPS contact e-mail ANSI
// LPS name UNICODE
// LPS custom phones ANSI
// LPS BASE64(
-// UL parts count = 2
-// LPS auth_sender_nick ???
-// LPS auth_request_text ???
+// UL parts count = 2
+// LPS auth_sender_nick ???
+// LPS auth_request_text ???
// )
// UL actions ( >= 1.15)
// [LPS multichat_data]
// CLPS members ( >= 1.20)
// [ LPS owner ]
#define ADD_CONTACT_FLAG_MYMAIL_INVITE 0x00000001
- #define ADD_CONTACT_FLAG_MULTICHAT_ATTACHE 0x00000002
+ #define ADD_CONTACT_FLAG_MULTICHAT_ATTACHE 0x00000002
//used internal in win32 agent
#define CONTACT_AWAITING_AUTHORIZATION_USER 0x00000100
- #define CONTACT_FLAG_TEMPORARY 0x00010000
+ #define CONTACT_FLAG_TEMPORARY 0x00010000
-#define MRIM_CS_ADD_CONTACT_ACK 0x101A // S -> C
+#define MRIM_CS_ADD_CONTACT_ACK 0x101A // S->C
// UL status
#define CONTACT_OPER_SUCCESS 0x0000
- #define CONTACT_OPER_ERROR 0x0001
- #define CONTACT_OPER_INTERR 0x0002
+ #define CONTACT_OPER_ERROR 0x0001
+ #define CONTACT_OPER_INTERR 0x0002
#define CONTACT_OPER_NO_SUCH_USER 0x0003
#define CONTACT_OPER_INVALID_INFO 0x0004
#define CONTACT_OPER_USER_EXISTS 0x0005
- #define CONTACT_OPER_GROUP_LIMIT 0x6
+ #define CONTACT_OPER_GROUP_LIMIT 0x0006
// UL contact_id or (u_long)-1 if status is not OK
// [LPS multichat_contact ( >= 1.20)]
-#define MRIM_CS_MODIFY_CONTACT 0x101B // C -> S
+#define MRIM_CS_MODIFY_CONTACT 0x101B // C->S
// UL id
// UL flags - same as for MRIM_CS_ADD_CONTACT
// UL group id (unused if contact is group)
@@ -253,24 +251,24 @@ mrim_packet_header_t; // LPS name UNICODE
// LPS custom phones ANSI
-#define MRIM_CS_MODIFY_CONTACT_ACK 0x101C // S -> C
+#define MRIM_CS_MODIFY_CONTACT_ACK 0x101C // S->C
// UL status, same as for MRIM_CS_ADD_CONTACT_ACK
-#define MRIM_CS_OFFLINE_MESSAGE_ACK 0x101D // S -> C
+#define MRIM_CS_OFFLINE_MESSAGE_ACK 0x101D // S->C
// UIDL
// LPS offline message ???
-#define MRIM_CS_DELETE_OFFLINE_MESSAGE 0x101E // C -> S
+#define MRIM_CS_DELETE_OFFLINE_MESSAGE 0x101E // C->S
// UIDL
-#define MRIM_CS_AUTHORIZE 0x1020 // C -> S
+#define MRIM_CS_AUTHORIZE 0x1020 // C->S
// LPS user e-mail ANSI
-#define MRIM_CS_AUTHORIZE_ACK 0x1021 // S -> C
+#define MRIM_CS_AUTHORIZE_ACK 0x1021 // S->C
// LPS user e-mail ANSI
-#define MRIM_CS_CHANGE_STATUS 0x1022 // C -> S
+#define MRIM_CS_CHANGE_STATUS 0x1022 // C->S
// UL new status
// LPS spec_status_uri ANSI ( >= 1.14)
// LPS status_title UNICODE ( >= 1.14)
@@ -278,17 +276,17 @@ mrim_packet_header_t; // UL com_support ( >= 1.14) (see MRIM_CS_USER_STATUS)
-#define MRIM_CS_GET_MPOP_SESSION 0x1024 // C -> S
+#define MRIM_CS_GET_MPOP_SESSION 0x1024 // C->S
-#define MRIM_CS_MPOP_SESSION 0x1025 // S -> C
+#define MRIM_CS_MPOP_SESSION 0x1025 // S->C
// UL status
#define MRIM_GET_SESSION_FAIL 0
#define MRIM_GET_SESSION_SUCCESS 1
// LPS mpop session ???
-#define MRIM_CS_FILE_TRANSFER 0x1026 // C->S
+#define MRIM_CS_FILE_TRANSFER 0x1026 // C->S
// LPS TO/FROM e-mail ANSI
// DWORD id_request - uniq per connect
// DWORD FILESIZE
@@ -298,7 +296,7 @@ mrim_packet_header_t; // Files (FileName;FileSize;FileName;FileSize;) UNICODE
// LPS Conn (IP:Port;IP:Port;) ANSI
-#define MRIM_CS_FILE_TRANSFER_ACK 0x1027 // S->C
+#define MRIM_CS_FILE_TRANSFER_ACK 0x1027 // S->C
// DWORD status
#define FILE_TRANSFER_STATUS_OK 1
#define FILE_TRANSFER_STATUS_DECLINE 0
@@ -312,51 +310,51 @@ mrim_packet_header_t; //white pages!
-#define MRIM_CS_WP_REQUEST 0x1029 //C->S
+#define MRIM_CS_WP_REQUEST 0x1029 // C->S
// DWORD field
// LPS value ???
-#define PARAMS_NUMBER_LIMIT 50
+#define PARAMS_NUMBER_LIMIT 50
#define PARAM_VALUE_LENGTH_LIMIT 64
//if last symbol in value eq '*' it will be replaced by LIKE '%'
// params define
// must be in consecutive order (0..N) to quick check in check_anketa_info_request
enum {
- MRIM_CS_WP_REQUEST_PARAM_USER = 0, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_USER = 0, // ANSI
MRIM_CS_WP_REQUEST_PARAM_DOMAIN, // ANSI
MRIM_CS_WP_REQUEST_PARAM_NICKNAME, // UNICODE
MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME, // UNICODE
MRIM_CS_WP_REQUEST_PARAM_LASTNAME, // UNICODE
- MRIM_CS_WP_REQUEST_PARAM_SEX , // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_SEX, // ANSI
MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY, // not used for search
- MRIM_CS_WP_REQUEST_PARAM_DATE1 , // ANSI
- MRIM_CS_WP_REQUEST_PARAM_DATE2 , // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_DATE1, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_DATE2, // ANSI
//!!!!!!!!!!!!!!!!!!!online request param must be at end of request!!!!!!!!!!!!!!!
- MRIM_CS_WP_REQUEST_PARAM_ONLINE , // ANSI
- MRIM_CS_WP_REQUEST_PARAM_STATUS , // we do not used it, yet
+ MRIM_CS_WP_REQUEST_PARAM_ONLINE, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_STATUS, // we do not used it, yet
MRIM_CS_WP_REQUEST_PARAM_CITY_ID, // ANSI
MRIM_CS_WP_REQUEST_PARAM_ZODIAC, // ANSI
- MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH, // ANSI
- MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY, // ANSI
- MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID, // ANSI
MRIM_CS_WP_REQUEST_PARAM_MAX
};
-#define MRIM_CS_ANKETA_INFO 0x1028 //S->C
+#define MRIM_CS_ANKETA_INFO 0x1028 // S->C
// DWORD status
- #define MRIM_ANKETA_INFO_STATUS_OK 1
+ #define MRIM_ANKETA_INFO_STATUS_OK 1
#define MRIM_ANKETA_INFO_STATUS_NOUSER 0
#define MRIM_ANKETA_INFO_STATUS_DBERR 2
#define MRIM_ANKETA_INFO_STATUS_RATELIMERR 3
// DWORD fields_num
// DWORD max_rows
// DWORD server_time sec since 1970 (unixtime)
- // fields set //%fields_num == 0
- // values set //%fields_num == 0
+ // fields set //%fields_num == 0
+ // values set //%fields_num == 0
// LPS value (numbers too) ???
-#define MRIM_CS_MAILBOX_STATUS 0x1033
+#define MRIM_CS_MAILBOX_STATUS 0x1033
// DWORD new messages in mailbox
@@ -387,7 +385,7 @@ mrim_packet_header_t; -#define MRIM_CS_CONTACT_LIST2 0x1037 //S->C
+#define MRIM_CS_CONTACT_LIST2 0x1037 // S->C
// UL status
#define GET_CONTACTS_OK 0x0000
#define GET_CONTACTS_ERROR 0x0001
@@ -409,7 +407,7 @@ mrim_packet_header_t; //old packet cs_login with cs_statistic
-#define MRIM_CS_LOGIN2 0x1038 // C -> S
+#define MRIM_CS_LOGIN2 0x1038 // C->S
// LPS login e-mail ANSI
// LPS password ANSI
// DWORD status
@@ -498,17 +496,17 @@ mrim_packet_header_t; */
-#define MRIM_CS_SMS 0x1039 // C -> S
+#define MRIM_CS_SMS 0x1039 // C->S
// UL flags
// LPS to Phone ???
// LPS message ???
-#define MRIM_CS_SMS_ACK 0x1040 // S->C
+#define MRIM_CS_SMS_ACK 0x1040 // S->C
// UL status
-#define MRIM_CS_PROXY 0x1044
+#define MRIM_CS_PROXY 0x1044
// LPS to e-mail ANSI
// DWORD id_request
// DWORD data_type
@@ -519,15 +517,15 @@ mrim_packet_header_t; // LPS lps_ip_port ???
// DWORD session_id[4]
-#define MRIM_CS_PROXY_ACK 0x1045
+#define MRIM_CS_PROXY_ACK 0x1045
//DWORD status
- #define PROXY_STATUS_OK 1
- #define PROXY_STATUS_DECLINE 0
- #define PROXY_STATUS_ERROR 2
+ #define PROXY_STATUS_OK 1
+ #define PROXY_STATUS_DECLINE 0
+ #define PROXY_STATUS_ERROR 2
#define PROXY_STATUS_INCOMPATIBLE_VERS 3
- #define PROXY_STATUS_NOHARDWARE 4
- #define PROXY_STATUS_MIRROR 5
- #define PROXY_STATUS_CLOSED 6
+ #define PROXY_STATUS_NOHARDWARE 4
+ #define PROXY_STATUS_MIRROR 5
+ #define PROXY_STATUS_CLOSED 6
// LPS to e-mail ANSI
// DWORD id_request
// DWORD data_type
@@ -535,14 +533,14 @@ mrim_packet_header_t; // LPS: lps_ip_port ???
// DWORD[4] Session_id
-#define MRIM_CS_PROXY_HELLO 0x1046
+#define MRIM_CS_PROXY_HELLO 0x1046
// DWORD[4] Session_id
#define MRIM_CS_PROXY_HELLO_ACK 0x1047
-#define MRIM_CS_NEW_MAIL 0x1048 // S->C
+#define MRIM_CS_NEW_MAIL 0x1048 // S->C
// UL unread count
// LPS from e-mail ANSI
// LPS subject ???
@@ -574,26 +572,26 @@ mrim_packet_header_t; // }
-#define MRIM_CS_UNKNOWN 0x1073
+#define MRIM_CS_UNKNOWN 0x1073
// DWORD ???
// DWORD ???
-#define MRIM_CS_USER_GEO 0x1077
+#define MRIM_CS_USER_GEO 0x1077
// LPS user
// LPS: // DWORD flags?
- // LPS: "geo-point":
- // LPS dolgota
- // LPS shirota
- // LPS "MAPOBJECT"
- // LPS some data?
- // LPS/DWORD
- // LPS/DWORD
- // LPS some data?
- // LPS some data?
-
-
-#define MRIM_CS_SERVER_SETTINGS 0x1079
+// LPS: "geo-point":
+ // LPS dolgota
+ // LPS shirota
+ // LPS "MAPOBJECT"
+ // LPS some data?
+ // LPS/DWORD
+ // LPS/DWORD
+ // LPS some data?
+ // LPS some data?
+
+
+#define MRIM_CS_SERVER_SETTINGS 0x1079
diff --git a/protocols/MRA/xstatus_MRA/res/xstatus_MRA.rc b/protocols/MRA/xstatus_MRA/res/xstatus_MRA.rc index bff87382ba..f7bdc005dc 100644 --- a/protocols/MRA/xstatus_MRA/res/xstatus_MRA.rc +++ b/protocols/MRA/xstatus_MRA/res/xstatus_MRA.rc @@ -76,6 +76,7 @@ IDI_XSTATUS45 ICON "50.ico" IDI_XSTATUS46 ICON "51.ico"
IDI_XSTATUS47 ICON "52.ico"
IDI_XSTATUS48 ICON "53.ico"
+IDI_XSTATUS49 ICON "54.ico"
IDI_XSTATUS_UNKNOWN ICON "unknown.ico"
/////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/MRA/xstatus_MRA/src/resource.h b/protocols/MRA/xstatus_MRA/src/resource.h index efe5d6f369..9b8624eac7 100644 --- a/protocols/MRA/xstatus_MRA/src/resource.h +++ b/protocols/MRA/xstatus_MRA/src/resource.h @@ -51,7 +51,8 @@ #define IDI_XSTATUS46 246
#define IDI_XSTATUS47 247
#define IDI_XSTATUS48 248
-#define IDI_XSTATUS_UNKNOWN 249
+#define IDI_XSTATUS49 249
+#define IDI_XSTATUS_UNKNOWN 250
// Next default values for new objects
|