summaryrefslogtreecommitdiff
path: root/protocols/Sametime/src/utils.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-03-30 17:06:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-03-30 17:06:18 +0000
commitcb10237090daf55027158e08ef86c458e25528bc (patch)
tree2d36d3de1f10eabf80ae734154306b8393a2c62a /protocols/Sametime/src/utils.cpp
parent1bbd0c6ab972fea466fd9328ce6e584ebc94fc58 (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@8793 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Sametime/src/utils.cpp')
-rw-r--r--protocols/Sametime/src/utils.cpp74
1 files changed, 31 insertions, 43 deletions
diff --git a/protocols/Sametime/src/utils.cpp b/protocols/Sametime/src/utils.cpp
index 40e23fbe4a..6c8964e8a0 100644
--- a/protocols/Sametime/src/utils.cpp
+++ b/protocols/Sametime/src/utils.cpp
@@ -4,29 +4,23 @@
LRESULT CALLBACK PopupWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
- case WM_COMMAND:
- {
- PUDeletePopup(hWnd);
- break;
- }
-
- case WM_CONTEXTMENU:
- PUDeletePopup(hWnd);
- break;
-
- case UM_FREEPLUGINDATA:
- {
- PopupData* puData = (PopupData*)PUGetPluginData(hWnd);
- if (puData != NULL && puData != (PopupData*)CALLSERVICE_NOTFOUND)
- {
- mir_free(puData->title);
- mir_free(puData->text);
- mir_free(puData);
- }
- break;
+ switch (msg) {
+ case WM_COMMAND:
+ PUDeletePopup(hWnd);
+ break;
+
+ case WM_CONTEXTMENU:
+ PUDeletePopup(hWnd);
+ break;
+
+ case UM_FREEPLUGINDATA:
+ PopupData* puData = (PopupData*)PUGetPluginData(hWnd);
+ if (puData != NULL && puData != (PopupData*)CALLSERVICE_NOTFOUND) {
+ mir_free(puData->title);
+ mir_free(puData->text);
+ mir_free(puData);
}
+ break;
}
return DefWindowProc(hWnd, msg, wParam, lParam);
@@ -63,7 +57,6 @@ void CSametimeProto::RegisterPopups()
puc.colorBack = GetSysColor(COLOR_BTNFACE);
puc.colorText = GetSysColor(COLOR_WINDOWTEXT);
hPopupError = Popup_RegisterClass(&puc);
-
}
@@ -90,51 +83,46 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam)
if (disp == ED_POP && !ServiceExists(MS_POPUP_ADDPOPUPCLASS)) disp = ED_BAL;
if (disp == ED_BAL && !ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) disp = ED_MB;
- if (disp == ED_POP){
-
- POPUPDATACLASS ppd = {sizeof(ppd)};
+ if (disp == ED_POP) {
+ POPUPDATACLASS ppd = { sizeof(ppd) };
char szName[256];
ppd.ptszTitle = puData->title;
ppd.ptszText = puData->text;
- if (puData->flag == SAMETIME_POPUP_ERROR){
+ if (puData->flag == SAMETIME_POPUP_ERROR)
mir_snprintf(szName, SIZEOF(szName), "%s_%s", proto->m_szModuleName, "Error");
- } else {
+ else
mir_snprintf(szName, SIZEOF(szName), "%s_%s", proto->m_szModuleName, "Notify");
- }
+ ppd.pszClassName = szName;
CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd);
-
- } else if (disp == ED_BAL) {
-
+ }
+ else if (disp == ED_BAL) {
MIRANDASYSTRAYNOTIFY sn = { sizeof(sn) };
sn.szProto = proto->m_szModuleName;
sn.tszInfoTitle = puData->title;
sn.tszInfo = puData->text;
sn.dwInfoFlags = NIIF_INTERN_UNICODE;
- if (puData->flag == SAMETIME_POPUP_ERROR){
+ if (puData->flag == SAMETIME_POPUP_ERROR) {
sn.dwInfoFlags = sn.dwInfoFlags | NIIF_WARNING;
sn.uTimeout = 1000 * 10;
- } else {
+ }
+ else {
sn.dwInfoFlags = sn.dwInfoFlags | NIIF_INFO;
sn.uTimeout = 1000 * 8;
}
CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM)&sn);
-
- } else { //disp == ED_MB
-
- if (puData->flag == SAMETIME_POPUP_ERROR){
+ }
+ else { //disp == ED_MB
+ if (puData->flag == SAMETIME_POPUP_ERROR)
MessageBox(NULL, puData->text, puData->title, MB_OK | MB_ICONWARNING);
- } else {
+ else
MessageBox(NULL, puData->text, puData->title, MB_OK | MB_ICONINFORMATION);
- }
-
}
- if (disp != ED_POP){
+ if (disp != ED_POP) {
mir_free(puData->title);
mir_free(puData->text);
mir_free(puData);
}
-
}
void CSametimeProto::showPopup(const TCHAR* msg, SametimePopupEnum flag)