summaryrefslogtreecommitdiff
path: root/protocols/IRCG
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-09-19 14:12:58 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-09-19 14:13:06 +0300
commite254312f9a660c83081ce2062ab14ba3c3614089 (patch)
tree324dff386c4b394ed4dc0f9b912ce3332bd94e84 /protocols/IRCG
parent54ad7c456325b4c7fd639ef2d7cca7d5aef81c05 (diff)
useless structure GCDEST finally removed
Diffstat (limited to 'protocols/IRCG')
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp12
-rw-r--r--protocols/IRCG/src/scripting.cpp27
-rw-r--r--protocols/IRCG/src/services.cpp6
-rw-r--r--protocols/IRCG/src/tools.cpp7
4 files changed, 25 insertions, 27 deletions
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index df1316ec8b..a7d5974d56 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -1297,13 +1297,12 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
while (PrefixToStatus(sTemp[0]) != pwszNormal)
sTemp.Delete(0, 1);
- GCDEST gcd = { m_szModuleName, sID, GC_EVENT_JOIN };
- GCEVENT gce = { &gcd };
+ GCEVENT gce = { m_szModuleName, sID, GC_EVENT_JOIN };
gce.ptszUID = sTemp;
gce.ptszNick = sTemp;
gce.ptszStatus = sStat;
- BOOL bIsMe = (!mir_wstrcmpi(gce.ptszNick, m_info.sNick)) ? TRUE : FALSE;
- if (bIsMe) {
+ gce.bIsMe = (!mir_wstrcmpi(gce.ptszNick, m_info.sNick)) ? TRUE : FALSE;
+ if (gce.bIsMe) {
char BitNr = -1;
switch (sTemp2[0]) {
case '+': BitNr = 0; break;
@@ -1317,10 +1316,11 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
else
btOwnMode = 0;
}
- gce.bIsMe = bIsMe;
- gce.time = bIsMe ? time(0) : 0;
+ gce.time = gce.bIsMe ? time(0) : 0;
Chat_Event(&gce);
+
DoEvent(GC_EVENT_SETCONTACTSTATUS, sChanName, sTemp, NULL, NULL, NULL, ID_STATUS_ONLINE, FALSE, FALSE);
+
// fix for networks like freshirc where they allow more than one prefix
if (PrefixToStatus(sTemp2[0]) != pwszNormal) {
sTemp2.Delete(0, 1);
diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp
index e4ef002172..d510422a84 100644
--- a/protocols/IRCG/src/scripting.cpp
+++ b/protocols/IRCG/src/scripting.cpp
@@ -59,9 +59,8 @@ static void __stdcall OnHook(void * pi)
GCHOOK* gch = (GCHOOK*)pi;
free(gch->ptszUID);
free(gch->ptszText);
- free((void*)gch->pDest->ptszID);
- free((void*)gch->pDest->pszModule);
- delete gch->pDest;
+ free((void*)gch->ptszID);
+ free((void*)gch->pszModule);
delete gch;
}
@@ -78,28 +77,28 @@ INT_PTR __cdecl CIrcProto::Scripting_InsertGuiOut(WPARAM, LPARAM lParam)
if (m_scriptingEnabled && gch) {
GCHOOK* gchook = new GCHOOK;
- gchook->pDest = new GCDEST;
-
gchook->dwData = gch->dwData;
- gchook->pDest->iType = gch->pDest->iType;
+ gchook->iType = gch->iType;
if (gch->ptszText)
gchook->ptszText = wcsdup(gch->ptszText);
- else gchook->ptszText = NULL;
+ else
+ gchook->ptszText = NULL;
if (gch->ptszUID)
gchook->ptszUID = wcsdup(gch->ptszUID);
else
gchook->ptszUID = NULL;
- if (gch->pDest->ptszID) {
- CMStringW S = MakeWndID(gch->pDest->ptszID);
- gchook->pDest->ptszID = wcsdup(S.c_str());
+ if (gch->ptszID) {
+ CMStringW S = MakeWndID(gch->ptszID);
+ gchook->ptszID = wcsdup(S.c_str());
}
- else gchook->pDest->ptszID = NULL;
+ else gchook->ptszID = NULL;
- if (gch->pDest->pszModule)
- gchook->pDest->pszModule = _strdup(gch->pDest->pszModule);
- else gchook->pDest->pszModule = NULL;
+ if (gch->pszModule)
+ gchook->pszModule = _strdup(gch->pszModule);
+ else
+ gchook->pszModule = NULL;
mir_forkthread(GuiOutThread, gchook);
return 0;
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp
index df95b79dbc..144b98f9bb 100644
--- a/protocols/IRCG/src/services.cpp
+++ b/protocols/IRCG/src/services.cpp
@@ -473,13 +473,13 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
// handle the hook
if (gch) {
- if (!mir_strcmpi(gch->pDest->pszModule, m_szModuleName)) {
- wchar_t *p1 = mir_wstrdup(gch->pDest->ptszID);
+ if (!mir_strcmpi(gch->pszModule, m_szModuleName)) {
+ wchar_t *p1 = mir_wstrdup(gch->ptszID);
wchar_t *p2 = wcsstr(p1, L" - ");
if (p2)
*p2 = '\0';
- switch (gch->pDest->iType) {
+ switch (gch->iType) {
case GC_SESSION_TERMINATE:
FreeWindowItemData(p1, (CHANNELINFO*)gch->dwData);
break;
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp
index 3efe9a248e..2ae539db46 100644
--- a/protocols/IRCG/src/tools.cpp
+++ b/protocols/IRCG/src/tools.cpp
@@ -380,7 +380,6 @@ INT_PTR CIrcProto::DoEvent(int iEvent, const wchar_t* pszWindow, const wchar_t*
const wchar_t* pszText, const wchar_t* pszStatus, const wchar_t* pszUserInfo,
DWORD_PTR dwItemData, bool bAddToLog, bool bIsMe, time_t timestamp)
{
- GCDEST gcd = { m_szModuleName, NULL, iEvent };
CMStringW sID;
CMStringW sText;
@@ -390,16 +389,16 @@ INT_PTR CIrcProto::DoEvent(int iEvent, const wchar_t* pszWindow, const wchar_t*
if (pszText)
sText = DoColorCodes(pszText, FALSE, TRUE);
+ GCEVENT gce = { m_szModuleName, NULL, iEvent };
if (pszWindow) {
if (mir_wstrcmpi(pszWindow, SERVERWINDOW))
sID = pszWindow + (CMStringW)L" - " + m_info.sNetwork;
else
sID = pszWindow;
- gcd.ptszID = (wchar_t*)sID.c_str();
+ gce.ptszID = (wchar_t*)sID.c_str();
}
- else gcd.ptszID = NULL;
+ else gce.ptszID = NULL;
- GCEVENT gce = { &gcd };
gce.ptszStatus = pszStatus;
gce.dwFlags = (bAddToLog) ? GCEF_ADDTOLOG : 0;
gce.ptszNick = pszNick;