summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu/src/sessions.cpp
diff options
context:
space:
mode:
authorGoraf <22941576+Goraf@users.noreply.github.com>2018-01-20 16:25:13 +0100
committerGoraf <22941576+Goraf@users.noreply.github.com>2018-01-20 16:37:39 +0100
commit087173d06f4848f19d186b6902d399ce9b7225e1 (patch)
tree0cb2330486f445a2fa56c6da3a2d7ee983df6f52 /protocols/Gadu-Gadu/src/sessions.cpp
parentde12828fb9051fba1db1e4573cff56ee83ab6b1f (diff)
Gadu-Gadu: code cleaning
Diffstat (limited to 'protocols/Gadu-Gadu/src/sessions.cpp')
-rw-r--r--protocols/Gadu-Gadu/src/sessions.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp
index 52ad6f1efa..5c3396d035 100644
--- a/protocols/Gadu-Gadu/src/sessions.cpp
+++ b/protocols/Gadu-Gadu/src/sessions.cpp
@@ -86,11 +86,11 @@ static int gg_insertlistitem(HWND hList, gg_multilogon_id_t* id, const char* cli
static void gg_listsessions(GGPROTO* gg, HWND hwndDlg)
{
HWND hList = GetDlgItem(hwndDlg, IDC_SESSIONS);
- list_t l;
-
if (!hList)
return;
+ list_t l;
+
gg->gg_EnterCriticalSection(&gg->sessions_mutex, "gg_listsessions", 73, "sessions_mutex", 1);
for (l = gg->sessions; l; l = l->next)
{
@@ -104,6 +104,7 @@ static void gg_listsessions(GGPROTO* gg, HWND hwndDlg)
gg_insertlistitem(hList, &sess->id, sess->name, ip, loginTime);
}
gg->gg_LeaveCriticalSection(&gg->sessions_mutex, "gg_listsessions", 73, 1, "sessions_mutex", 1);
+
EnableWindow(GetDlgItem(hwndDlg, IDC_SIGNOUTALL), ListView_GetItemCount(hList) > 0);
}
@@ -384,6 +385,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w
break;
}
}
+
return FALSE;
}
@@ -410,6 +412,7 @@ BOOL GGPROTO::sessions_closedlg()
{
if (hwndSessionsDlg && IsWindow(hwndSessionsDlg))
return PostMessage(hwndSessionsDlg, WM_CLOSE, 0, 0);
+
return FALSE;
}