summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-03 19:17:51 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-03 19:17:51 +0000
commit4c1143795a4e0ab188e23f89ee456408fdb6da24 (patch)
treec86c49ab0bceb32a67336805a37dfd1470e8fa02
parent31ad5a2b294f59b5a64a8e7d8383669baeb7fdd0 (diff)
sync
git-svn-id: http://svn.miranda-ng.org/main/trunk@286 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/IcqOscarJ/icq_menu.cpp2
-rw-r--r--protocols/IcqOscarJ/icq_proto.h2
-rw-r--r--protocols/IcqOscarJ/icq_servlist.cpp22
-rw-r--r--protocols/MSN/msn_global.h2
-rw-r--r--protocols/MSN/msn_http.cpp18
-rw-r--r--protocols/MSN/msn_threads.cpp13
6 files changed, 21 insertions, 38 deletions
diff --git a/protocols/IcqOscarJ/icq_menu.cpp b/protocols/IcqOscarJ/icq_menu.cpp
index 46da48ad1a..7b62c370f7 100644
--- a/protocols/IcqOscarJ/icq_menu.cpp
+++ b/protocols/IcqOscarJ/icq_menu.cpp
@@ -240,7 +240,7 @@ int CIcqProto::OnPreBuildContactMenu(WPARAM wParam, LPARAM)
!DBGetContactSettingByte(hContact, "CList", "NotOnList", 0));
}
- sttEnableMenuItem(g_hContactMenuItems[ICMI_OPEN_PROFILE],getContactUin(hContact));
+ sttEnableMenuItem(g_hContactMenuItems[ICMI_OPEN_PROFILE],getContactUin(hContact) != 0);
BYTE bXStatus = getContactXStatus((HANDLE)wParam);
sttEnableMenuItem(g_hContactMenuItems[ICMI_XSTATUS_DETAILS], m_bHideXStatusUI ? 0 : bXStatus != 0);
diff --git a/protocols/IcqOscarJ/icq_proto.h b/protocols/IcqOscarJ/icq_proto.h
index ef33b456f6..329ab4d897 100644
--- a/protocols/IcqOscarJ/icq_proto.h
+++ b/protocols/IcqOscarJ/icq_proto.h
@@ -735,8 +735,6 @@ struct CIcqProto : public PROTO_INTERFACE
DWORD icq_removeServerPrivacyItem(HANDLE hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType);
DWORD icq_addServerPrivacyItem(HANDLE hContact, DWORD dwUin, char *szUid, WORD wItemId, WORD wType);
- time_t dwLastCListGroupsChange;
-
int __cdecl ServListDbSettingChanged(WPARAM wParam, LPARAM lParam);
int __cdecl ServListDbContactDeleted(WPARAM wParam, LPARAM lParam);
int __cdecl ServListCListGroupChange(WPARAM wParam, LPARAM lParam);
diff --git a/protocols/IcqOscarJ/icq_servlist.cpp b/protocols/IcqOscarJ/icq_servlist.cpp
index 9da5e3e756..5be3c895d8 100644
--- a/protocols/IcqOscarJ/icq_servlist.cpp
+++ b/protocols/IcqOscarJ/icq_servlist.cpp
@@ -2667,15 +2667,6 @@ int CIcqProto::ServListDbSettingChanged(WPARAM wParam, LPARAM lParam)
{
DBCONTACTWRITESETTING* cws = (DBCONTACTWRITESETTING*)lParam;
- // We can't upload changes to NULL contact
- if ((HANDLE)wParam == NULL)
- { // only note last change of CListGroups - contact/group operation detection
- if (!strcmpnull(cws->szModule, "CListGroups"))
- dwLastCListGroupsChange = time(NULL);
-
- return 0;
- }
-
// TODO: Queue changes that occur while offline
if (!icqOnline() || !m_bSsiEnabled || bIsSyncingCL)
return 0;
@@ -2689,15 +2680,6 @@ int CIcqProto::ServListDbSettingChanged(WPARAM wParam, LPARAM lParam)
if (!strcmpnull(cws->szModule, "CList"))
{
- // Has a temporary contact just been added permanently?
- if (!strcmpnull(cws->szSetting, "NotOnList") &&
- (cws->value.type == DBVT_DELETED || (cws->value.type == DBVT_BYTE && cws->value.bVal == 0)))
- { // Add to server-list
- setContactHidden((HANDLE)wParam, 0);
- if (getSettingByte(NULL, "ServerAddRemove", DEFAULT_SS_ADDSERVER))
- AddServerContact(wParam, 0);
- }
-
// Has contact been renamed?
if (!strcmpnull(cws->szSetting, "MyHandle") &&
getSettingByte(NULL, "StoreServerDetails", DEFAULT_SS_STORE))
@@ -2711,10 +2693,6 @@ int CIcqProto::ServListDbSettingChanged(WPARAM wParam, LPARAM lParam)
{ // Read group from DB
char* szNewGroup = getContactCListGroup((HANDLE)wParam);
- // it is contact operation only ? no, if CListGroups was changed less than 10 secs ago
- if (szNewGroup && (dwLastCListGroupsChange + 10 < time(NULL)))
- servlistMoveContact((HANDLE)wParam, szNewGroup);
-
SAFE_FREE(&szNewGroup);
}
}
diff --git a/protocols/MSN/msn_global.h b/protocols/MSN/msn_global.h
index a2c1ba6dd6..0edd856495 100644
--- a/protocols/MSN/msn_global.h
+++ b/protocols/MSN/msn_global.h
@@ -562,7 +562,7 @@ struct ThreadData
//----| methods |---------------------------------------------------------------------
void applyGatewayData(HANDLE hConn, bool isPoll);
void getGatewayUrl(char* dest, int destlen, bool isPoll);
- void processSessionData(const char*);
+ void processSessionData(const char* xMsgr, const char* xHost);
void startThread(MsnThreadFunc , CMsnProto *prt);
int send(const char data[], size_t datalen);
diff --git a/protocols/MSN/msn_http.cpp b/protocols/MSN/msn_http.cpp
index cb3b60bbc3..5f727ef30b 100644
--- a/protocols/MSN/msn_http.cpp
+++ b/protocols/MSN/msn_http.cpp
@@ -82,20 +82,26 @@ PBYTE msn_httpGatewayUnwrapRecv(NETLIBHTTPREQUEST* nlhr, PBYTE buf, int len, int
if (nlhr->resultCode == 200)
{
+ char *xMsgr = NULL, *xHost = NULL;
+
for (int i=0; i < nlhr->headersCount; i++)
{
NETLIBHTTPHEADER& tHeader = nlhr->headers[i];
- if (_stricmp(tHeader.szName, "X-MSN-Messenger") != 0)
- continue;
+ if (_stricmp(tHeader.szName, "X-MSN-Messenger") == 0)
+ xMsgr = tHeader.szValue;
+ else if (_stricmp(tHeader.szName, "X-MSN-Host") == 0)
+ xHost = tHeader.szValue;
+
+ }
+ if (xMsgr)
+ {
isMsnPacket = true;
- if (strstr(tHeader.szValue, "Session=close") == 0)
+ if (strstr(xMsgr, "Session=close") == 0)
isSessionClosed = false;
- else
- break;
- T->processSessionData(tHeader.szValue);
+ T->processSessionData(xMsgr, xHost);
T->applyGatewayData(nlhr->nlc, false);
}
}
diff --git a/protocols/MSN/msn_threads.cpp b/protocols/MSN/msn_threads.cpp
index f312fcdc01..3581f9afad 100644
--- a/protocols/MSN/msn_threads.cpp
+++ b/protocols/MSN/msn_threads.cpp
@@ -747,24 +747,25 @@ void ThreadData::getGatewayUrl(char* dest, int destlen, bool isPoll)
mir_snprintf(dest, destlen, isPoll ? pollFmtStr : cmdFmtStr, mGatewayIP, mSessionID);
}
-void ThreadData::processSessionData(const char* str)
+void ThreadData::processSessionData(const char* xMsgr, const char* xHost)
{
- char tSessionID[40], tGateIP[40];
+ char tSessionID[40], tGateIP[80];
- char* tDelim = (char*)strchr(str, ';');
+ char* tDelim = (char*)strchr(xMsgr, ';');
if (tDelim == NULL)
return;
*tDelim = 0; tDelim += 2;
- if (!sscanf(str, "SessionID=%s", tSessionID))
+ if (!sscanf(xMsgr, "SessionID=%s", tSessionID))
return;
char* tDelim2 = strchr(tDelim, ';');
if (tDelim2 != NULL)
*tDelim2 = '\0';
-
- if (!sscanf(tDelim, "GW-IP=%s", tGateIP))
+ if (xHost)
+ strcpy(tGateIP, xHost);
+ else if (!sscanf(tDelim, "GW-IP=%s", tGateIP))
return;
strcpy(mGatewayIP, tGateIP);