diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-10 23:33:35 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-10 23:33:35 +0000 |
commit | 18448e7014c32235db05465f1bf76b30f9954029 (patch) | |
tree | ebf78a23f27c92eeff9ad3d185258ea8fe029e97 /protocols/IRCG/src/tools.cpp | |
parent | 452fb59c22573ddf7939bea02b5e58f4f2e3916c (diff) |
GCDEST::pszModule and GCDEST::ptszID must be constant
git-svn-id: http://svn.miranda-ng.org/main/trunk@7586 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IRCG/src/tools.cpp')
-rw-r--r-- | protocols/IRCG/src/tools.cpp | 55 |
1 files changed, 1 insertions, 54 deletions
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp index ee4fcbb51c..9cfcb82137 100644 --- a/protocols/IRCG/src/tools.cpp +++ b/protocols/IRCG/src/tools.cpp @@ -406,60 +406,7 @@ TCHAR* __stdcall DoColorCodes(const TCHAR* text, bool bStrip, bool bReplacePerce INT_PTR CIrcProto::CallChatEvent(WPARAM wParam, LPARAM lParam)
{
- GCEVENT *gce = (GCEVENT *)lParam;
- INT_PTR iVal = 0;
-
- // first see if the scripting module should modify or stop this event
- if (m_bMbotInstalled && m_scriptingEnabled && gce && gce->time != 0 &&
- (gce->pDest->ptszID == NULL || lstrlen(gce->pDest->ptszID) != 0 && lstrcmpi(gce->pDest->ptszID, SERVERWINDOW)))
- {
- GCEVENT *gcevent = (GCEVENT*)lParam;
- WPARAM wp = wParam;
- GCEVENT *gcetemp = (GCEVENT*)mir_alloc(sizeof(GCEVENT));
- gcetemp->pDest = (GCDEST*)mir_alloc(sizeof(GCDEST));
- gcetemp->pDest->iType = gcevent->pDest->iType;
- gcetemp->dwFlags = gcevent->dwFlags;
- gcetemp->bIsMe = gcevent->bIsMe;
- gcetemp->cbSize = sizeof(GCEVENT);
- gcetemp->dwItemData = gcevent->dwItemData;
- gcetemp->time = gcevent->time;
- gcetemp->pDest->ptszID = mir_tstrdup(gcevent->pDest->ptszID);
- gcetemp->pDest->pszModule = mir_strdup(gcevent->pDest->pszModule);
- gcetemp->ptszText = mir_tstrdup(gcevent->ptszText);
- gcetemp->ptszUID = mir_tstrdup(gcevent->ptszUID);
- gcetemp->ptszNick = mir_tstrdup(gcevent->ptszNick);
- gcetemp->ptszStatus = mir_tstrdup(gcevent->ptszStatus);
- gcetemp->ptszUserInfo = mir_tstrdup(gcevent->ptszUserInfo);
-
- if (Scripting_TriggerMSPGuiIn(&wp, gcetemp) && gcetemp) {
- //MBOT CORRECTIONS
- //if ( gcetemp && gcetemp->pDest && gcetemp->pDest->ptszID ) {
- if (gcetemp && gcetemp->pDest && gcetemp->pDest->ptszID &&
- !my_strstri(gcetemp->pDest->ptszID, (IsConnected()) ? m_info.sNetwork.c_str() : TranslateT("Offline"))) {
-
- CMString sTempId = MakeWndID(gcetemp->pDest->ptszID);
- mir_realloc(gcetemp->pDest->ptszID, sizeof(TCHAR)*(sTempId.GetLength() + 1));
- lstrcpyn(gcetemp->pDest->ptszID, sTempId.c_str(), sTempId.GetLength() + 1);
- }
- iVal = CallServiceSync(MS_GC_EVENT, wp, (LPARAM)gcetemp);
- }
-
- if (gcetemp) {
- mir_free((void*)gcetemp->ptszNick);
- mir_free((void*)gcetemp->ptszUID);
- mir_free((void*)gcetemp->ptszStatus);
- mir_free((void*)gcetemp->ptszUserInfo);
- mir_free((void*)gcetemp->ptszText);
- mir_free((void*)gcetemp->pDest->ptszID);
- mir_free((void*)gcetemp->pDest->pszModule);
- mir_free((void*)gcetemp->pDest);
- mir_free((void*)gcetemp);
- }
-
- return iVal;
- }
-
- return CallServiceSync(MS_GC_EVENT, wParam, (LPARAM)gce);
+ return CallServiceSync(MS_GC_EVENT, wParam, (LPARAM)lParam);
}
INT_PTR CIrcProto::DoEvent(int iEvent, const TCHAR* pszWindow, const TCHAR* pszNick,
|