diff options
-rw-r--r-- | include/m_popup.h | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_popup.cpp | 14 | ||||
-rw-r--r-- | plugins/NotifyAnything/src/main.cpp | 2 | ||||
-rw-r--r-- | plugins/Ping/src/utils.cpp | 2 | ||||
-rw-r--r-- | plugins/StatusPlugins/KeepStatus/keepstatus.cpp | 82 | ||||
-rw-r--r-- | plugins/StatusPlugins/KeepStatus/options.cpp | 48 | ||||
-rw-r--r-- | plugins/StatusPlugins/commonstatus.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/popups.cpp | 49 | ||||
-rw-r--r-- | protocols/MRA/src/MraPopUp.cpp | 11 | ||||
-rw-r--r-- | protocols/MSN/src/msn_misc.cpp | 35 | ||||
-rw-r--r-- | protocols/Tlen/src/jabber_opt.cpp | 28 | ||||
-rw-r--r-- | protocols/Xfire/src/tools.cpp | 25 |
12 files changed, 123 insertions, 177 deletions
diff --git a/include/m_popup.h b/include/m_popup.h index aeebbb6ab3..2218ab5f87 100644 --- a/include/m_popup.h +++ b/include/m_popup.h @@ -223,7 +223,7 @@ returns: > 0 for success, -1 for failure, 0 if the failure is due to second line PUIsSecondLineShown() before changing the text...)
*/
#define MS_POPUP_CHANGETEXT "PopUp/Changetext"
-static int __inline PUChangeText(HWND hWndPopUp, LPCTSTR lpzNewText) {
+static int __inline PUChangeText(HWND hWndPopUp, LPCSTR lpzNewText) {
return (int)CallService(MS_POPUP_CHANGETEXT, (WPARAM)hWndPopUp, (LPARAM)lpzNewText);
}
diff --git a/plugins/Clist_modern/src/modern_popup.cpp b/plugins/Clist_modern/src/modern_popup.cpp index 93b6a8d084..0064089438 100644 --- a/plugins/Clist_modern/src/modern_popup.cpp +++ b/plugins/Clist_modern/src/modern_popup.cpp @@ -55,7 +55,6 @@ void ShowPopup(const char *title, const char *description, int type) // Make popup
POPUPDATA ppd = { 0 };
- ppd.lchContact = 0;
ppd.lchIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
strncpy(ppd.lpzContactName, title == NULL ? "Modern Contact List" : title, SIZEOF(ppd.lpzContactName)-1);
@@ -66,23 +65,12 @@ void ShowPopup(const char *title, const char *description, int type) ppd.lpzText[SIZEOF(ppd.lpzText)-1] = '\0';
}
- if (type == POPUP_TYPE_NORMAL || type == POPUP_TYPE_TEST) {
- ppd.colorBack = 0;
- ppd.colorText = 0;
- }
- else {
+ if (type != POPUP_TYPE_NORMAL && type != POPUP_TYPE_TEST) {
ppd.colorBack = -1;
ppd.colorText = RGB(255,255,255);
}
ppd.PluginWindowProc = DumbPopupDlgProc;
-
- if (type == POPUP_TYPE_NORMAL || type == POPUP_TYPE_TEST)
- ppd.iSeconds = 0;
- else
- ppd.iSeconds = 0;
-
- // Now that every field has been filled, we want to see the popup.
PUAddPopUp(&ppd);
}
diff --git a/plugins/NotifyAnything/src/main.cpp b/plugins/NotifyAnything/src/main.cpp index 3d020de41f..af677b4ce4 100644 --- a/plugins/NotifyAnything/src/main.cpp +++ b/plugins/NotifyAnything/src/main.cpp @@ -583,7 +583,7 @@ void replaceMessage(const popup_t &msg) LeaveCS(&g_popups_cs);
- CallServiceSync(MS_POPUP_CHANGETEXT, (WPARAM)i->second->hwnd, (LPARAM)strip(i->second->message).c_str());
+ PUChangeText(i->second->hwnd, strip(i->second->message).c_str());
return;
}
}
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index a193888635..972d60845c 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -45,7 +45,7 @@ void __stdcall ShowPopup( const char* line1, const char* line2, int flags ) ppd->PluginWindowProc = NullWindowProc;
ppd->PluginData = NULL;
- QueueUserAPC( sttMainThreadCallback , mainThread, ( ULONG )ppd );
+ QueueUserAPC(sttMainThreadCallback, mainThread, ( ULONG )ppd );
}
else if(ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
POPUPDATACLASS d = {sizeof(d), "pingpopups"};
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 9d3ca24c14..40a9400030 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -141,9 +141,9 @@ int LoadMainOptions() GetCurrentConnectionSettings();
- if (DBGetContactSettingByte(NULL, MODULENAME, SETTING_CHECKCONNECTION, FALSE)) {
- if (DBGetContactSettingByte(NULL, MODULENAME, SETTING_CONTCHECK, FALSE)) {
- if (DBGetContactSettingByte(NULL, MODULENAME, SETTING_BYPING, FALSE)) {
+ if ( db_get_b(NULL, MODULENAME, SETTING_CHECKCONNECTION, FALSE)) {
+ if ( db_get_b(NULL, MODULENAME, SETTING_CONTCHECK, FALSE)) {
+ if ( db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE)) {
WSADATA wsaData;
WSAStartup(MAKEWORD(2, 2), &wsaData);
@@ -154,10 +154,10 @@ int LoadMainOptions() }
StartTimer(IDT_CHECKCONTIN, 0, FALSE);
}
- increaseExponential = DBGetContactSettingByte(NULL, MODULENAME, SETTING_INCREASEEXPONENTIAL, FALSE);
+ increaseExponential = db_get_b(NULL, MODULENAME, SETTING_INCREASEEXPONENTIAL, FALSE);
currentDelay = initDelay = 1000*DBGetContactSettingDword(NULL, MODULENAME, SETTING_INITDELAY, DEFAULT_INITDELAY);
maxDelay = 1000*DBGetContactSettingDword(NULL, MODULENAME, SETTING_MAXDELAY, DEFAULT_MAXDELAY);
- maxRetries = DBGetContactSettingByte(NULL, MODULENAME, SETTING_MAXRETRIES,0);
+ maxRetries = db_get_b(NULL, MODULENAME, SETTING_MAXRETRIES,0);
if (maxRetries == 0)
maxRetries = -1;
hProtoAckHook = HookEvent(ME_PROTO_ACK, ProcessProtoAck);
@@ -165,7 +165,7 @@ int LoadMainOptions() if (ServiceExists(ME_CS_STATUSCHANGE))
hCSStatusChangeHook = HookEvent(ME_CS_STATUSCHANGE, CSStatusChange);
hCSStatusChangeExHook = HookEvent(ME_CS_STATUSCHANGEEX, CSStatusChangeEx);
- if (DBGetContactSettingByte(NULL, MODULENAME, SETTING_CHECKAPMRESUME, 0)&&(CallService(MS_SYSTEM_GETVERSION,0,0) >= 0x00040000)) {
+ if ( db_get_b(NULL, MODULENAME, SETTING_CHECKAPMRESUME, 0)&&(CallService(MS_SYSTEM_GETVERSION,0,0) >= 0x00040000)) {
if (!IsWindow(hMessageWindow)) {
hMessageWindow = CreateWindowEx(0, _T("STATIC"), NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
SetWindowLongPtr(hMessageWindow, GWLP_WNDPROC, (LONG_PTR)MessageWndProc);
@@ -241,7 +241,7 @@ static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, TCH char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", cs->szName);
cs->lastStatus = lastStatus == 0 ? cs->status : lastStatus;
- if (!DBGetContactSettingByte(NULL, MODULENAME, dbSetting, 1))
+ if (!db_get_b(NULL, MODULENAME, dbSetting, 1))
cs->status = ID_STATUS_DISABLED;
else if (status == ID_STATUS_LAST)
cs->status = cs->lastStatus;
@@ -280,10 +280,10 @@ static int SetCurrentStatus() PROTOCOLSETTINGEX **ps = GetCurrentProtoSettingsCopy();
for (i=0; i < connectionSettings.getCount(); i++) {
realStatus = CallProtoService(ps[i]->szName, PS_GETSTATUS, 0, 0);
- if ( (ps[i]->status == ID_STATUS_DISABLED) || (ps[i]->status == realStatus) || (DBGetContactSettingByte(NULL, ps[i]->szName, SETTING_PROTORETRY, 0))) { // ignore this proto by removing it's name (not so nice)
+ if ( (ps[i]->status == ID_STATUS_DISABLED) || (ps[i]->status == realStatus) || ( db_get_b(NULL, ps[i]->szName, SETTING_PROTORETRY, 0))) { // ignore this proto by removing it's name (not so nice)
ps[i]->szName = "";
}
- else if ( (ps[i]->status != ID_STATUS_DISABLED) && (ps[i]->status != realStatus) && (realStatus != ID_STATUS_OFFLINE) && (DBGetContactSettingByte(NULL, MODULENAME, SETTING_FIRSTOFFLINE, FALSE))) {
+ else if ( (ps[i]->status != ID_STATUS_DISABLED) && (ps[i]->status != realStatus) && (realStatus != ID_STATUS_OFFLINE) && ( db_get_b(NULL, MODULENAME, SETTING_FIRSTOFFLINE, FALSE))) {
// force offline before reconnecting
log_infoA("KeepStatus: Setting %s offline before making a new connection attempt", ps[i]->szName);
CallProtoService(ps[i]->szName, PS_SETSTATUS, (WPARAM)ID_STATUS_OFFLINE, 0);
@@ -303,8 +303,8 @@ static int StatusChange(WPARAM wParam, LPARAM lParam) for (int i=0;i<connectionSettings.getCount();i++) {
TConnectionSettings& cs = connectionSettings[i];
if (GetStatus(cs) != ID_STATUS_DISABLED)
- if ( DBGetContactSettingByte(NULL, MODULENAME, SETTING_NOLOCKED, 0) ||
- !DBGetContactSettingByte(NULL, cs.szName, "LockMainStatus", 0 ))
+ if ( db_get_b(NULL, MODULENAME, SETTING_NOLOCKED, 0) ||
+ !db_get_b(NULL, cs.szName, "LockMainStatus", 0 ))
AssignStatus(&cs, wParam, 0, cs.szMsg);
}
}
@@ -537,10 +537,10 @@ static int ProcessProtoAck(WPARAM wParam,LPARAM lParam) return 0;
mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", ack->szModule);
- if (!DBGetContactSettingByte(NULL, MODULENAME, dbSetting, 1))
+ if (!db_get_b(NULL, MODULENAME, dbSetting, 1))
return 0;
- if (DBGetContactSettingByte(NULL, ack->szModule, SETTING_PROTORETRY, 0)) {
+ if ( db_get_b(NULL, ack->szModule, SETTING_PROTORETRY, 0)) {
log_infoA("KeepStatus: %s has built-in reconnection enabled", ack->szModule);
return 0;
}
@@ -563,7 +563,7 @@ static int ProcessProtoAck(WPARAM wParam,LPARAM lParam) TConnectionSettings& cs = connectionSettings[i];
if (!strcmp(ack->szModule, cs.szName)) {
AssignStatus(&cs, ID_STATUS_OFFLINE, 0, NULL);
- if (DBGetContactSettingByte(NULL, MODULENAME, SETTING_CNCOTHERLOC, 0)) {
+ if ( db_get_b(NULL, MODULENAME, SETTING_CNCOTHERLOC, 0)) {
StopTimer(IDT_PROCESSACK);
for (j=0;j<connectionSettings.getCount();j++) {
AssignStatus(&connectionSettings[j], ID_STATUS_OFFLINE, 0, NULL);
@@ -576,7 +576,7 @@ static int ProcessProtoAck(WPARAM wParam,LPARAM lParam) else if (ack->result == ACKRESULT_FAILED) {
// login failed
NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_LOGINERROR, (LPARAM)ack->szModule);
- switch (DBGetContactSettingByte(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING)) {
+ switch ( db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING)) {
case LOGINERR_CANCEL:
{
log_infoA("KeepStatus: cancel on login error (%s)", ack->szModule);
@@ -695,7 +695,7 @@ static VOID CALLBACK CheckConnectionTimer(HWND hwnd,UINT message,UINT_PTR idEven if (increaseExponential)
currentDelay = min(2*currentDelay,maxDelay);
- if ( ((DBGetContactSettingByte(NULL, MODULENAME, SETTING_CHKINET, 0)) && (!InternetGetConnectedState(NULL, 0))) || ((DBGetContactSettingByte(NULL, MODULENAME, SETTING_BYPING, FALSE)) && (!bLastPingResult))) {
+ if ( (( db_get_b(NULL, MODULENAME, SETTING_CHKINET, 0)) && (!InternetGetConnectedState(NULL, 0))) || (( db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE)) && (!bLastPingResult))) {
// no network
NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_RETRYNOCONN, (LPARAM)retryCount+1);
ProcessPopup(KS_CONN_STATE_RETRYNOCONN, 0);
@@ -796,7 +796,7 @@ static void CheckContinueslyFunction(void *arg) return;
}
- BOOL ping = DBGetContactSettingByte(NULL, MODULENAME, SETTING_BYPING, FALSE);
+ BOOL ping = db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE);
if (ping) {
DBVARIANT dbv;
if (DBGetContactSetting(NULL, MODULENAME, SETTING_PINGHOST, &dbv))
@@ -890,7 +890,7 @@ static void CheckContinueslyFunction(void *arg) log_infoA("KeepStatus: connection lost! (continuesly check)");
NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_LOST, 0);
ProcessPopup(KS_CONN_STATE_LOST, 0);
- maxRetries = DBGetContactSettingByte(NULL, MODULENAME, SETTING_MAXRETRIES, 0);
+ maxRetries = db_get_b(NULL, MODULENAME, SETTING_MAXRETRIES, 0);
if (maxRetries == 0)
maxRetries = -1;
StartTimer(IDT_CHECKCONN, initDelay, FALSE);
@@ -900,7 +900,7 @@ static void CheckContinueslyFunction(void *arg) static VOID CALLBACK CheckContinueslyTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime)
{
- if (DBGetContactSettingByte(NULL, MODULENAME, SETTING_BYPING, FALSE))
+ if ( db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE))
mir_forkthread(CheckContinueslyFunction, NULL);
else
CheckContinueslyFunction(NULL);
@@ -912,7 +912,7 @@ static int ProcessPopup(int reason, LPARAM lParam) HICON hIcon;
char text[MAX_SECONDLINE], protoName[128], *szProto;
- if ( !DBGetContactSettingByte(NULL, MODULENAME, SETTING_SHOWCONNECTIONPOPUPS,FALSE) || !ServiceExists(MS_POPUP_ADDPOPUP))
+ if ( !db_get_b(NULL, MODULENAME, SETTING_SHOWCONNECTIONPOPUPS,FALSE) || !ServiceExists(MS_POPUP_ADDPOPUP))
return -1;
memset(protoName, '\0', sizeof(protoName));
@@ -922,7 +922,7 @@ static int ProcessPopup(int reason, LPARAM lParam) switch(reason) {
case KS_CONN_STATE_OTHERLOCATION: // lParam = 1 proto
- if (!DBGetContactSettingByte(NULL, MODULENAME, SETTING_PUOTHER, TRUE))
+ if (!db_get_b(NULL, MODULENAME, SETTING_PUOTHER, TRUE))
return -1;
szProto = (char *)lParam;
@@ -935,16 +935,16 @@ static int ProcessPopup(int reason, LPARAM lParam) /*******************
rethink this
********************/
- if (!DBGetContactSettingByte(NULL, MODULENAME, SETTING_PUOTHER, TRUE))
+ if (!db_get_b(NULL, MODULENAME, SETTING_PUOTHER, TRUE))
return -1;
szProto = (char *)lParam;
hIcon = (HICON)CallService(MS_SKIN_LOADPROTOICON, (WPARAM)szProto, (LPARAM)SKINICON_STATUS_OFFLINE);
CallProtoService(szProto, PS_GETNAME, sizeof(protoName), (LPARAM)protoName);
- if (DBGetContactSettingByte(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_CANCEL)
+ if ( db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_CANCEL)
_snprintf(text, sizeof(text), Translate("%s Login error, cancel reconnecting"), protoName);
- else if (DBGetContactSettingByte(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_SETDELAY)
+ else if ( db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_SETDELAY)
_snprintf(text, sizeof(text), Translate("%s Login error (next retry (%d) in %ds)"), protoName, retryCount+1, DBGetContactSettingDword(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY));
else
@@ -953,7 +953,7 @@ static int ProcessPopup(int reason, LPARAM lParam) break;
case KS_CONN_STATE_LOST: // lParam = 1 proto, or NULL
- if (!DBGetContactSettingByte(NULL, MODULENAME, SETTING_PUCONNLOST, TRUE))
+ if (!db_get_b(NULL, MODULENAME, SETTING_PUCONNLOST, TRUE))
return -1;
szProto = (char *)lParam;
@@ -974,7 +974,7 @@ static int ProcessPopup(int reason, LPARAM lParam) PROTOCOLSETTINGEX **ps;
char protoInfoLine[512], protoInfo[MAX_SECONDLINE];
- if (!DBGetContactSettingByte(NULL, MODULENAME, SETTING_PUCONNRETRY, TRUE))
+ if (!db_get_b(NULL, MODULENAME, SETTING_PUCONNRETRY, TRUE))
return -1;
memset(protoInfoLine, '\0', sizeof(protoInfoLine));
@@ -987,7 +987,7 @@ static int ProcessPopup(int reason, LPARAM lParam) if (szProto == NULL) {
szProto = ps[i]->szName;
}
- if (DBGetContactSettingByte(NULL, MODULENAME, SETTING_PUSHOWEXTRA, TRUE)) {
+ if ( db_get_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, TRUE)) {
CallProtoService(ps[i]->szName, PS_GETNAME, sizeof(protoName), (LPARAM)protoName);
//_snprintf(protoInfoLine, sizeof(protoInfoLine), Translate("%s\t(will be set to %s)\r\n"), protoName, (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)ps[i]->status, 0));
_snprintf(protoInfoLine, sizeof(protoInfoLine), "%s\t(%s %s)\r\n", protoName, Translate("will be set to"), (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)ps[i]->status, 0));
@@ -1012,7 +1012,7 @@ static int ProcessPopup(int reason, LPARAM lParam) break;
case KS_CONN_STATE_RETRYNOCONN: // lParam = NULL
- if (!DBGetContactSettingByte(NULL, MODULENAME, SETTING_PUOTHER, TRUE))
+ if (!db_get_b(NULL, MODULENAME, SETTING_PUOTHER, TRUE))
return -1;
hIcon = (HICON)CallService(MS_SKIN_LOADICON, (WPARAM)SKINICON_STATUS_OFFLINE, 0);
@@ -1023,7 +1023,7 @@ static int ProcessPopup(int reason, LPARAM lParam) break;
case KS_CONN_STATE_STOPPEDCHECKING: // lParam == BOOL succes
- if (!DBGetContactSettingByte(NULL, MODULENAME, SETTING_PURESULT, TRUE))
+ if (!db_get_b(NULL, MODULENAME, SETTING_PURESULT, TRUE))
return -1;
if (lParam) {
@@ -1045,31 +1045,23 @@ static int ProcessPopup(int reason, LPARAM lParam) static INT_PTR ShowPopup(char* msg, HICON hIcon)
{
- POPUPDATA ppd = { NULL };
- ppd.lchContact = NULL;
+ POPUPDATA ppd = { 0 };
ppd.lchIcon = hIcon;
- memset(ppd.lpzContactName, '\0', sizeof(ppd.lpzContactName));
- memset(ppd.lpzText, '\0', sizeof(ppd.lpzText));
strncpy(ppd.lpzContactName, Translate("KeepStatus"), sizeof(ppd.lpzContactName)-1);
strncpy(ppd.lpzText, msg, sizeof(ppd.lpzText)-1);
- if (DBGetContactSettingByte(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, 0))
+ if ( db_get_b(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, 0))
{
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
}
- else if (DBGetContactSettingByte(NULL, MODULENAME, SETTING_POPUP_USEDEFCOLORS, 0))
- {
- ppd.colorBack = NULL;
- ppd.colorText = NULL;
- }
- else
+ else if ( !db_get_b(NULL, MODULENAME, SETTING_POPUP_USEDEFCOLORS, 0))
{
ppd.colorBack = DBGetContactSettingDword(NULL, MODULENAME, SETTING_POPUP_BACKCOLOR, 0xAAAAAA);
ppd.colorText = DBGetContactSettingDword(NULL, MODULENAME, SETTING_POPUP_TEXTCOLOR, 0x0000CC);
}
ppd.PluginWindowProc = PopupDlgProc;
- ppd.PluginData = NULL;
- switch (DBGetContactSettingByte(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU)) {
+
+ switch ( db_get_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU)) {
case POPUP_DELAYCUSTOM:
ppd.iSeconds = (int)DBGetContactSettingDword(NULL, MODULENAME, SETTING_POPUP_TIMEOUT, 0);
if (ppd.iSeconds == 0) {
@@ -1092,7 +1084,7 @@ LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa switch(message) {
case WM_CONTEXTMENU: // right
case WM_COMMAND: // left
- switch( DBGetContactSettingByte( NULL, MODULENAME,
+ switch( db_get_b( NULL, MODULENAME,
(message == WM_COMMAND) ? SETTING_POPUP_LEFTCLICK : SETTING_POPUP_RIGHTCLICK,
POPUP_ACT_CLOSEPOPUP )) {
case POPUP_ACT_CANCEL:
@@ -1131,7 +1123,7 @@ INT_PTR EnableProtocolService(WPARAM wParam, LPARAM lParam) char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", szProto);
- if (!DBGetContactSettingByte(NULL, MODULENAME, dbSetting, 1)) // 'hard' disabled
+ if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) // 'hard' disabled
return -1;
int ret = -2;
@@ -1158,7 +1150,7 @@ INT_PTR IsProtocolEnabledService(WPARAM wParam, LPARAM lParam) char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", szProto);
- if ( !DBGetContactSettingByte(NULL, MODULENAME, dbSetting, 1 ))
+ if ( !db_get_b(NULL, MODULENAME, dbSetting, 1 ))
return FALSE;
for ( int i=0; i < connectionSettings.getCount(); i++ ) {
diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp index c62510fade..15b1996748 100644 --- a/plugins/StatusPlugins/KeepStatus/options.cpp +++ b/plugins/StatusPlugins/KeepStatus/options.cpp @@ -45,13 +45,13 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg,UINT msg,WPARAM wParam,L int i;
DBVARIANT dbv;
- SetDlgItemInt(hwndDlg, IDC_MAXRETRIES, DBGetContactSettingByte(NULL,MODULENAME,SETTING_MAXRETRIES,DEFAULT_MAXRETRIES),FALSE);
+ SetDlgItemInt(hwndDlg, IDC_MAXRETRIES, db_get_b(NULL,MODULENAME,SETTING_MAXRETRIES,DEFAULT_MAXRETRIES),FALSE);
SetDlgItemInt(hwndDlg, IDC_INITDELAY, DBGetContactSettingDword(NULL,MODULENAME,SETTING_INITDELAY,DEFAULT_INITDELAY),FALSE);
- CheckDlgButton(hwndDlg, IDC_CHECKCONNECTION, DBGetContactSettingByte(NULL, MODULENAME, SETTING_CHECKCONNECTION,FALSE)?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWCONNECTIONPOPUPS, (DBGetContactSettingByte(NULL, MODULENAME, SETTING_SHOWCONNECTIONPOPUPS,FALSE)&&ServiceExists(MS_POPUP_SHOWMESSAGE))?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CHKINET, DBGetContactSettingByte(NULL, MODULENAME, SETTING_CHKINET, FALSE)?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CONTCHECK, DBGetContactSettingByte(NULL, MODULENAME, SETTING_CONTCHECK, FALSE)?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_BYPING, DBGetContactSettingByte(NULL, MODULENAME, SETTING_BYPING, FALSE)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHECKCONNECTION, db_get_b(NULL, MODULENAME, SETTING_CHECKCONNECTION,FALSE)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWCONNECTIONPOPUPS, ( db_get_b(NULL, MODULENAME, SETTING_SHOWCONNECTIONPOPUPS,FALSE)&&ServiceExists(MS_POPUP_SHOWMESSAGE))?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHKINET, db_get_b(NULL, MODULENAME, SETTING_CHKINET, FALSE)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CONTCHECK, db_get_b(NULL, MODULENAME, SETTING_CONTCHECK, FALSE)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_BYPING, db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE)?BST_CHECKED:BST_UNCHECKED);
if (!DBGetContactSetting(NULL, MODULENAME, SETTING_PINGHOST, &dbv))
SetDlgItemTextA(hwndDlg, IDC_PINGHOST, dbv.pszVal);
// proto list
@@ -82,7 +82,7 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg,UINT msg,WPARAM wParam,L char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", protos[i]->szModuleName);
- ListView_SetCheckState(hList, lvItem.iItem, DBGetContactSettingByte(NULL, MODULENAME, dbSetting, TRUE));
+ ListView_SetCheckState(hList, lvItem.iItem, db_get_b(NULL, MODULENAME, dbSetting, TRUE));
lvItem.iItem++;
}
EnableWindow(GetDlgItem(hwndDlg, IDC_MAXRETRIES), IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION));
@@ -178,16 +178,16 @@ static INT_PTR CALLBACK DlgProcKSAdvOpts(HWND hwndDlg,UINT msg,WPARAM wParam,LPA TranslateDialogDefault(hwndDlg);
SetDlgItemInt(hwndDlg, IDC_MAXDELAY, DBGetContactSettingDword(NULL,MODULENAME,SETTING_MAXDELAY,DEFAULT_MAXDELAY),FALSE);
SetDlgItemInt(hwndDlg, IDC_MAXCONNECTINGTIME, DBGetContactSettingDword(NULL,MODULENAME,SETTING_MAXCONNECTINGTIME,0),FALSE);
- CheckDlgButton(hwndDlg, IDC_INCREASEEXPONENTIAL, DBGetContactSettingByte(NULL, MODULENAME, SETTING_INCREASEEXPONENTIAL,FALSE)?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CNCOTHERLOC, (DBGetContactSettingByte(NULL, MODULENAME, SETTING_CNCOTHERLOC, FALSE)&&(CallService(MS_SYSTEM_GETVERSION,0,0) >= 0x00040000))?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_LOGINERR, DBGetContactSettingByte(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING)==LOGINERR_NOTHING?FALSE:TRUE);
- CheckDlgButton(hwndDlg, IDC_CHECKAPMRESUME, (DBGetContactSettingByte(NULL, MODULENAME, SETTING_CHECKAPMRESUME, FALSE)&&(CallService(MS_SYSTEM_GETVERSION,0,0) >= 0x00040000))?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_FIRSTOFFLINE, (DBGetContactSettingByte(NULL, MODULENAME, SETTING_FIRSTOFFLINE, FALSE)));
- CheckDlgButton(hwndDlg, IDC_NOLOCKED, (DBGetContactSettingByte(NULL, MODULENAME, SETTING_NOLOCKED, FALSE)));
+ CheckDlgButton(hwndDlg, IDC_INCREASEEXPONENTIAL, db_get_b(NULL, MODULENAME, SETTING_INCREASEEXPONENTIAL,FALSE)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CNCOTHERLOC, ( db_get_b(NULL, MODULENAME, SETTING_CNCOTHERLOC, FALSE)&&(CallService(MS_SYSTEM_GETVERSION,0,0) >= 0x00040000))?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_LOGINERR, db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING)==LOGINERR_NOTHING?FALSE:TRUE);
+ CheckDlgButton(hwndDlg, IDC_CHECKAPMRESUME, ( db_get_b(NULL, MODULENAME, SETTING_CHECKAPMRESUME, FALSE)&&(CallService(MS_SYSTEM_GETVERSION,0,0) >= 0x00040000))?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_FIRSTOFFLINE, ( db_get_b(NULL, MODULENAME, SETTING_FIRSTOFFLINE, FALSE)));
+ CheckDlgButton(hwndDlg, IDC_NOLOCKED, ( db_get_b(NULL, MODULENAME, SETTING_NOLOCKED, FALSE)));
SetDlgItemInt(hwndDlg, IDC_LOGINERR_DELAY, DBGetContactSettingDword(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY), FALSE);
SetDlgItemInt(hwndDlg, IDC_PINGCOUNT, DBGetContactSettingWord(NULL, MODULENAME, SETTING_PINGCOUNT, DEFAULT_PINGCOUNT), FALSE);
SetDlgItemInt(hwndDlg, IDC_CNTDELAY, DBGetContactSettingDword(NULL, MODULENAME, SETTING_CNTDELAY, CHECKCONTIN_DELAY), FALSE);
- switch (DBGetContactSettingByte(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_CANCEL)) {
+ switch ( db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_CANCEL)) {
case LOGINERR_SETDELAY:
CheckRadioButton(hwndDlg, IDC_LOGINERR_CANCEL, IDC_LOGINERR_SETDELAY, IDC_LOGINERR_SETDELAY);
break;
@@ -371,7 +371,7 @@ INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar bFreeze = true;
// left action
- switch ( DBGetContactSettingByte( NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_CANCEL )) {
+ switch ( db_get_b( NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_CANCEL )) {
case POPUP_ACT_CLOSEPOPUP:
CheckDlgButton(hwndDlg, IDC_LCLOSE, BST_CHECKED);
break;
@@ -386,7 +386,7 @@ INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar break;
}
// right action
- switch ( DBGetContactSettingByte( NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_CANCEL )) {
+ switch ( db_get_b( NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_CANCEL )) {
case POPUP_ACT_CLOSEPOPUP:
CheckDlgButton(hwndDlg, IDC_RCLOSE, BST_CHECKED);
break;
@@ -405,7 +405,7 @@ INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar EnableWindow(GetDlgItem(hwndDlg, IDC_DELAYFROMPU), ServiceExists(MS_POPUP_ADDPOPUP));
EnableWindow(GetDlgItem(hwndDlg, IDC_DELAYPERMANENT), ServiceExists(MS_POPUP_ADDPOPUP));
EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), ServiceExists(MS_POPUP_ADDPOPUP));
- switch (DBGetContactSettingByte(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU)) {
+ switch ( db_get_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU)) {
case POPUP_DELAYCUSTOM:
CheckDlgButton(hwndDlg, IDC_DELAYCUSTOM, BST_CHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), ServiceExists(MS_POPUP_ADDPOPUP));
@@ -429,19 +429,19 @@ INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar // text
SendDlgItemMessage(hwndDlg,IDC_TEXTCOLOR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL, MODULENAME, SETTING_POPUP_TEXTCOLOR, 0x0000CC));
// wincolors
- CheckDlgButton(hwndDlg, IDC_WINCOLORS, DBGetContactSettingByte(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, 0));
+ CheckDlgButton(hwndDlg, IDC_WINCOLORS, db_get_b(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, 0));
// defaultcolors
- CheckDlgButton(hwndDlg, IDC_DEFAULTCOLORS, ( (DBGetContactSettingByte(NULL, MODULENAME, SETTING_POPUP_USEDEFCOLORS, 0)) && (!IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS))));
+ CheckDlgButton(hwndDlg, IDC_DEFAULTCOLORS, ( ( db_get_b(NULL, MODULENAME, SETTING_POPUP_USEDEFCOLORS, 0)) && (!IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS))));
EnableWindow(GetDlgItem(hwndDlg, IDC_BGCOLOR), ((!IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)) && (!IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS))));
EnableWindow(GetDlgItem(hwndDlg, IDC_TEXTCOLOR), ((!IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)) && (!IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS))));
EnableWindow(GetDlgItem(hwndDlg, IDC_DEFAULTCOLORS), (!IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)));
EnableWindow(GetDlgItem(hwndDlg, IDC_WINCOLORS), (!IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS)));
// popup types
- CheckDlgButton(hwndDlg, IDC_PUCONNLOST, DBGetContactSettingByte(NULL, MODULENAME, SETTING_PUCONNLOST, TRUE)?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_PUOTHER, DBGetContactSettingByte(NULL, MODULENAME, SETTING_PUOTHER, TRUE)?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_PUCONNRETRY, DBGetContactSettingByte(NULL, MODULENAME, SETTING_PUCONNRETRY, TRUE)?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_PURESULT, DBGetContactSettingByte(NULL, MODULENAME, SETTING_PURESULT, TRUE)?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_PUSHOWEXTRA, DBGetContactSettingByte(NULL, MODULENAME, SETTING_PUSHOWEXTRA, TRUE)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_PUCONNLOST, db_get_b(NULL, MODULENAME, SETTING_PUCONNLOST, TRUE)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_PUOTHER, db_get_b(NULL, MODULENAME, SETTING_PUOTHER, TRUE)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_PUCONNRETRY, db_get_b(NULL, MODULENAME, SETTING_PUCONNRETRY, TRUE)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_PURESULT, db_get_b(NULL, MODULENAME, SETTING_PURESULT, TRUE)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_PUSHOWEXTRA, db_get_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, TRUE)?BST_CHECKED:BST_UNCHECKED);
bFreeze = false;
break;
diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp index 9ca9e15e35..c788042af3 100644 --- a/plugins/StatusPlugins/commonstatus.cpp +++ b/plugins/StatusPlugins/commonstatus.cpp @@ -179,7 +179,7 @@ static int equalsGlobalStatus(PROTOCOLSETTINGEX **ps) { if (pstatus == 0)
pstatus = CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0);
- if (DBGetContactSettingByte(NULL, protos[i]->szModuleName, "LockMainStatus", 0)) {
+ if ( db_get_b(NULL, protos[i]->szModuleName, "LockMainStatus", 0)) {
// if proto is locked, pstatus must be the current status
if (pstatus != CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0))
return 0;
diff --git a/protocols/Gadu-Gadu/src/popups.cpp b/protocols/Gadu-Gadu/src/popups.cpp index 69ac1c350d..386435c973 100644 --- a/protocols/Gadu-Gadu/src/popups.cpp +++ b/protocols/Gadu-Gadu/src/popups.cpp @@ -110,8 +110,7 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam) PopupData* puData = (PopupData*)dwParam;
GGPROTO* gg = puData->gg;
- if (ServiceExists(MS_POPUP_ADDPOPUPCLASS))
- {
+ if (ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
char szName[256];
POPUPDATACLASS ppd = {sizeof(ppd)};
ppd.ptszTitle = puData->title;
@@ -125,46 +124,38 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam) mir_snprintf(szName, SIZEOF(szName), "%s_%s", gg->m_szModuleName, "Notify");
CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd);
+ return;
}
- else
- {
- if (puData->flags & GG_POPUP_ALLOW_MSGBOX)
- {
- BOOL bShow = TRUE;
- if (puData->flags & GG_POPUP_ONCE)
- {
- HWND hWnd = FindWindow(NULL, gg->m_tszUserName);
- while (hWnd != NULL)
- {
- if (FindWindowEx(hWnd, NULL, NULL, puData->text) != NULL)
- {
- bShow = FALSE;
- break;
- }
- hWnd = FindWindowEx(NULL, hWnd, NULL, gg->m_tszUserName);
+ if (puData->flags & GG_POPUP_ALLOW_MSGBOX) {
+ BOOL bShow = TRUE;
+
+ if (puData->flags & GG_POPUP_ONCE) {
+ HWND hWnd = FindWindow(NULL, gg->m_tszUserName);
+ while (hWnd != NULL) {
+ if (FindWindowEx(hWnd, NULL, NULL, puData->text) != NULL) {
+ bShow = FALSE;
+ break;
}
+ hWnd = FindWindowEx(NULL, hWnd, NULL, gg->m_tszUserName);
}
+ }
- if (bShow)
- {
- UINT uIcon = puData->flags & GG_POPUP_ERROR ? MB_ICONERROR : puData->flags & GG_POPUP_WARNING ? MB_ICONEXCLAMATION : MB_ICONINFORMATION;
- MessageBox(NULL, puData->text, gg->m_tszUserName, MB_OK | uIcon);
- }
+ if (bShow) {
+ UINT uIcon = puData->flags & GG_POPUP_ERROR ? MB_ICONERROR : puData->flags & GG_POPUP_WARNING ? MB_ICONEXCLAMATION : MB_ICONINFORMATION;
+ MessageBox(NULL, puData->text, gg->m_tszUserName, MB_OK | uIcon);
}
- mir_free(puData->title);
- mir_free(puData->text);
- mir_free(puData);
}
+ mir_free(puData->title);
+ mir_free(puData->text);
+ mir_free(puData);
}
void GGPROTO::showpopup(const TCHAR* nickname, const TCHAR* msg, int flags)
{
- PopupData* puData;
-
if (Miranda_Terminated()) return;
- puData = (PopupData*)mir_alloc(sizeof(PopupData));
+ PopupData *puData = (PopupData*)mir_calloc(sizeof(PopupData));
puData->flags = flags;
puData->title = mir_tstrdup(nickname);
puData->text = mir_tstrdup(msg);
diff --git a/protocols/MRA/src/MraPopUp.cpp b/protocols/MRA/src/MraPopUp.cpp index 40f97d82c8..fb284c9114 100644 --- a/protocols/MRA/src/MraPopUp.cpp +++ b/protocols/MRA/src/MraPopUp.cpp @@ -157,14 +157,11 @@ void CALLBACK MraPopupThreadMarandaCallback(ULONG_PTR dwParam) if (dwParam == 0)
return;
- MraPopupData* dat = (MraPopupData*)((POPUPDATAW*)dwParam)->PluginData;
- if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS && dat->ppro->hWndEMailPopupStatus) {
- // 1: PUDeletePopUp(hWndDlg);
- // 1: PUAddPopUpW((POPUPDATAW*)dwParam);
- // 2: PUChangeW(hWndEMailPopupStatus, (POPUPDATAW*)dwParam); //- crash :/
+ MraPopupData *dat = (MraPopupData*)((POPUPDATAW*)dwParam)->PluginData;
+ if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS && dat->ppro->hWndEMailPopupStatus)
PUChangeTextW(dat->ppro->hWndEMailPopupStatus, ((POPUPDATAW*)dwParam)->lpwzText);
- }
- else PUAddPopUpW((POPUPDATAW*)dwParam);
+ else
+ PUAddPopUpW((POPUPDATAW*)dwParam);
mir_free((void*)dwParam);
}
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index d0cbe4d8c2..e6b86d244f 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -1030,33 +1030,32 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam) mir_free(pud->text);
mir_free(pud->url);
mir_free(pud);
+ return;
}
+
+ char name[256];
+
+ POPUPDATACLASS ppd = { sizeof(ppd) };
+ ppd.ptszTitle = pud->title;
+ ppd.ptszText = pud->text;
+ ppd.PluginData = pud;
+ ppd.pszClassName = name;
+
+ if (pud->flags & MSN_SHOW_ERROR)
+ mir_snprintf(name, SIZEOF(name), "%s_%s", pud->proto->m_szModuleName, "Error");
+ else if (pud->flags & (MSN_HOTMAIL_POPUP | MSN_ALERT_POPUP))
+ mir_snprintf(name, SIZEOF(name), "%s_%s", pud->proto->m_szModuleName, "Hotmail");
else
- {
- char name[256];
-
- POPUPDATACLASS ppd = { sizeof(ppd) };
- ppd.ptszTitle = pud->title;
- ppd.ptszText = pud->text;
- ppd.PluginData = pud;
- ppd.pszClassName = name;
-
- if (pud->flags & MSN_SHOW_ERROR)
- mir_snprintf(name, SIZEOF(name), "%s_%s", pud->proto->m_szModuleName, "Error");
- else if (pud->flags & (MSN_HOTMAIL_POPUP | MSN_ALERT_POPUP))
- mir_snprintf(name, SIZEOF(name), "%s_%s", pud->proto->m_szModuleName, "Hotmail");
- else
- mir_snprintf(name, SIZEOF(name), "%s_%s", pud->proto->m_szModuleName, "Notify");
+ mir_snprintf(name, SIZEOF(name), "%s_%s", pud->proto->m_szModuleName, "Notify");
- CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd);
- }
+ CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd);
}
void CMsnProto::MSN_ShowPopup(const TCHAR* nickname, const TCHAR* msg, int flags, const char* url, HANDLE hContact)
{
if (Miranda_Terminated()) return;
- PopupData* pud = (PopupData*)mir_alloc(sizeof(PopupData));
+ PopupData *pud = (PopupData*)mir_calloc(sizeof(PopupData));
pud->flags = flags;
pud->url = mir_strdup(url);
pud->title = mir_tstrdup(nickname);
diff --git a/protocols/Tlen/src/jabber_opt.cpp b/protocols/Tlen/src/jabber_opt.cpp index 27075b1d03..485bcf4c72 100644 --- a/protocols/Tlen/src/jabber_opt.cpp +++ b/protocols/Tlen/src/jabber_opt.cpp @@ -577,31 +577,17 @@ static INT_PTR CALLBACK TlenAdvOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, static void MailPopupPreview(DWORD colorBack, DWORD colorText, char *title, char *emailInfo, int delay)
{
- POPUPDATA ppd;
- char * lpzContactName;
- char * lpzText;
- HICON hIcon;
- lpzContactName = title;
- lpzText = emailInfo;
- ZeroMemory(&ppd, sizeof(ppd));
- ppd.lchContact = NULL;
- hIcon = GetIcolibIcon(IDI_MAIL);
+ POPUPDATA ppd = { 0 };
+ HICON hIcon = GetIcolibIcon(IDI_MAIL);
ppd.lchIcon = CopyIcon(hIcon);
ReleaseIcolibIcon(hIcon);
- strcpy(ppd.lpzContactName, lpzContactName);
- strcpy(ppd.lpzText, lpzText);
+ strcpy(ppd.lpzContactName, title);
+ strcpy(ppd.lpzText, emailInfo);
ppd.colorBack = colorBack;
ppd.colorText = colorText;
- ppd.PluginWindowProc = NULL;
- ppd.PluginData=NULL;
- if ( ServiceExists(MS_POPUP_ADDPOPUP)) {
- ppd.iSeconds = delay;
- CallService(MS_POPUP_ADDPOPUP, (WPARAM)&ppd, 0);
-
- }
- else if ( ServiceExists(MS_POPUP_ADDPOPUP)) {
- CallService(MS_POPUP_ADDPOPUP, (WPARAM)&ppd, 0);
- }
+ ppd.iSeconds = delay;
+ if ( ServiceExists(MS_POPUP_ADDPOPUP))
+ PUAddPopUp(&ppd);
}
static INT_PTR CALLBACK TlenPopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/protocols/Xfire/src/tools.cpp b/protocols/Xfire/src/tools.cpp index 626745d3e9..8d16127d26 100644 --- a/protocols/Xfire/src/tools.cpp +++ b/protocols/Xfire/src/tools.cpp @@ -89,12 +89,11 @@ int displayPopup(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType,HICON hi static HICON hicNotify = NULL, hicWarning = NULL, hicError = NULL;
- if ((uType&MB_TYPEMASK) == MB_OK)
- {
- POPUPDATA ppd = {0};
+ if ((uType & MB_TYPEMASK) == MB_OK) {
+ POPUPDATA ppd = { 0 };
+ ppd.lchIcon = hicon;
- if (bIconsNotLoaded)
- {
+ if (bIconsNotLoaded) {
hicNotify = Skin_GetIcon("popup_notify");
hicWarning = Skin_GetIcon("popup_warning");
hicError = Skin_GetIcon("popup_error");
@@ -104,28 +103,22 @@ int displayPopup(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType,HICON hi lstrcpynA(ppd.lpzContactName, lpCaption, sizeof(ppd.lpzContactName));
lstrcpynA(ppd.lpzText, lpText, sizeof(ppd.lpzText));
- if ((uType&MB_ICONMASK) == MB_ICONSTOP)
- {
+ if ((uType & MB_ICONMASK) == MB_ICONSTOP) {
ppd.lchIcon = hicError;
ppd.colorBack = RGB(191,0,0);
ppd.colorText = RGB(255,245,225);
- } else
- if ((uType&MB_ICONMASK) == MB_ICONWARNING)
- {
+ }
+ else if ((uType & MB_ICONMASK) == MB_ICONWARNING) {
ppd.lchIcon = hicWarning;
ppd.colorBack = RGB(210,210,150);
ppd.colorText = RGB(0,0,0);
- } else
- /* if ((uType&MB_ICONMASK) == MB_ICONINFORMATION) */
- {
+ }
+ else {
ppd.lchIcon = hicNotify;
ppd.colorBack = RGB(230,230,230);
ppd.colorText = RGB(0,0,0);
}
- if(hicon!=NULL)
- ppd.lchIcon=hicon;
-
PUAddPopUp(&ppd);
}
|