summaryrefslogtreecommitdiff
path: root/protocols/MSN/src/msn_commands.cpp
diff options
context:
space:
mode:
authorPiotr Piastucki <leech.miranda@gmail.com>2015-05-17 09:45:39 +0000
committerPiotr Piastucki <leech.miranda@gmail.com>2015-05-17 09:45:39 +0000
commitf4ee10f5adbfd29adbc90bb2df96a7fc279ef60e (patch)
tree2e7ca89e7e6930f3e2d5f452308cfeeb18700c7e /protocols/MSN/src/msn_commands.cpp
parent0124b5cb073dfc46c086ef9fbcdc77d593a40e4b (diff)
Tried to implement Hotmail inbox-notifications, unsure if they do work as expected though.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13661 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN/src/msn_commands.cpp')
-rw-r--r--protocols/MSN/src/msn_commands.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp
index ddfac66fb9..c325a7617c 100644
--- a/protocols/MSN/src/msn_commands.cpp
+++ b/protocols/MSN/src/msn_commands.cpp
@@ -327,6 +327,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
TCHAR *mChatID = NULL;
bool ubmMsg = strncmp(cmdString, "UBM", 3) == 0;
bool sdgMsg = strncmp(cmdString, "SDG", 3) == 0;
+ bool nfyMsg = strncmp(cmdString, "NFY", 3) == 0;
bool sentMsg = false;
if (sdgMsg) {
@@ -334,6 +335,11 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
if (stricmp(datas.typeId, "MSGR"))
return;
}
+ else if (nfyMsg) {
+ msgBytes = atol(datas.strMsgBytes);
+ if (stricmp(datas.typeId, "MSGR\\HOTMAIL"))
+ return;
+ }
else {
if (ubmMsg) {
msgBytes = atol(datau.strMsgBytes);
@@ -386,6 +392,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
HtmlDecode(msgBody);
}
}
+ else if (nfyMsg) msgBody = tHeader.readFromBuffer(msgBody);
else mChatID = info->mChatID;
const char* tMsgId = tHeader["Message-ID"];
@@ -406,13 +413,15 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
}
// message from the server (probably)
- if (!ubmMsg && !sdgMsg && strchr(email, '@') == NULL && _stricmp(email, "Hotmail"))
+ if (!ubmMsg && !sdgMsg && !nfyMsg && strchr(email, '@') == NULL && _stricmp(email, "Hotmail"))
return;
const char* tContentType = tHeader["Content-Type"];
if (tContentType == NULL)
return;
+ if (nfyMsg) msgBody = tHeader.readFromBuffer(msgBody);
+
if (!_strnicmp(tContentType, "text/x-clientcaps", 17)) {
MimeHeaders tFileInfo;
tFileInfo.readFromBuffer(msgBody);
@@ -425,7 +434,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
delSetting(hContact, "StdMirVer");
}
}
- else if (!ubmMsg && !sdgMsg && !info->firstMsgRecv) {
+ else if (!ubmMsg && !sdgMsg && !nfyMsg && !info->firstMsgRecv) {
info->firstMsgRecv = true;
MsnContact *cont = Lists_Get(email);
if (cont && cont->hContact != NULL)
@@ -1196,6 +1205,7 @@ LBL_InvalidCommand:
{
msnLoggedIn = true;
isConnectSuccess = true;
+ emailEnabled = GetMyNetID()==NETID_MSN; // Let's assume it?
MSN_SetServerStatus(m_iStatus);
MSN_EnableMenuItems(true);
// Fork refreshing and populating contact list to the background
@@ -1792,6 +1802,12 @@ LBL_InvalidCommand:
HReadBuffer buf(info, 0);
char* msgBody = (char*)buf.surelyRead(atol(data.strMsgBytes));
if (msgBody == NULL) break;
+ if (!strcmp(data.typeId, "MSGR\\HOTMAIL")) {
+ char szParam[128];
+ mir_snprintf(szParam, sizeof(szParam), "%s %s", data.typeId, data.strMsgBytes);
+ MSN_ReceiveMessage(info, cmdString, szParam);
+ break;
+ }
if (!strcmp(data.typeId, "MSGR\\PUT") || !strcmp(data.typeId, "MSGR\\DEL")) {
MimeHeaders tHeader;