summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-21 17:18:33 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-21 17:18:33 +0000
commit64516fd98ad1dae35864617563ee9963c0f31917 (patch)
tree5531fe065d5237dac8523fca1f19ff7f3ceeb958 /src
parent5e4262399fa35d391df2cc86ad0b259a08a25e5a (diff)
- OnSessionCreate was called too early;
- function names normalization git-svn-id: http://svn.miranda-ng.org/main/trunk@7818 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/core/stdchat/src/main.cpp20
-rw-r--r--src/modules/chat/chat_svc.cpp13
-rw-r--r--src/modules/chat/clist.cpp4
-rw-r--r--src/modules/chat/manager.cpp11
4 files changed, 24 insertions, 24 deletions
diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp
index aa0be90023..49aa8fcc07 100644
--- a/src/core/stdchat/src/main.cpp
+++ b/src/core/stdchat/src/main.cpp
@@ -112,7 +112,7 @@ static void OnClearLog(SESSION_INFO *si)
}
}
-static void OnSessionDblClick(SESSION_INFO *si)
+static void OnDblClickSession(SESSION_INFO *si)
{
if (g_Settings.bTabsEnable)
SendMessage(si->hWnd, GC_REMOVETAB, 1, (LPARAM)si);
@@ -120,7 +120,7 @@ static void OnSessionDblClick(SESSION_INFO *si)
PostMessage(si->hWnd, GC_CLOSEWINDOW, 0, 0);
}
-static void OnSessionRemove(SESSION_INFO *si)
+static void OnRemoveSession(SESSION_INFO *si)
{
if (!g_Settings.bTabsEnable) {
if (si->hWnd)
@@ -133,7 +133,7 @@ static void OnSessionRemove(SESSION_INFO *si)
g_TabSession.nUsersInNicklist = 0;
}
-static void OnSessionRename(SESSION_INFO *si)
+static void OnRenameSession(SESSION_INFO *si)
{
if (g_TabSession.hWnd && g_Settings.bTabsEnable) {
g_TabSession.ptszName = si->ptszName;
@@ -141,7 +141,7 @@ static void OnSessionRename(SESSION_INFO *si)
}
}
-static void OnSessionReplace(SESSION_INFO *si)
+static void OnReplaceSession(SESSION_INFO *si)
{
if (si->hWnd)
g_TabSession.nUsersInNicklist = 0;
@@ -154,7 +154,7 @@ static void OnSessionReplace(SESSION_INFO *si)
RedrawWindow(GetDlgItem(g_TabSession.hWnd, IDC_LIST), NULL, NULL, RDW_INVALIDATE);
}
-static void OnSessionOffline(SESSION_INFO *si)
+static void OnOfflineSession(SESSION_INFO *si)
{
if (si->hWnd) {
g_TabSession.nUsersInNicklist = 0;
@@ -350,11 +350,11 @@ extern "C" __declspec(dllexport) int Load(void)
pci->OnClearLog = OnClearLog;
pci->OnCreateModule = OnCreateModule;
- pci->OnSessionOffline = OnSessionOffline;
- pci->OnSessionRemove = OnSessionRemove;
- pci->OnSessionRename = OnSessionRename;
- pci->OnSessionReplace = OnSessionReplace;
- pci->OnSessionDblClick = OnSessionDblClick;
+ pci->OnOfflineSession = OnOfflineSession;
+ pci->OnRemoveSession = OnRemoveSession;
+ pci->OnRenameSession = OnRenameSession;
+ pci->OnReplaceSession = OnReplaceSession;
+ pci->OnDblClickSession = OnDblClickSession;
pci->OnEventBroadcast = OnEventBroadcast;
pci->OnLoadSettings = OnLoadSettings;
diff --git a/src/modules/chat/chat_svc.cpp b/src/modules/chat/chat_svc.cpp
index 5b3b2df05a..0644d3e983 100644
--- a/src/modules/chat/chat_svc.cpp
+++ b/src/modules/chat/chat_svc.cpp
@@ -214,7 +214,7 @@ static INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam)
si->ptszStatusbarText = mir_tstrdup(gcw->ptszStatusbarText);
si->iSplitterX = g_Settings->iSplitterX;
si->iSplitterY = g_Settings->iSplitterY;
- si->iLogFilterFlags = (int)db_get_dw(NULL, CHAT_MODULE, "FilterFlags", 0x03E0);
+ si->iLogFilterFlags = db_get_dw(NULL, CHAT_MODULE, "FilterFlags", 0x03E0);
si->bFilterEnabled = db_get_b(NULL, CHAT_MODULE, "FilterEnabled", 0);
si->bNicklistEnabled = db_get_b(NULL, CHAT_MODULE, "ShowNicklist", 1);
@@ -239,6 +239,9 @@ static INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam)
db_set_ts(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
db_set_s(si->hContact, si->pszModule, "StatusBar", "");
+
+ if (ci.OnCreateSession)
+ ci.OnCreateSession(si, mi);
}
else if (si = ci.SM_FindSession(gcw->ptszID, gcw->pszModule)) {
ci.UM_RemoveAll(&si->pUsers);
@@ -247,8 +250,8 @@ static INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam)
si->iStatusCount = 0;
si->nUsersInNicklist = 0;
- if (ci.OnSessionReplace)
- ci.OnSessionReplace(si);
+ if (ci.OnReplaceSession)
+ ci.OnReplaceSession(si);
}
return 0;
@@ -325,8 +328,8 @@ static int DoControl(GCEVENT *gce, WPARAM wp)
replaceStrT(si->ptszName, gce->ptszText);
if (si->hWnd)
SendMessage(si->hWnd, GC_UPDATETITLE, 0, 0);
- if (ci.OnSessionRename)
- ci.OnSessionRename(si);
+ if (ci.OnRenameSession)
+ ci.OnRenameSession(si);
}
}
diff --git a/src/modules/chat/clist.cpp b/src/modules/chat/clist.cpp
index ce9680cb32..503480e582 100644
--- a/src/modules/chat/clist.cpp
+++ b/src/modules/chat/clist.cpp
@@ -125,8 +125,8 @@ int RoomDoubleclicked(WPARAM wParam, LPARAM lParam)
!CallService(MS_CLIST_GETEVENT, (WPARAM)hContact, 0) &&
IsWindowVisible(si->hWnd) && !IsIconic(si->hWnd))
{
- if (ci.OnSessionDblClick)
- ci.OnSessionDblClick(si);
+ if (ci.OnDblClickSession)
+ ci.OnDblClickSession(si);
return 1;
}
ci.ShowRoom(si, WINDOW_VISIBLE, TRUE);
diff --git a/src/modules/chat/manager.cpp b/src/modules/chat/manager.cpp
index 0873dae5c3..1b8b498d49 100644
--- a/src/modules/chat/manager.cpp
+++ b/src/modules/chat/manager.cpp
@@ -72,9 +72,6 @@ static SESSION_INFO* SM_AddSession(const TCHAR *pszID, const char *pszModule)
node->ptszID = mir_tstrdup(pszID);
node->pszModule = mir_strdup(pszModule);
- if (ci.OnCreateSession)
- ci.OnCreateSession(node, ci.MM_FindModule(pszModule));
-
if (ci.wndList == NULL) { // list is empty
ci.wndList = node;
node->next = NULL;
@@ -131,8 +128,8 @@ static int SM_RemoveSession(const TCHAR *pszID, const char *pszModule, BOOL remo
if ((!pszID && pTemp->iType != GCW_SERVER || !lstrcmpi(pTemp->ptszID, pszID)) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
DWORD dw = pTemp->dwItemData;
- if (ci.OnSessionRemove)
- ci.OnSessionRemove(pTemp);
+ if (ci.OnRemoveSession)
+ ci.OnRemoveSession(pTemp);
DoEventHook(pTemp->ptszID, pTemp->pszModule, GC_SESSION_TERMINATE, NULL, NULL, (DWORD)pTemp->dwItemData);
if (pLast == NULL)
@@ -189,8 +186,8 @@ static BOOL SM_SetOffline(const TCHAR *pszID, const char *pszModule)
pTemp->nUsersInNicklist = 0;
if (pTemp->iType != GCW_SERVER)
pTemp->bInitDone = FALSE;
- if (ci.OnSessionOffline)
- ci.OnSessionOffline(pTemp);
+ if (ci.OnOfflineSession)
+ ci.OnOfflineSession(pTemp);
if (pszID)
return TRUE;
}