diff options
author | Piotr Piastucki <leech.miranda@gmail.com> | 2015-05-17 09:45:39 +0000 |
---|---|---|
committer | Piotr Piastucki <leech.miranda@gmail.com> | 2015-05-17 09:45:39 +0000 |
commit | f4ee10f5adbfd29adbc90bb2df96a7fc279ef60e (patch) | |
tree | 2e7ca89e7e6930f3e2d5f452308cfeeb18700c7e /protocols/MSN | |
parent | 0124b5cb073dfc46c086ef9fbcdc77d593a40e4b (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')
-rw-r--r-- | protocols/MSN/src/msn_commands.cpp | 20 | ||||
-rw-r--r-- | protocols/MSN/src/msn_lists.cpp | 3 | ||||
-rw-r--r-- | protocols/MSN/src/msn_opts.cpp | 4 |
3 files changed, 23 insertions, 4 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;
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp index bc6e1aefa5..0e629a0006 100644 --- a/protocols/MSN/src/msn_lists.cpp +++ b/protocols/MSN/src/msn_lists.cpp @@ -326,7 +326,8 @@ void CMsnProto::MSN_CreateContList(void) msnNsThread->sendPacketPayload("PUT", "MSGR\\CONTACTS", "%s", cxml);
if (msnP24Ver > 1)
- msnNsThread->sendPacketPayload("PUT", "MSGR\\SUBSCRIPTIONS", "<subscribe><presence><buddies><all /></buddies></presence><messaging><im /><conversations /></messaging><notifications><partners><partner>ABCH</partner></partners></notifications></subscribe>");
+ msnNsThread->sendPacketPayload("PUT", "MSGR\\SUBSCRIPTIONS", "<subscribe><presence><buddies><all /></buddies></presence><messaging><im /><conversations /></messaging><notifications><partners>%s<partner>ABCH</partner></partners></notifications></subscribe>",
+ GetMyNetID()==NETID_MSN?"<partner>Hotmail</partner>":"");
mir_free(used);
}
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp index 47d9b38b1c..7f814dad6c 100644 --- a/protocols/MSN/src/msn_opts.cpp +++ b/protocols/MSN/src/msn_opts.cpp @@ -662,15 +662,17 @@ INT_PTR CMsnProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam) void CMsnProto::LoadOptions(void)
{
+ int bNoWlid;
memset(&MyOptions, 0, sizeof(MyOptions));
//Popup Options
MyOptions.ManageServer = getByte("ManageServer", TRUE) != 0;
MyOptions.ShowErrorsAsPopups = getByte("ShowErrorsAsPopups", TRUE) != 0;
MyOptions.SlowSend = getByte("SlowSend", FALSE) != 0;
- if (db_get_static(NULL, m_szModuleName, "wlid", MyOptions.szEmail, sizeof(MyOptions.szEmail)) &&
+ if ((bNoWlid=db_get_static(NULL, m_szModuleName, "wlid", MyOptions.szEmail, sizeof(MyOptions.szEmail))) &&
db_get_static(NULL, m_szModuleName, "e-mail", MyOptions.szEmail, sizeof(MyOptions.szEmail)))
MyOptions.szEmail[0] = 0;
+ else if (bNoWlid) setString("wlid", MyOptions.szEmail);
_strlwr(MyOptions.szEmail);
if (db_get_static(NULL, m_szModuleName, "MachineGuid", MyOptions.szMachineGuid, sizeof(MyOptions.szMachineGuid))) {
|