From 1432ca2e089f3c1cb68baebc1b70563bc133f857 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Tue, 22 Jan 2013 17:55:05 +0000 Subject: fixed work with HTTPServer git-svn-id: http://svn.miranda-ng.org/main/trunk@3235 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SendScreenshotPlus/src/CSend.cpp | 36 +++++++++++++------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'plugins/SendScreenshotPlus/src/CSend.cpp') diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index 83a9de4007..9c7a867fa7 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -68,7 +68,7 @@ void CSend::SetContact(HANDLE hContact) { //--------------------------------------------------------------------------- bool CSend::hasCap(unsigned int Flag) { - return (Flag & CallContactService(m_hContact, PS_GETCAPS, (WPARAM)PFLAGNUM_1, NULL)) == Flag; + return (Flag & CallContactService(m_hContact, PS_GETCAPS, PFLAGNUM_1, NULL)) == Flag; } //--------------------------------------------------------------------------- @@ -135,10 +135,7 @@ void CSend::svcSendUrl(const char* url) { } void CSend::svcSendChat() { - LPTSTR dirtyFix = NULL; GC_INFO gci = {0}; - GCDEST gcd = {0}; - GCEVENT gce = {0}; int res = GC_RESULT_NOSESSION; int cnt = (int)CallService(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)m_pszProto); @@ -146,28 +143,24 @@ void CSend::svcSendChat() { gci.pszModule = m_pszProto; for (int i = 0; i < cnt ; i++ ) { gci.iItem = i; - gci.Flags = BYINDEX | HCONTACT | ID; //need dirty fix - CallService(MS_GC_GETINFO, 0, (LPARAM)(GC_INFO *) &gci); + gci.Flags = BYINDEX | HCONTACT | ID; + CallService(MS_GC_GETINFO, 0, (LPARAM) &gci); if (gci.hContact == m_hContact) { + GCDEST gcd = {0}; gcd.pszModule = m_pszProto; - gcd.iType = GC_EVENT_SENDMESSAGE; //GC_EVENT_MESSAGE ???; -#ifdef _UNICODE + gcd.iType = GC_EVENT_SENDMESSAGE; gcd.ptszID = gci.pszID; -#else //dirty fix coz MS_GC_GETINFO dont know if caller is ansi or unicode. - //result from MS_GC_GETINFO only depend on type of chat.dll and not of caller type - dirtyFix = mir_u2t((wchar_t*)gci.pszID); - gcd.ptszID = dirtyFix; //fixed gci.pszID; -#endif - gce.cbSize = sizeof(GCEVENT); - gce.pDest = &gcd; - gce.bIsMe = TRUE; - gce.dwFlags = GC_TCHAR|GCEF_ADDTOLOG; - gce.ptszText = m_szEventMsgT; - gce.time = time(NULL); + + GCEVENT gce = {0}; + gce.cbSize = sizeof(GCEVENT); + gce.pDest = &gcd; + gce.bIsMe = TRUE; + gce.dwFlags = GC_TCHAR|GCEF_ADDTOLOG; + gce.ptszText = m_szEventMsgT; + gce.time = time(NULL); //* returns 0 on success or error code on failure - res = 200 + (int)CallService(MS_GC_EVENT, 0, (LPARAM)(GCEVENT *) &gce); - mir_freeAndNil(dirtyFix); + res = 200 + (int)CallService(MS_GC_EVENT, 0, (LPARAM) &gce); break; } } @@ -347,6 +340,7 @@ void CSend::Exit(unsigned int Result) { break; case ACKRESULT_FAILED: default: + err = false; break; } if (err){ -- cgit v1.2.3