diff options
Diffstat (limited to 'protocols/Tlen/src')
-rw-r--r-- | protocols/Tlen/src/jabber_opt.cpp | 23 | ||||
-rw-r--r-- | protocols/Tlen/src/jabber_thread.cpp | 44 |
2 files changed, 17 insertions, 50 deletions
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
|