diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/IcqOscarJ/src/icq_popups.cpp | 59 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/init.cpp | 2 | ||||
-rw-r--r-- | protocols/MRA/src/MraPopUp.cpp | 3 | ||||
-rw-r--r-- | protocols/Tlen/src/jabber_opt.cpp | 23 | ||||
-rw-r--r-- | protocols/Tlen/src/jabber_thread.cpp | 44 | ||||
-rw-r--r-- | protocols/Xfire/src/tools.cpp | 4 | ||||
-rw-r--r-- | protocols/Yahoo/src/util.cpp | 2 |
7 files changed, 39 insertions, 98 deletions
diff --git a/protocols/IcqOscarJ/src/icq_popups.cpp b/protocols/IcqOscarJ/src/icq_popups.cpp index fe2337daca..e978f6e5af 100644 --- a/protocols/IcqOscarJ/src/icq_popups.cpp +++ b/protocols/IcqOscarJ/src/icq_popups.cpp @@ -204,13 +204,10 @@ int CIcqProto::ShowPopUpMsg(HANDLE hContact, const char *szTitle, const char *sz {
if (bPopUpService && getSettingByte(NULL, "PopupsEnabled", DEFAULT_POPUPS_ENABLED))
{
- POPUPDATAEX ppd = {0};
- POPUPDATAW ppdw = {0};
+ POPUPDATAT ppd = { 0 };
LPCTSTR rsIcon;
char szPrefix[32], szSetting[32];
-
strcpy(szPrefix, "Popups");
- ppd.iSeconds = 0;
switch(bType) {
case LOG_NOTE:
@@ -254,20 +251,17 @@ int CIcqProto::ShowPopUpMsg(HANDLE hContact, const char *szTitle, const char *sz ppd.lchIcon = Skin_GetIconByHandle(m_hProtoIcon);
else
ppd.lchIcon = (HICON)LoadImage( NULL, rsIcon, IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED);
- if (getSettingByte(NULL, "PopupsWinColors", DEFAULT_POPUPS_WIN_COLORS))
- {
+
+ if (getSettingByte(NULL, "PopupsWinColors", DEFAULT_POPUPS_WIN_COLORS)) {
ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
ppd.colorBack = GetSysColor(COLOR_WINDOW);
}
- else
- {
- if (getSettingByte(NULL, "PopupsDefColors", DEFAULT_POPUPS_DEF_COLORS))
- {
+ else {
+ if (getSettingByte(NULL, "PopupsDefColors", DEFAULT_POPUPS_DEF_COLORS)) {
ppd.colorText = NULL;
ppd.colorBack = NULL;
}
- else
- {
+ else {
strcpy(szSetting, szPrefix);
strcat(szSetting, "TextColor");
ppd.colorText = getSettingDword(NULL, szSetting, ppd.colorText);
@@ -280,36 +274,17 @@ int CIcqProto::ShowPopUpMsg(HANDLE hContact, const char *szTitle, const char *sz strcat(szSetting, "Timeout");
ppd.iSeconds = getSettingDword(NULL, szSetting, ppd.iSeconds);
- // call unicode popup module - only on unicode OS otherwise it will not work properly :(
- // due to Popup Plug bug in ADDPOPUPW implementation
- if ( ServiceExists( MS_POPUP_ADDPOPUPW ))
- {
- char str[4096];
-
- make_unicode_string_static(ICQTranslateUtfStatic(szTitle, str, sizeof(str)), ppdw.lpwzContactName, MAX_CONTACTNAME);
- make_unicode_string_static(ICQTranslateUtfStatic(szMsg, str, sizeof(str)), ppdw.lpwzText, MAX_SECONDLINE);
- ppdw.lchContact = hContact;
- ppdw.lchIcon = ppd.lchIcon;
- ppdw.colorBack = ppd.colorBack;
- ppdw.colorText = ppd.colorText;
- ppdw.PluginWindowProc = NULL;
- ppdw.PluginData = NULL;
- ppdw.iSeconds = ppd.iSeconds;
- return CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&ppdw, 0);
- }
- else
-
- {
- char str[MAX_PATH];
-
- utf8_decode_static(ICQTranslateUtfStatic(szTitle, str, MAX_PATH), ppd.lpzContactName, MAX_CONTACTNAME);
- utf8_decode_static(ICQTranslateUtfStatic(szMsg, str, MAX_PATH), ppd.lpzText, MAX_SECONDLINE);
- ppd.lchContact = hContact;
- ppd.PluginWindowProc = NULL;
- ppd.PluginData = NULL;
-
- return CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)&ppd, 0);
- }
+ char str[4096];
+ make_unicode_string_static( ICQTranslateUtfStatic(szTitle, str, sizeof(str)), ppd.lpwzContactName, MAX_CONTACTNAME);
+ make_unicode_string_static( ICQTranslateUtfStatic(szMsg, str, sizeof(str)), ppd.lpwzText, MAX_SECONDLINE);
+ ppd.lchContact = hContact;
+ ppd.lchIcon = ppd.lchIcon;
+ ppd.colorBack = ppd.colorBack;
+ ppd.colorText = ppd.colorText;
+ ppd.PluginWindowProc = NULL;
+ ppd.PluginData = NULL;
+ ppd.iSeconds = ppd.iSeconds;
+ return PUAddPopUpT(&ppd);
}
return -1; // Failure
}
diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp index 45bbc15bec..a92d3faba1 100644 --- a/protocols/IcqOscarJ/src/init.cpp +++ b/protocols/IcqOscarJ/src/init.cpp @@ -91,7 +91,7 @@ IconItem g_IconsList[4] = int ModuleLoad(WPARAM wParam, LPARAM lParam)
{
- bPopUpService = ServiceExists(MS_POPUP_ADDPOPUPEX) != 0;
+ bPopUpService = ServiceExists(MS_POPUP_ADDPOPUP);
return 0;
}
diff --git a/protocols/MRA/src/MraPopUp.cpp b/protocols/MRA/src/MraPopUp.cpp index d8335d63bd..40f97d82c8 100644 --- a/protocols/MRA/src/MraPopUp.cpp +++ b/protocols/MRA/src/MraPopUp.cpp @@ -128,8 +128,7 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR int CMraProto::OnPopupOptInit(WPARAM wParam, LPARAM lParam)
{
if ( ServiceExists(MS_POPUP_ADDPOPUP)) {
- OPTIONSDIALOGPAGE odp = {0};
- odp.cbSize = sizeof(odp);
+ OPTIONSDIALOGPAGE odp = { sizeof(odp) };
odp.dwInitParam = (LPARAM)this;
odp.position = 100000000;
odp.hInstance = masMraSettings.hInstance;
diff --git a/protocols/Tlen/src/jabber_opt.cpp b/protocols/Tlen/src/jabber_opt.cpp index ff6ea7620f..27075b1d03 100644 --- a/protocols/Tlen/src/jabber_opt.cpp +++ b/protocols/Tlen/src/jabber_opt.cpp @@ -100,21 +100,6 @@ int TlenOptionsInit(void *ptr, WPARAM wParam, LPARAM lParam) odp.ptszTab = tabPages[i].tabName;
Options_AddPage(wParam, &odp);
}
-/*
- if (ServiceExists(MS_POPUP_ADDPOPUP)) {
- ZeroMemory(&odp,sizeof(odp));
- odp.cbSize = sizeof(odp);
- odp.position = 100000000;
- odp.hInstance = hInst;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszGroup = TranslateT("PopUps");
- odp.ptszTitle = proto->m_tszUserName;
- odp.dwInitParam = (LPARAM)proto;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_POPUPS);
- odp.pfnDlgProc = TlenPopupsDlgProc;
- Options_AddPage(wParam, &odp);
- }
-*/
return 0;
}
@@ -592,7 +577,7 @@ static INT_PTR CALLBACK TlenAdvOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, static void MailPopupPreview(DWORD colorBack, DWORD colorText, char *title, char *emailInfo, int delay)
{
- POPUPDATAEX ppd;
+ POPUPDATA ppd;
char * lpzContactName;
char * lpzText;
HICON hIcon;
@@ -609,12 +594,12 @@ static void MailPopupPreview(DWORD colorBack, DWORD colorText, char *title, char ppd.colorText = colorText;
ppd.PluginWindowProc = NULL;
ppd.PluginData=NULL;
- if ( ServiceExists( MS_POPUP_ADDPOPUPEX )) {
+ if ( ServiceExists(MS_POPUP_ADDPOPUP)) {
ppd.iSeconds = delay;
- CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)&ppd, 0);
+ CallService(MS_POPUP_ADDPOPUP, (WPARAM)&ppd, 0);
}
- else if ( ServiceExists( MS_POPUP_ADDPOPUP )) {
+ else if ( ServiceExists(MS_POPUP_ADDPOPUP)) {
CallService(MS_POPUP_ADDPOPUP, (WPARAM)&ppd, 0);
}
}
diff --git a/protocols/Tlen/src/jabber_thread.cpp b/protocols/Tlen/src/jabber_thread.cpp index 36459ac744..d32bd35a32 100644 --- a/protocols/Tlen/src/jabber_thread.cpp +++ b/protocols/Tlen/src/jabber_thread.cpp @@ -1145,41 +1145,23 @@ static void TlenProcessM(XmlNode *node, ThreadData *info) static void TlenMailPopup(TlenProtocol *proto, char *title, char *emailInfo)
{
- POPUPDATAEX ppd;
- char * lpzContactName;
- char * lpzText;
-
- if (!DBGetContactSettingByte(NULL, proto->m_szModuleName, "MailPopupEnabled", TRUE)) {
+ if ( !ServiceExists(MS_POPUP_ADDPOPUP))
return;
- }
- lpzContactName = title;
- lpzText = emailInfo;
- ZeroMemory(&ppd, sizeof(ppd));
- ppd.lchContact = NULL;
+ if (!DBGetContactSettingByte(NULL, proto->m_szModuleName, "MailPopupEnabled", TRUE))
+ return;
+
+ POPUPDATA ppd = { 0 };
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_MAIL));
- strcpy(ppd.lpzContactName, lpzContactName);
- strcpy(ppd.lpzText, lpzText);
+ strcpy(ppd.lpzContactName, title);
+ strcpy(ppd.lpzText, emailInfo);
ppd.colorBack = DBGetContactSettingDword(NULL, proto->m_szModuleName, "MailPopupBack", 0);
ppd.colorText = DBGetContactSettingDword(NULL, proto->m_szModuleName, "MailPopupText", 0);
- ppd.PluginWindowProc = NULL;
- ppd.PluginData=NULL;
- if ( ServiceExists( MS_POPUP_ADDPOPUPEX )) {
- BYTE delayMode;
- int delay;
- delayMode = DBGetContactSettingByte(NULL, proto->m_szModuleName, "MailPopupDelayMode", 0);
- delay = 0;
- if (delayMode==1) {
- delay = DBGetContactSettingDword(NULL, proto->m_szModuleName, "MailPopupDelay", 4);
- } else if (delayMode==2) {
- delay = -1;
- }
- ppd.iSeconds = delay;
- CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)&ppd, 0);
-
- }
- else if ( ServiceExists( MS_POPUP_ADDPOPUP )) {
- CallService(MS_POPUP_ADDPOPUP, (WPARAM)&ppd, 0);
- }
+ BYTE delayMode = DBGetContactSettingByte(NULL, proto->m_szModuleName, "MailPopupDelayMode", 0);
+ if (delayMode == 1)
+ ppd.iSeconds = DBGetContactSettingDword(NULL, proto->m_szModuleName, "MailPopupDelay", 4);
+ else if (delayMode == 2)
+ ppd.iSeconds = -1;
+ PUAddPopUp(&ppd);
}
/*
* Incoming e-mail notification
diff --git a/protocols/Xfire/src/tools.cpp b/protocols/Xfire/src/tools.cpp index c5e6f01e8c..626745d3e9 100644 --- a/protocols/Xfire/src/tools.cpp +++ b/protocols/Xfire/src/tools.cpp @@ -91,7 +91,7 @@ int displayPopup(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType,HICON hi if ((uType&MB_TYPEMASK) == MB_OK)
{
- POPUPDATAEX ppd = {0};
+ POPUPDATA ppd = {0};
if (bIconsNotLoaded)
{
@@ -126,7 +126,7 @@ int displayPopup(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType,HICON hi if(hicon!=NULL)
ppd.lchIcon=hicon;
- PUAddPopUpEx(&ppd);
+ PUAddPopUp(&ppd);
}
return IDOK;
diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp index d0c54de4b4..bfbc5e61e8 100644 --- a/protocols/Yahoo/src/util.cpp +++ b/protocols/Yahoo/src/util.cpp @@ -246,7 +246,7 @@ int CYahooProto::ShowPopup(const TCHAR* nickname, const TCHAR* msg, const char * }
else ppd.lchIcon = LoadIconEx("yahoo");
- DebugLog("[MS_POPUP_ADDPOPUPEX] Generating a popup for [%S] %S", nickname, msg);
+ DebugLog("[MS_POPUP_ADDPOPUP] Generating a popup for [%S] %S", nickname, msg);
PUAddPopUpT(&ppd);
return 1;
|