summaryrefslogtreecommitdiff
path: root/plugins/!NotAdopted/mDynDNS
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2013-04-19 08:09:48 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2013-04-19 08:09:48 +0000
commite5493cf4395d02f0ba59335fadeea4c019d071e6 (patch)
tree8a23cd7ea68d7adcd70c34ebc0ecdb5d95966a69 /plugins/!NotAdopted/mDynDNS
parent4f5319b0b275e8160b0f46f8359cd629f34b71fa (diff)
-mDynDNS - more recent version
git-svn-id: http://svn.miranda-ng.org/main/trunk@4475 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/!NotAdopted/mDynDNS')
-rw-r--r--plugins/!NotAdopted/mDynDNS/changelog.txt17
-rw-r--r--plugins/!NotAdopted/mDynDNS/mDynDNS.cpp990
-rw-r--r--plugins/!NotAdopted/mDynDNS/mDynDNS.h52
-rw-r--r--plugins/!NotAdopted/mDynDNS/mDynDNS_9.vcproj14
-rw-r--r--plugins/!NotAdopted/mDynDNS/resource.h20
-rw-r--r--plugins/!NotAdopted/mDynDNS/resource.rc78
-rw-r--r--plugins/!NotAdopted/mDynDNS/version.h16
7 files changed, 712 insertions, 475 deletions
diff --git a/plugins/!NotAdopted/mDynDNS/changelog.txt b/plugins/!NotAdopted/mDynDNS/changelog.txt
index 28520e660c..c8cc60a6c9 100644
--- a/plugins/!NotAdopted/mDynDNS/changelog.txt
+++ b/plugins/!NotAdopted/mDynDNS/changelog.txt
@@ -1,3 +1,20 @@
+ToDo:
+
+Done: (with the next version available)
+
+mDynDNS: 0.8.1.2
+*** special thanks to Protogenes for his help and tips ***
++ delay for IP check on Miranda start if last check < 10min (requirement by DynDns)
+! fix memory leak
+! rework for MS_NETLIB_REGISTERUSER (Netlib-Log "mDynDNS HTTP connections" is possible)
++ backmx - Non-supporting clients must send NOCHG. (requirement by DynDns)
++ mx - Non-supporting clients must send NOCHG. (requirement by DynDns)
++ wildcard - Non-supporting clients must send NOCHG. (requirement by DynDns)
++ offline - Non-supporting clients must send nothing. (requirement by DynDns)
++ Store IP in DB (Client must not use a DNS query to check a hostname - requirement by DynDns)
+! fix User-Agent string to new pluginName and version
++ updater support for Miranda addon
+
mDynDNS: 0.8.1.1
+ added mDynDNS as 'KnownModules' in database
+ updater support for http://merlins-miranda.googlecode.com
diff --git a/plugins/!NotAdopted/mDynDNS/mDynDNS.cpp b/plugins/!NotAdopted/mDynDNS/mDynDNS.cpp
index 807e755d67..102ce286bb 100644
--- a/plugins/!NotAdopted/mDynDNS/mDynDNS.cpp
+++ b/plugins/!NotAdopted/mDynDNS/mDynDNS.cpp
@@ -2,6 +2,7 @@
Komentarz
*/
#include "mDynDNS.h"
+#include "Windowsx.h"
// Prototypes ///////////////////////////////////////////////////////////////////////////
@@ -20,20 +21,27 @@ PLUGININFOEX pluginInfo={
MIID_MDYNDNS
};
+MM_INTERFACE mmi;
HINSTANCE hInst; //!< Global reference to the application
PLUGINLINK *pluginLink; //!< Link between Miranda and this plugin
-HANDLE hNetlibUser;
+HANDLE hNetlibUser; //!< Netlib Register User
HANDLE hKAThread;
+HICON hDynDnsIcon; //!< DynDNS icon
-BOOL closing = FALSE;
+BOOL closing = FALSE;
+int delay = 10; //!< requirement by DynDns (Client must not query CheckIP more than once every 10 minutes.)
void DoIPCheck();
static BOOL CALLBACK mdyndns_optsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static BOOL CALLBACK DnsPopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+static void DnsPopupPreview(HWND hwndDlg);
unsigned long __stdcall KeepAliveThread(LPVOID param);
void WakeThread(HANDLE hThread);
+void NetlibInit(void);
+void NetlibClose(void);
+static int SystemPShutdown(WPARAM wParam, LPARAM lParam);
static int OnModulesLoaded(WPARAM wParam, LPARAM lParam);
-int mdyndns_options_init(WPARAM wParam, LPARAM lParam);
+static int mdyndns_options_init(WPARAM wParam, LPARAM lParam);
// Functions ////////////////////////////////////////////////////////////////////////////
@@ -76,12 +84,24 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
{
pluginLink = link;
- DWORD tid;
- closing = FALSE;
- hKAThread = CreateThread(0, 0, KeepAliveThread, 0, 0, &tid);
- HookEvent( ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+ mmi.cbSize = sizeof(mmi);
+ mir_getMMI(&mmi);
+ closing = FALSE;
+
+ // set first delay for IP check on miranda start
+ DWORD dwTime, dwDiff, dwLastTs;
+ dwLastTs = DBGetContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_LASTIPCHECK, 0);
+ dwTime = (DWORD)time(0);
+ dwDiff = (dwTime - dwLastTs);
+ if (dwDiff < (DWORD)(delay * 60)) delay = ((delay * 60 - dwDiff + 59) / 60) + delay;
+
+ HookEvent( ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
HookEvent( ME_OPT_INITIALISE, mdyndns_options_init);
+ //HookEvent( ME_SYSTEM_OKTOEXIT, OkToExit);
+ HookEvent( ME_SYSTEM_PRESHUTDOWN, SystemPShutdown);
+ hDynDnsIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_ICON1));
+ //hDynDnsIcon = LoadImage(hInst,MAKEINTRESOURCE(IDI_ICON1),IMAGE_ICON,0,0,LR_DEFAULTSIZE);
return 0;
}
@@ -90,22 +110,40 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
*/
extern "C" int __declspec(dllexport) Unload(void)
{
+ UnhookEvent(SystemPShutdown);
+ DestroyIcon(hDynDnsIcon);
+
+ return 0;
+}
+
+static int SystemPShutdown(WPARAM wParam, LPARAM lParam)
+{
closing = TRUE;
+ UnhookEvent(OnModulesLoaded);
+ UnhookEvent(mdyndns_options_init);
+
+ // close Thread
WakeThread(hKAThread);
WaitForSingleObject(hKAThread, INFINITE);
CloseHandle(hKAThread);
- return 0;
+
+ // Netlib unregister
+ NetlibClose();
+
+ return 0;
}
unsigned long __stdcall KeepAliveThread(LPVOID param)
{
- int delay = 10;
CallService(MS_SYSTEM_THREAD_PUSH, 0, 0);
while(!Miranda_Terminated())
{
- SleepEx(60000, TRUE); //Wait 60sec util first check
+ SleepEx(60000*(delay-9), TRUE); //Wait 60sec util check ( + extra sec on mirandastart)
+ if (closing) break;
+ delay = 10;
DoIPCheck();
- SleepEx(60000*(delay-1), TRUE); //Wait 10 min until next check
+ if (closing) break;
+ SleepEx(60000*(delay-1), TRUE); //Wait 10 min until next check
}
CallService(MS_SYSTEM_THREAD_POP, 0, 0);
return 0;
@@ -113,18 +151,51 @@ unsigned long __stdcall KeepAliveThread(LPVOID param)
void WINAPI NullAPC (DWORD dwData) { }
+void WakeThread(HANDLE hThread)
+{
+ QueueUserAPC(NullAPC, hThread, 0);
+}
+
+// Netlib
+void NetlibInit(void)
+{
+ NETLIBUSER nlu = {0};
+ nlu.cbSize = sizeof(nlu);
+ nlu.szSettingsModule = (char*)PLUGNAME;
+ nlu.szDescriptiveName = Translate("mDynDNS HTTP connections");
+ nlu.flags = NUF_OUTGOING|NUF_HTTPCONNS; //|NUF_NOHTTPSOPTION;
+ hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+}
+
+void NetlibClose(void)
+{
+ Netlib_CloseHandle(hNetlibUser);
+}
+
+// Plugin
static int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
+ // Netlib register
+ NetlibInit();
+
+ // create Thread
+ DWORD tid;
+ hKAThread = CreateThread(0, 0, KeepAliveThread, 0, 0, &tid);
+
// finally register for updater
if(ServiceExists(MS_UPDATE_REGISTER)) {
Update update = {0};
char szVersion[16];
update.cbSize = sizeof(Update);
update.szComponentName = pluginInfo.shortName;
- update.pbVersion = (BYTE *)CreateVersionString(pluginInfo.version, szVersion);
+ update.pbVersion = (BYTE *)CreateVersionStringPluginEx(&pluginInfo, szVersion);
update.cpbVersion = (int)strlen((char *)update.pbVersion);
- update.szUpdateURL = UPDATER_AUTOREGISTER;
+ update.szVersionURL = __FLVersionURL;
+ update.pbVersionPrefix = (BYTE *)__FLVersionPrefix;
+ update.cpbVersionPrefix = (int)strlen((char *)update.pbVersionPrefix);
+ update.szUpdateURL = __FLUpdateURL;
+ // update.szUpdateURL = UPDATER_AUTOREGISTER;
update.szBetaVersionURL = __BetaVersionURL;
// bytes occuring in VersionURL before the version, used to locate the version information within the URL data
@@ -139,82 +210,14 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
}
// install known modules strings to database
DBWriteContactSettingString(NULL, "KnownModules", PLUGNAME, PLUGNAME);
- return 0;
-}
-// Popup
-static void DnsPopupPreview(DWORD colorBack, DWORD colorText, char *title, char *emailInfo, int delay)
-{
- POPUPDATAEX ppd;
- char * lpzContactName;
- char * lpzText;
-
- lpzContactName = title;
- lpzText = emailInfo;
- ZeroMemory(&ppd, sizeof(ppd));
- ppd.lchContact = NULL;
- ppd.lchIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
- lstrcpy(ppd.lpzContactName, lpzContactName);
- lstrcpy(ppd.lpzText, lpzText);
- ppd.colorBack = colorBack;
- ppd.colorText = colorText;
- ppd.PluginWindowProc = NULL;
- ppd.PluginData=NULL;
- if ( ServiceExists( MS_POPUP_ADDPOPUPEX )) {
- ppd.iSeconds = delay;
- CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)&ppd, 0);
- }
- else if ( ServiceExists( MS_POPUP_ADDPOPUP )) {
- CallService(MS_POPUP_ADDPOPUP, (WPARAM)&ppd, 0);
- }
+ return 0;
}
-
-static void DnsPopup(BOOL err,char *mesg)
+static int PluginMenuCommand(WPARAM wParam,LPARAM lParam)
{
- POPUPDATAEX ppd;
- char * lpzContactName;
- int delay = 0;
- BYTE delayMode = 0;
-
- if (!DBGetContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPENAB, TRUE)) {
- return;
- }
-
- if (err && !DBGetContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPUPD, TRUE)) {
- return;
- }
-
- if ( err == TRUE )
- lpzContactName = MDYNDNS_ERROR_TITLE;
- else
- lpzContactName = PLUGNAME;
- ZeroMemory(&ppd, sizeof(ppd));
- ppd.lchContact = NULL;
- ppd.lchIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
- lstrcpy(ppd.lpzContactName, lpzContactName);
- lstrcpy(ppd.lpzText, mesg);
- ppd.colorBack = DBGetContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_POPUPBACK, 0);
- ppd.colorText = DBGetContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_POPUPTEXT, 0);
- ppd.PluginWindowProc = NULL;
- ppd.PluginData=NULL;
- if ( ServiceExists( MS_POPUP_ADDPOPUPEX )) {
- delayMode = DBGetContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPDELM, 0);
- if (delayMode==1) {
- delay = DBGetContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_POPUPDELAY, 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);
- }
+ return 0;
}
-
-
// Options Page : Init
static int mdyndns_options_init(WPARAM wParam, LPARAM lParam)
{
@@ -225,8 +228,8 @@ static int mdyndns_options_init(WPARAM wParam, LPARAM lParam)
odp.cbSize = sizeof(odp);
odp.position = 1003000;
odp.hInstance = hInst;
- odp.pszTemplate = MAKEINTRESOURCE(IDD_OPT_MDYNDNS);
odp.pszGroup = Translate("Services");
+ odp.pszTemplate = MAKEINTRESOURCE(IDD_OPT_MDYNDNS);
odp.pszTitle = title;
odp.pfnDlgProc = mdyndns_optsdlgproc;
odp.flags = ODPF_BOLDGROUPS;
@@ -239,10 +242,10 @@ static int mdyndns_options_init(WPARAM wParam, LPARAM lParam)
odp.hInstance = hInst;
odp.pszGroup = Translate("PopUps");
odp.pszTemplate = MAKEINTRESOURCE(IDD_OPT_POPUPS);
- odp.pszTitle = PLUGNAME;
- odp.flags=ODPF_BOLDGROUPS;
+ odp.pszTitle = title; //PLUGNAME;
odp.pfnDlgProc = DnsPopupsDlgProc;
- odp.nIDBottomSimpleControl = 0;
+ odp.flags=ODPF_BOLDGROUPS;
+ //odp.nIDBottomSimpleControl = 0;
CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
}
@@ -251,60 +254,60 @@ static int mdyndns_options_init(WPARAM wParam, LPARAM lParam)
static BOOL CALLBACK mdyndns_optsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
- case WM_INITDIALOG:
- {
- DBVARIANT dbv;
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ DBVARIANT dbv;
- TranslateDialogDefault(hwndDlg);
- if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_USERNAME, &dbv)) {
- SetDlgItemText(hwndDlg, IDC_USERNAME, dbv.pszVal);
- DBFreeVariant(&dbv);
- }
+ if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_USERNAME, &dbv)) {
+ SetDlgItemText(hwndDlg, IDC_USERNAME, dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
- if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_PASSWORD, &dbv)) {
- CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal) + 1, (LPARAM) dbv.pszVal);
- SetDlgItemText(hwndDlg, IDC_PASSWORD, dbv.pszVal);
- DBFreeVariant(&dbv);
- }
+ if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_PASSWORD, &dbv)) {
+ CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal) + 1, (LPARAM) dbv.pszVal);
+ SetDlgItemText(hwndDlg, IDC_PASSWORD, dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
- if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_DOMAIN, &dbv)) {
- SetDlgItemText(hwndDlg, IDC_DOMAIN, dbv.pszVal);
- DBFreeVariant(&dbv);
- }
- }
- break;
- case WM_COMMAND:
- {
- switch (LOWORD(wParam))
- {
+ if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_DOMAIN, &dbv)) {
+ SetDlgItemText(hwndDlg, IDC_DOMAIN, dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
+ TranslateDialogDefault(hwndDlg);
+ }
+ break;
+ case WM_COMMAND:
+ {
+ switch (LOWORD(wParam))
+ {
case IDC_DOMAIN:
case IDC_USERNAME:
- case IDC_PASSWORD:
- if ((HWND)lParam==GetFocus() && HIWORD(wParam)==EN_CHANGE)
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
+ case IDC_PASSWORD:
+ if ((HWND)lParam==GetFocus() && HIWORD(wParam)==EN_CHANGE)
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
case IDC_CREATEACCOUNT:
- CallService(MS_UTILS_OPENURL, 1, (LPARAM)URL_DYNDNS);
- break;
- default:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)URL_DYNDNS);
+ break;
+ default:
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
}
}
break;
case WM_NOTIFY:
- {
+ {
switch (((LPNMHDR) lParam)->code)
{
case PSN_APPLY:
{
- char str[128];
+ char str[128];
// Write Dyndns username
GetDlgItemText(hwndDlg, IDC_USERNAME, str, sizeof(str));
- DBWriteContactSettingString(NULL, PLUGNAME, MDYNDNS_KEY_USERNAME, str);
+ DBWriteContactSettingString(NULL, PLUGNAME, MDYNDNS_KEY_USERNAME, str);
// Write Dyndns Password
GetDlgItemText(hwndDlg, IDC_PASSWORD, str, sizeof(str));
CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(str), (LPARAM) str);
@@ -315,278 +318,429 @@ static BOOL CALLBACK mdyndns_optsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
}
break;
}
- }
- break;
- }
- return FALSE;
+ }
+ break;
+ }
+ return FALSE;
}
static BOOL CALLBACK DnsPopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg) {
- case WM_INITDIALOG:
- {
- BYTE delayMode;
- TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_ENABLEPOPUP, DBGetContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPENAB, TRUE));
- CheckDlgButton(hwndDlg, IDC_ENABLEUPDATEPOPUP, DBGetContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPUPD, TRUE));
- SendDlgItemMessage(hwndDlg, IDC_COLORBKG, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_POPUPBACK, POPUP_DEFAULT_COLORBKG));
- SendDlgItemMessage(hwndDlg, IDC_COLORTXT, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_POPUPTEXT, POPUP_DEFAULT_COLORTXT));
- SetDlgItemInt(hwndDlg, IDC_DELAY, DBGetContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_POPUPDELAY, 4), FALSE);
- delayMode = DBGetContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPDELM, 0);
- if (delayMode==1) {
- CheckDlgButton(hwndDlg, IDC_DELAY_CUSTOM, TRUE);
- } else if (delayMode==2) {
- CheckDlgButton(hwndDlg, IDC_DELAY_PERMANENT, TRUE);
+ switch (msg)
+ {
+ case WM_INITDIALOG: {
+
+ BYTE delayMode, colorMode;
+ // general
+ CheckDlgButton(hwndDlg, IDC_ENABLEPOPUP, DBGetContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPENAB, TRUE));
+ CheckDlgButton(hwndDlg, IDC_ENABLEUPDATEPOPUP, DBGetContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPUPD, TRUE));
+ // color
+ SendDlgItemMessage(hwndDlg, IDC_COLOR_BKG, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_POPUPBACK, POPUP_DEFAULT_COLORBKG));
+ SendDlgItemMessage(hwndDlg, IDC_COLOR_TXT, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_POPUPTEXT, POPUP_DEFAULT_COLORTXT));
+ colorMode = DBGetContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPCOLM, 0);
+ if (colorMode==1) {
+ CheckDlgButton(hwndDlg, IDC_COLOR_CUSTOM, TRUE);
+ } else {
+ if (colorMode==2) {
+ CheckDlgButton(hwndDlg, IDC_COLOR_OS, TRUE);
} else {
- CheckDlgButton(hwndDlg, IDC_DELAY_POPUP, TRUE);
+ CheckDlgButton(hwndDlg, IDC_COLOR_POPUP, TRUE);
}
- return TRUE;
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BKG), IsDlgButtonChecked(hwndDlg, IDC_COLOR_CUSTOM) == BST_CHECKED ? TRUE : FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_TXT), IsDlgButtonChecked(hwndDlg, IDC_COLOR_CUSTOM) == BST_CHECKED ? TRUE : FALSE);
}
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDC_COLORTXT:
- case IDC_COLORBKG:
- case IDC_ENABLEPOPUP:
- case IDC_ENABLEUPDATEPOPUP:
- case IDC_DELAY:
- case IDC_DELAY_POPUP:
- case IDC_DELAY_CUSTOM:
- case IDC_DELAY_PERMANENT:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case IDC_PREVIEW:
- {
- int delay;
- if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_POPUP)) {
- delay=0;
- } else if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_PERMANENT)) {
- delay=-1;
- } else {
- delay=GetDlgItemInt(hwndDlg, IDC_DELAY, NULL, FALSE);
- }
- DnsPopupPreview((DWORD) SendDlgItemMessage(hwndDlg,IDC_COLORBKG,CPM_GETCOLOUR,0,0),
- (DWORD) SendDlgItemMessage(hwndDlg,IDC_COLORTXT,CPM_GETCOLOUR,0,0),
- PLUGNAME,
- Translate("Your IP on dyndns.org account, has been updated."),
- delay);
- }
-
+ // delay
+ delayMode = DBGetContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPDELM, 0);
+ if (delayMode==1) {
+ CheckDlgButton(hwndDlg, IDC_DELAY_CUSTOM, TRUE);
+ } else if (delayMode==2) {
+ CheckDlgButton(hwndDlg, IDC_DELAY_PERMANENT, TRUE);
+ } else {
+ CheckDlgButton(hwndDlg, IDC_DELAY_POPUP, TRUE);
}
- break;
+ SetDlgItemInt(hwndDlg, IDC_DELAY, DBGetContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_POPUPDELAY, 4), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), IsDlgButtonChecked(hwndDlg, IDC_DELAY_CUSTOM) == BST_CHECKED ? TRUE : FALSE);
+ TranslateDialogDefault(hwndDlg);
+ } // end: case WM_INITDIALOG
+ break;
+ case WM_COMMAND: {
+ switch (LOWORD(wParam)) {
+ case IDC_ENABLEPOPUP:
+ case IDC_ENABLEUPDATEPOPUP:
+ // color
+ case IDC_COLOR_CUSTOM:
+ case IDC_COLOR_TXT:
+ case IDC_COLOR_BKG:
+ case IDC_COLOR_OS:
+ case IDC_COLOR_POPUP:
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BKG), IsDlgButtonChecked(hwndDlg, IDC_COLOR_CUSTOM) == BST_CHECKED ? TRUE : FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_TXT), IsDlgButtonChecked(hwndDlg, IDC_COLOR_CUSTOM) == BST_CHECKED ? TRUE : FALSE);
+ // enable the 'apply' button
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ // delay
+ case IDC_DELAY:
+ if (Edit_GetModify(GetDlgItem(hwndDlg, IDC_DELAY))) {
+ // enable the 'apply' button
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case IDC_DELAY_CUSTOM:
+ case IDC_DELAY_PERMANENT:
+ case IDC_DELAY_POPUP:
+ EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), IsDlgButtonChecked(hwndDlg, IDC_DELAY_CUSTOM) == BST_CHECKED ? TRUE : FALSE);
+ // enable the 'apply' button
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_PREVIEW: {
+ DnsPopupPreview (hwndDlg);
+ } // end: case IDC_PREVIEW:
+ } //end: switch (LOWORD(wParam))
+ } //end: WM_COMMAND
+ break;
- case WM_NOTIFY:
+ case WM_NOTIFY: {
switch (((LPNMHDR) lParam)->code) {
- case PSN_APPLY:
- {
- BYTE delayMode;
- DBWriteContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPENAB, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ENABLEPOPUP));
- DBWriteContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPUPD, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ENABLEUPDATEPOPUP));
- DBWriteContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_POPUPBACK, (DWORD) SendDlgItemMessage(hwndDlg,IDC_COLORBKG,CPM_GETCOLOUR,0,0));
- DBWriteContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_POPUPTEXT, (DWORD) SendDlgItemMessage(hwndDlg,IDC_COLORTXT,CPM_GETCOLOUR,0,0));
- DBWriteContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_POPUPDELAY, (DWORD) GetDlgItemInt(hwndDlg,IDC_DELAY, NULL, FALSE));
- delayMode=0;
+ case PSN_APPLY: {
+ BYTE delayMode, colorMode;
+ // general
+ DBWriteContactSettingByte (NULL, PLUGNAME, MDYNDNS_KEY_POPUPENAB, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ENABLEPOPUP));
+ DBWriteContactSettingByte (NULL, PLUGNAME, MDYNDNS_KEY_POPUPUPD, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ENABLEUPDATEPOPUP));
+ // color
+ DBWriteContactSettingDword (NULL, PLUGNAME, MDYNDNS_KEY_POPUPBACK, (DWORD) SendDlgItemMessage(hwndDlg,IDC_COLOR_BKG,CPM_GETCOLOUR,0,0));
+ DBWriteContactSettingDword (NULL, PLUGNAME, MDYNDNS_KEY_POPUPTEXT, (DWORD) SendDlgItemMessage(hwndDlg,IDC_COLOR_TXT,CPM_GETCOLOUR,0,0));
+ if (IsDlgButtonChecked(hwndDlg, IDC_COLOR_CUSTOM)) {
+ colorMode=1;
+ } else if (IsDlgButtonChecked(hwndDlg, IDC_COLOR_OS)) {
+ colorMode=2;
+ } else {
+ colorMode=0;
+ }
+ DBWriteContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPCOLM, colorMode);
+ // delay
+ DBWriteContactSettingDword (NULL, PLUGNAME, MDYNDNS_KEY_POPUPDELAY,(DWORD) GetDlgItemInt(hwndDlg,IDC_DELAY, NULL, FALSE));
if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_CUSTOM)) {
delayMode=1;
} else if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_PERMANENT)) {
delayMode=2;
-
+ } else {
+ delayMode=0;
}
DBWriteContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPDELM, delayMode);
- return TRUE;
- }
- }
+ } //PSN_APPLY end
+ break;
+ } //switch (((LPNMHDR) lParam)->code): end
+ } //WM_NOTIFY end
+ break;
+ } // switch (msg): end
+ return FALSE;
+}
+
+// Popup
+static void DnsPopupPreview(HWND hwndDlg)
+{
+ POPUPDATAEX ppd;
+
+ ZeroMemory(&ppd, sizeof(ppd));
+ ppd.lchContact = NULL;
+ ppd.PluginWindowProc = NULL;
+ ppd.PluginData=NULL;
+ strcat(ppd.lpzContactName,PLUGNAME);
+ strcat(ppd.lpzText,Translate("Your IP on dyndns.org account, has been updated."));
+ // icon
+ ppd.lchIcon = hDynDnsIcon;
+ //ppd.lchIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ // color
+ if (IsDlgButtonChecked(hwndDlg, IDC_COLOR_CUSTOM)) {
+ ppd.colorBack = SendDlgItemMessage(hwndDlg,IDC_COLOR_BKG,CPM_GETCOLOUR,0,0);
+ ppd.colorText = SendDlgItemMessage(hwndDlg,IDC_COLOR_TXT,CPM_GETCOLOUR,0,0);
+ } else if (IsDlgButtonChecked(hwndDlg, IDC_COLOR_OS)) {
+ ppd.colorBack = GetSysColor(COLOR_BTNFACE);
+ ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
+ } else {
+ ppd.colorBack = ppd.colorText = 0;
+ }
+
+ if ( ServiceExists( MS_POPUP_ADDPOPUPEX )) {
+ if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_CUSTOM)) {
+ ppd.iSeconds = (int) GetDlgItemInt(hwndDlg,IDC_DELAY, NULL, FALSE);
+ } else if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_PERMANENT)) {
+ ppd.iSeconds = -1;
+ } else {
+ ppd.iSeconds = 0;
+ }
+ CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)&ppd, 0);
+ }
+ else if ( ServiceExists( MS_POPUP_ADDPOPUP )) {
+ CallService(MS_POPUP_ADDPOPUP, (WPARAM)&ppd, 0);
+ }
+}
+
+
+static void DnsPopup(BOOL err,char *mesg)
+{
+ POPUPDATAEX ppd;
+ char *lpzContactName;
+
+ if (!DBGetContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPENAB, TRUE)) {
+ return;
+ }
+
+ if (err && !DBGetContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPUPD, TRUE)) {
+ return;
+ }
+
+ if ( err == TRUE )
+ lpzContactName = MDYNDNS_ERROR_TITLE;
+ else
+ lpzContactName = PLUGNAME;
+
+ ZeroMemory(&ppd, sizeof(ppd));
+ ppd.lchContact = NULL;
+ ppd.PluginWindowProc = NULL;
+ ppd.PluginData=NULL;
+ lstrcpy(ppd.lpzContactName, lpzContactName);
+ lstrcpy(ppd.lpzText, mesg);
+ // icon
+ ppd.lchIcon = hDynDnsIcon;
+ //ppd.lchIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ // color
+ switch (DBGetContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPCOLM, 0)) {
+ case MODE_OWN1:
+ ppd.colorBack = DBGetContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_POPUPBACK, 0);
+ ppd.colorText = DBGetContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_POPUPTEXT, 0);
+ break;
+ case MODE_OWN2:
+ ppd.colorBack = GetSysColor(COLOR_BTNFACE);
+ ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
+ break;
+ case MODE_POPUP:
+ default:
+ ppd.colorBack = ppd.colorText = 0;
break;
+ }
+ if ( ServiceExists( MS_POPUP_ADDPOPUPEX )) {
+ // delay (Custom delay time in seconds. -1 means "forever", 0 means "default time")
+ switch (DBGetContactSettingByte(NULL, PLUGNAME, MDYNDNS_KEY_POPUPDELM, 0)) {
+ case MODE_OWN1:
+ ppd.iSeconds = DBGetContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_POPUPDELAY, 4);
+ break;
+ case MODE_OWN2:
+ ppd.iSeconds = -1;
+ break;
+ case MODE_POPUP:
+ default:
+ ppd.iSeconds = 0;
+ break;
+ }
+ CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)&ppd, 0);
+ }
+ else if ( ServiceExists( MS_POPUP_ADDPOPUP )) {
+ CallService(MS_POPUP_ADDPOPUP, (WPARAM)&ppd, 0);
}
- return FALSE;
}
+
+// Error handler
static int PrintError(int err_num)
{
- char *err = "Unknown Error.";
+ char *err = "Unknown Error.";
switch (err_num)
{
//Failed to register NetLib user
case 1:
- err = "Netlib Error.";
- break;
+ err = "Netlib Error.";
+ break;
//Failed to connect with Netlib.
- case 2:
- err = "Netlib Connection Error.";
- break;
- //Error in parsing server response.
- case 3:
- err = "Error in parsing server respose.";
- break;
- case 4:
- err = "Miranda mDynDns plugin has been blocked on server for not following specifications - it won't work anymore :(";
- break;
- case 5:
- err = "The username or password specified in options are incorrect. Please check your account details.";
- break;
- case 6:
- err = "The domain alias specified in options has incorect format. Should be 'yourdomain.dyndns.org'.";
- break;
- case 7:
- err = "The domain alias specified in options does not exist. Please check your account details.";
- break;
- case 8:
- err = "The domain alias specified in options exists, but you are not it's owner.";
- break;
- case 9:
- err = "DNS error encountered.";
- break;
- case 10:
- err = "There is a serious problem with the dyndns.org server";
- break;
- case 11:
- err = "There was a serious problem with updating domain alias to it's previous IP. In order not to get abuse the mDynDns plugin will stop working. To get additional information please refer to the readme.txt.";
- break;
- case 12:
- err = "The specified hostname has been blocked becouse of update abuse. In order not to get situation worse the mDynDns plugin will stop working. To get additional information please refer to the readme.txt.";
- break;
- case 13:
- err = "Due to some errors mDynDNS plugin has been turned off to prevent blocking on server.";
- break;
- default:
- err = "Unknown Error.";
- break;
- }
- err = Translate(err);
+ case 2:
+ err = "Netlib Connection Error.";
+ break;
+ //Error in parsing server response.
+ case 3:
+ err = "Error in parsing server respose.";
+ break;
+ case 4:
+ err = "Miranda mDynDns plugin has been blocked on server for not following specifications - it won't work anymore :(";
+ break;
+ case 5:
+ err = "The username or password specified in options are incorrect. Please check your account details.";
+ break;
+ case 6:
+ err = "The domain alias specified in options has incorect format. Should be 'yourdomain.dyndns.org'.";
+ break;
+ case 7:
+ err = "The domain alias specified in options does not exist. Please check your account details.";
+ break;
+ case 8:
+ err = "The domain alias specified in options exists, but you are not it's owner.";
+ break;
+ case 9:
+ err = "DNS error encountered.";
+ break;
+ case 10:
+ err = "There is a serious problem with the dyndns.org server";
+ break;
+ case 11:
+ err = "There was a serious problem with updating domain alias to it's previous IP. In order not to get abuse the mDynDns plugin will stop working. To get additional information please refer to the readme.txt.";
+ break;
+ case 12:
+ err = "The specified hostname has been blocked becouse of update abuse. In order not to get situation worse the mDynDns plugin will stop working. To get additional information please refer to the readme.txt.";
+ break;
+ case 13:
+ err = "Due to some errors mDynDNS plugin has been turned off to prevent blocking on server.";
+ break;
+ default:
+ err = "Unknown Error.";
+ break;
+ }
+ err = Translate(err);
if(( ServiceExists( MS_POPUP_ADDPOPUPEX )) || ( ServiceExists( MS_POPUP_ADDPOPUP )))
- DnsPopup(TRUE, err);
- else
- MessageBox(NULL,err,MDYNDNS_ERROR_TITLE,MB_OK);
+ DnsPopup(TRUE, err);
+ else
+ MessageBox(NULL,err,MDYNDNS_ERROR_TITLE,MB_OK);
return 1;
}
+// DynDNS stuff
char *GetHostIP(char *name)
{
- static char Ip[17];
- char hostname[25];
- WSADATA wsaData;
- struct hostent *pHostEnt;
- struct sockaddr_in tmpSockAddr;
+ DBVARIANT dbv;
+ char *Ip = (char*)malloc(17); //static char Ip[17];
+ // get IP from DB
+ if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_LASTIP, &dbv)) {
+ strcpy(Ip,dbv.pszVal);
+ DBFreeVariant(&dbv);
+ return Ip;
+ }
+ // get IP from DNS query if no IP store in DB
+ char hostname[25];
+ WSADATA wsaData;
+ struct hostent *pHostEnt;
+ struct sockaddr_in tmpSockAddr;
char FAR *pszIp;
- WSAStartup(MAKEWORD(2,0),&wsaData);
- strcpy(hostname,name);
- pHostEnt = gethostbyname(hostname);
- if(!pHostEnt)
- {
- PrintError(2);
- return MDYNDNS_ERROR_CODE;
- }
- memcpy(&tmpSockAddr.sin_addr,pHostEnt->h_addr,pHostEnt->h_length);
- pszIp = inet_ntoa(tmpSockAddr.sin_addr);
- if (!pszIp) PrintError(5);
- else strcpy (Ip, pszIp);
- WSACleanup();
- return Ip;
+ WSAStartup(MAKEWORD(2,0),&wsaData);
+ strcpy(hostname,name);
+ pHostEnt = gethostbyname(hostname);
+ if(!pHostEnt){
+ PrintError(2);
+ strcpy (Ip, (char*)MDYNDNS_ERROR_CODE);
+ return Ip;
+ }
+ memcpy(&tmpSockAddr.sin_addr,pHostEnt->h_addr,pHostEnt->h_length);
+ pszIp = inet_ntoa(tmpSockAddr.sin_addr);
+ if (!pszIp) PrintError(5);
+ else strcpy (Ip, pszIp);
+ WSACleanup();
+ DBWriteContactSettingString(NULL, PLUGNAME, MDYNDNS_KEY_LASTIP, Ip);
+ return Ip;
}
void Block_plugin(BOOL blok)
{
- if(blok == TRUE)
- DBWriteContactSettingString(NULL, PLUGNAME, MDYNDNS_KEY_BLOCKED, MDYNDNS_BLOCK_CODE);
- else
- DBWriteContactSettingString(NULL, PLUGNAME, MDYNDNS_KEY_BLOCKED, MDYNDNS_UNBLOCK_CODE);
+ if(blok == TRUE)
+ DBWriteContactSettingString(NULL, PLUGNAME, MDYNDNS_KEY_BLOCKED, MDYNDNS_BLOCK_CODE);
+ else
+ DBWriteContactSettingString(NULL, PLUGNAME, MDYNDNS_KEY_BLOCKED, MDYNDNS_UNBLOCK_CODE);
}
void UpdateIP(char *ip_num)
{
- DBVARIANT dbv;
- NETLIBBASE64 nlb64;
- NETLIBHTTPREQUEST nlhr, *nlreply;
- NETLIBUSER nlu = { 0 };
- NETLIBHTTPHEADER headers[4];
+ DBVARIANT dbv;
+ NETLIBBASE64 nlb64;
+ NETLIBHTTPREQUEST nlhr = {0};
+ NETLIBHTTPREQUEST *nlreply;
+
char szUrl[500] = "";
- int ip1 = 0, ip2 = 0, ip3 = 0, ip4 = 0, count;
+ int ip1 = 0, ip2 = 0, ip3 = 0, ip4 = 0, count;
char username[64] = "";
char passwd[64] = "";
char domain[128] = "";
char str[128] = "";
char encd[128] = "";
char auth[150] = "";
- char newip[128] = "";
+ char newip[128] = "";
char return_code[256] = "";
char *notf = "";
-
- if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_USERNAME, &dbv))
- {
- strcpy(username,dbv.pszVal);
- DBFreeVariant(&dbv);
- }
- else
- return;
+ char szAgent[100] = "";
+ char szVersion[16];
- if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_PASSWORD, &dbv))
- {
- CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal) + 1, (LPARAM) dbv.pszVal);
- strcpy(passwd,dbv.pszVal);
- DBFreeVariant(&dbv);
- }
- else
- return;
+ if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_USERNAME, &dbv))
+ {
+ strcpy(username,dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
+ else
+ return;
- if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_DOMAIN, &dbv))
- {
- strcpy(domain,dbv.pszVal);
- DBFreeVariant(&dbv);
- }
- else
- return;
-
- count = sscanf(ip_num , "%d.%d.%d.%d", &ip1, &ip2, &ip3, &ip4);
- if (count != 4 || ip1 <= 0 || ip1 > 255 || ip2 < 0 || ip2 > 255 ||
- ip3 < 0 || ip3 > 255 || ip4 < 0 || ip4 > 255 )
- return;
-
- strcat(str, username);
+ if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_PASSWORD, &dbv))
+ {
+ CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal) + 1, (LPARAM) dbv.pszVal);
+ strcpy(passwd,dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
+ else
+ return;
+
+ if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_DOMAIN, &dbv))
+ {
+ strcpy(domain,dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
+ else
+ return;
+
+ count = sscanf(ip_num , "%d.%d.%d.%d", &ip1, &ip2, &ip3, &ip4);
+ if (count != 4 || ip1 <= 0 || ip1 > 255 || ip2 < 0 || ip2 > 255 ||
+ ip3 < 0 || ip3 > 255 || ip4 < 0 || ip4 > 255 )
+ return;
+
+ strcat(str, username);
strcat(str, ":");
strcat(str, passwd);
-
- nlb64.pbDecoded = (PBYTE) str;
- nlb64.cbDecoded = strlen(str);
- nlb64.pszEncoded = encd;
- nlb64.cchEncoded = 128;
- (HANDLE) CallService(MS_NETLIB_BASE64ENCODE, 0, (LPARAM)(NETLIBBASE64*)&nlb64);
-
- strcat(auth, "Basic ");
- strcat(auth, encd);
-
+
+ nlb64.pbDecoded = (PBYTE) str;
+ nlb64.cbDecoded = strlen(str);
+ nlb64.pszEncoded = encd;
+ nlb64.cchEncoded = 128;
+ (HANDLE) CallService(MS_NETLIB_BASE64ENCODE, 0, (LPARAM)(NETLIBBASE64*)&nlb64);
+
+ strcat(auth, "Basic ");
+ strcat(auth, encd);
+
strcat(szUrl,"http://members.dyndns.org/nic/update?");
- strcat(szUrl,"&hostname=");
+ strcat(szUrl,"hostname=");
strcat(szUrl,domain);
strcat(szUrl,"&myip=");
strcat(szUrl,ip_num);
-
- nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS;
- nlu.szSettingsModule = SETTINGS_MODULE;
- nlu.szDescriptiveName = DESCRIPTIVE_NAME;
- hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) & nlu);
-
- headers[0].szName = "User-Agent";
- headers[0].szValue = "MirandaIM (mDynDns plugin/0.0.1.0)";
- headers[1].szName="Host";
- headers[1].szValue="members.dyndns.org";
- headers[2].szName="Authorization";
- headers[2].szValue = auth;
-
- ZeroMemory(&nlhr, sizeof(nlhr));
- nlhr.cbSize = sizeof(nlhr);
- nlhr.requestType = REQUEST_GET;
- nlhr.flags = NLHRF_DUMPASTEXT;
- nlhr.szUrl = szUrl;
- nlhr.headersCount = 3;
- nlhr.headers = headers;
-
- nlreply = (NETLIBHTTPREQUEST *) CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM) hNetlibUser, (LPARAM) & nlhr);
+ strcat(szUrl,"&wildcard=NOCHG");
+ strcat(szUrl,"&mx=NOCHG");
+ strcat(szUrl,"&backmx=NOCHG");
+
+ strcat(szAgent,"MirandaIM - ");
+ strcat(szAgent,__PLUGIN_NAME);
+ strcat(szAgent," plugin - ");
+ strcat(szAgent,CreateVersionStringPluginEx(&pluginInfo, szVersion));
+
+ // initialize the netlib request
+ nlhr.cbSize = sizeof(nlhr);
+ nlhr.requestType = REQUEST_GET;
+ nlhr.flags = NLHRF_DUMPASTEXT;
+ nlhr.szUrl = (char*)szUrl;
+ nlhr.headersCount = 3;
+ nlhr.headers=(NETLIBHTTPHEADER*)mir_alloc(sizeof(NETLIBHTTPHEADER)*nlhr.headersCount);
+ nlhr.headers[0].szName = "Host";
+ nlhr.headers[0].szValue = "members.dyndns.org";
+ nlhr.headers[1].szName = "Authorization";
+ nlhr.headers[1].szValue = auth; //Basic base-64-authorization
+ nlhr.headers[2].szName = "User-Agent";
+ nlhr.headers[2].szValue = szAgent; //__USER_AGENT_STRING;
+
+ nlreply = (NETLIBHTTPREQUEST *) CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM) hNetlibUser, (LPARAM) & nlhr);
if( nlreply )
{
if( nlreply->resultCode >= 200 && nlreply->resultCode < 300 )
@@ -599,9 +753,10 @@ void UpdateIP(char *ip_num)
PrintError(5);
if (strncmp (return_code,"good",4) == 0)
{
- notf = "Your IP on dyndns.org account, has been updated.";
- notf = Translate(notf) ;
- DnsPopup(FALSE,notf);
+ DBWriteContactSettingString(NULL, PLUGNAME, MDYNDNS_KEY_LASTIP, ip_num);
+ notf = "Your IP on dyndns.org account, has been updated.";
+ notf = Translate(notf) ;
+ DnsPopup(FALSE,notf);
}
if (strncmp (return_code,"nochg",5) == 0)
{
@@ -626,99 +781,106 @@ void UpdateIP(char *ip_num)
}
CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM) nlreply);
}
- Netlib_CloseHandle(hNetlibUser);
+ mir_free(nlhr.headers);
}
char *GetExternIP()
{
+ if( !hNetlibUser ) {
+ PrintError(1);
+ return 0;
+ }
+ char szAgent[100] = "";
+ char szVersion[16];
+ char *ip_str = (char*)malloc(17);
+ char szUrl[ 500 ] = DYN_DNS_SERVER;
int ip1 = 0, ip2 = 0, ip3 = 0, ip4 = 0, count;
- NETLIBHTTPREQUEST nlhr, *nlreply;
+ bool result = FALSE;
+ NETLIBHTTPREQUEST nlhr = {0};
+ NETLIBHTTPREQUEST *nlreply;
ZeroMemory(&nlhr, sizeof(nlhr));
- char szUrl[ 500 ] = DYN_DNS_SERVER;
- char *ip_str = (char*)malloc(17);
- nlhr.cbSize = sizeof(nlhr);
- nlhr.requestType = REQUEST_GET;
- nlhr.flags = NLHRF_DUMPASTEXT;
- nlhr.szUrl = (char*)szUrl;
- NETLIBUSER nlu = { 0 };
- nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS;
- nlu.szSettingsModule = SETTINGS_MODULE;
- nlu.szDescriptiveName = DESCRIPTIVE_NAME;
-
- hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) & nlu);
- if( !hNetlibUser ) {PrintError(1); return 0;}
- nlreply = (NETLIBHTTPREQUEST *) CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM) hNetlibUser, (LPARAM) & nlhr);
- if( nlreply && nlreply->resultCode >= 200 && nlreply->resultCode < 300 )
- {
+
+ strcat(szAgent,"MirandaIM - ");
+ strcat(szAgent,__PLUGIN_NAME);
+ strcat(szAgent," plugin - ");
+ strcat(szAgent,CreateVersionStringPluginEx(&pluginInfo, szVersion));
+
+ // initialize the netlib request
+ nlhr.cbSize = sizeof(nlhr);
+ nlhr.requestType = REQUEST_GET;
+ nlhr.flags = NLHRF_DUMPASTEXT;
+ nlhr.szUrl = (char*)szUrl;
+ nlhr.headersCount = 1;
+ nlhr.headers=(NETLIBHTTPHEADER*)mir_alloc(sizeof(NETLIBHTTPHEADER)*nlhr.headersCount);
+ nlhr.headers[0].szName = "User-Agent";
+ nlhr.headers[0].szValue = szAgent;
+
+ nlreply = (NETLIBHTTPREQUEST *) CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM) hNetlibUser, (LPARAM) &nlhr);
+ if( nlreply && nlreply->resultCode >= 200 && nlreply->resultCode < 300 ) {
nlreply->pData[nlreply->dataLength] = 0;// make sure its null terminated
count = sscanf(nlreply->pData , RESPONSE_PATTERN, &ip1, &ip2, &ip3, &ip4);
- if (count != 4 || ip1 <= 0 || ip1 > 255 || ip2 < 0 || ip2 > 255 ||
- ip3 < 0 || ip3 > 255 || ip4 < 0 || ip4 > 255 )
- {PrintError(3); return 0;}
- sprintf(ip_str, "%d.%d.%d.%d", ip1, ip2, ip3, ip4);
+ if (count != 4 || ip1 <= 0 || ip1 > 255 || ip2 < 0 || ip2 > 255 || ip3 < 0 || ip3 > 255 || ip4 < 0 || ip4 > 255 ){
+ PrintError(3);
+ }
+ else {
+ sprintf(ip_str, "%d.%d.%d.%d", ip1, ip2, ip3, ip4);
+ result = TRUE;
+ }
}
- else {PrintError(2); return 0;}
-
- CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM) nlreply);
- Netlib_CloseHandle(hNetlibUser);
- return ip_str;
+ else {
+ PrintError(2);
+ }
+ DBWriteContactSettingDword(NULL, PLUGNAME, MDYNDNS_KEY_LASTIPCHECK, (DWORD)time(0));
+ mir_free(nlhr.headers);
+ if (!result) free(ip_str);
+ if (nlreply) CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM) nlreply);
+ return result ? ip_str : 0;
}
void DoIPCheck()
-{
- DBVARIANT dbv;
- char blok[3] = "";
- char *myIP = "";
- char *myExtIP = "";
- char *notf = "";
+{
+ DBVARIANT dbv;
+ char blok[3] = "";
+ char *myIP = "";
+ char *myExtIP = "";
+ char *notf = "";
char domain[128] = "";
- if (closing == TRUE)
- return ;
-
- if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_DOMAIN, &dbv))
- {
- strcpy(domain,dbv.pszVal);
- DBFreeVariant(&dbv);
- }
- else
- return;
-
- if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_BLOCKED, &dbv))
- {
- strcpy(blok,dbv.pszVal);
- DBFreeVariant(&dbv);
- if(blok == MDYNDNS_BLOCK_CODE)
- {
- PrintError(13);
- return;
- }
- }
-
- myIP = GetHostIP(domain);
- if(myIP && (blok != MDYNDNS_BLOCK_CODE) && (myIP != MDYNDNS_ERROR_CODE))
- {
- myExtIP = GetExternIP();
- if(myExtIP)
- {
- if(strncmp(myIP,myExtIP,15) == 0 )
- { ;} //Do nothing
- else
- UpdateIP(myExtIP);
- free(myExtIP);
- }
- free(myIP);
- }
-}
+ if (closing == TRUE){
+ return ;
+ }
+ if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_DOMAIN, &dbv)) {
+ strcpy(domain,dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
+ else {
+ return ;
+ }
+ if (!DBGetContactSetting(NULL, PLUGNAME, MDYNDNS_KEY_BLOCKED, &dbv)) {
+ strcpy(blok,dbv.pszVal);
+ DBFreeVariant(&dbv);
+ if(blok == MDYNDNS_BLOCK_CODE){
+ PrintError(13);
+ return ;
+ }
+ }
-static int PluginMenuCommand(WPARAM wParam,LPARAM lParam)
-{
- return 0;
+ myIP = GetHostIP(domain);
+ if(myIP && (blok != MDYNDNS_BLOCK_CODE) && (myIP != MDYNDNS_ERROR_CODE)){
+ myExtIP = GetExternIP();
+ if(myExtIP){
+ if(strncmp(myIP,myExtIP,15) == 0 ){
+ ; //Do nothing
+ }
+ else {
+ UpdateIP(myExtIP);
+ }
+ free(myExtIP);
+ }
+ }
+ if(myIP) free(myIP);
}
-void WakeThread(HANDLE hThread)
-{
- QueueUserAPC(NullAPC, hThread, 0);
-}
+
+
diff --git a/plugins/!NotAdopted/mDynDNS/mDynDNS.h b/plugins/!NotAdopted/mDynDNS/mDynDNS.h
index f083067400..c699e27f20 100644
--- a/plugins/!NotAdopted/mDynDNS/mDynDNS.h
+++ b/plugins/!NotAdopted/mDynDNS/mDynDNS.h
@@ -1,7 +1,6 @@
// Windows includes
#include <windows.h>
-//#include <winsock2.h>
// Standard includes
#include <stdio.h>
@@ -28,29 +27,34 @@
#include "resource.h"
#include "version.h"
-#define POPUP_DEFAULT_COLORBKG 0xDCBDA5
-#define POPUP_DEFAULT_COLORTXT 0x000000
-
-#define RESPONSE_PATTERN "<html><head><title>Current IP Check</title></head><body>Current IP Address: %d.%d.%d.%d</body></html>"
-#define SETTINGS_MODULE "mDynDNS.dll"
-#define DESCRIPTIVE_NAME "DynDNS Plugin"
-#define MDYNDNS_ERROR_TITLE "mDynDns - Error"
-#define MDYNDNS_ERROR_CODE "F"
-#define MDYNDNS_BLOCK_CODE "Yes"
-#define MDYNDNS_UNBLOCK_CODE "No"
-#define DYN_DNS_SERVER "http://checkip.dyndns.org"
-#define URL_DYNDNS "https://www.dyndns.com/account/create.html"
-#define MDYNDNS_KEY_USERNAME "Username"
-#define MDYNDNS_KEY_PASSWORD "Password"
-#define MDYNDNS_KEY_DOMAIN "Domain"
-#define MDYNDNS_KEY_POPUPENAB "PopupEnabled"
-#define MDYNDNS_KEY_POPUPUPD "UpdatePopupsEnabled"
-#define MDYNDNS_KEY_POPUPBACK "PopupBack"
-#define MDYNDNS_KEY_POPUPTEXT "PopupText"
-#define MDYNDNS_KEY_POPUPDELAY "PopupDelay"
-#define MDYNDNS_KEY_POPUPDELM "PopupDelayMode"
-#define MDYNDNS_KEY_BLOCKED "Blocked"
-#define MDYNDNS_KEY_UPDATETIME "UpdateTime"
+#define MODE_POPUP 0
+#define MODE_OWN1 1
+#define MODE_OWN2 2
+#define POPUP_DEFAULT_COLORBKG 0xFFFFFF //0xDCBDA5
+#define POPUP_DEFAULT_COLORTXT 0x000000
+
+#define URL_DYNDNS "https://www.dyndns.com/account/create.html"
+#define DYN_DNS_SERVER "http://checkip.dyndns.org"
+#define RESPONSE_PATTERN "<html><head><title>Current IP Check</title></head><body>Current IP Address: %d.%d.%d.%d</body></html>"
+#define MDYNDNS_ERROR_TITLE "mDynDns - Error"
+#define MDYNDNS_ERROR_CODE "F"
+#define MDYNDNS_BLOCK_CODE "Yes"
+#define MDYNDNS_UNBLOCK_CODE "No"
+#define MDYNDNS_KEY_USERNAME "Username"
+#define MDYNDNS_KEY_PASSWORD "Password"
+#define MDYNDNS_KEY_DOMAIN "Domain"
+#define MDYNDNS_KEY_POPUPENAB "PopupEnabled"
+#define MDYNDNS_KEY_POPUPUPD "UpdatePopupsEnabled"
+#define MDYNDNS_KEY_POPUPBACK "PopupBack"
+#define MDYNDNS_KEY_POPUPTEXT "PopupText"
+#define MDYNDNS_KEY_POPUPDELAY "PopupDelay"
+#define MDYNDNS_KEY_POPUPDELM "PopupDelayMode"
+#define MDYNDNS_KEY_POPUPCOLM "PopupColorMode"
+#define MDYNDNS_KEY_BLOCKED "Blocked"
+#define MDYNDNS_KEY_UPDATETIME "UpdateTime"
+#define MDYNDNS_KEY_LASTIP "LastIP"
+#define MDYNDNS_KEY_LASTIPCHECK "LastCheckTS"
+
#ifndef MIID_MDYNDNS
#define MIID_MDYNDNS { 0x91e005c7, 0x8760, 0x479f, { 0xa2, 0xc9, 0x1c, 0x9e, 0x31, 0x7, 0x20, 0x1c } } // {91E005C7-8760-479f-A2C9-1C9E3107201C}
diff --git a/plugins/!NotAdopted/mDynDNS/mDynDNS_9.vcproj b/plugins/!NotAdopted/mDynDNS/mDynDNS_9.vcproj
index a13e8d1f6a..0fd9eeb46b 100644
--- a/plugins/!NotAdopted/mDynDNS/mDynDNS_9.vcproj
+++ b/plugins/!NotAdopted/mDynDNS/mDynDNS_9.vcproj
@@ -193,6 +193,10 @@
RelativePath=".\mDynDNS.h"
>
</File>
+ <File
+ RelativePath=".\version.h"
+ >
+ </File>
</Filter>
<Filter
Name="Resource Files"
@@ -204,15 +208,15 @@
>
</File>
<File
- RelativePath=".\resource.h"
+ RelativePath=".\dyndns.ico"
>
</File>
<File
- RelativePath=".\resource.rc"
+ RelativePath=".\resource.h"
>
</File>
<File
- RelativePath=".\version.h"
+ RelativePath=".\resource.rc"
>
</File>
<File
@@ -228,6 +232,10 @@
RelativePath=".\readme.txt"
>
</File>
+ <File
+ RelativePath=".\resource."
+ >
+ </File>
</Files>
<Globals>
</Globals>
diff --git a/plugins/!NotAdopted/mDynDNS/resource.h b/plugins/!NotAdopted/mDynDNS/resource.h
index f859cc03bf..27ce8e8fd7 100644
--- a/plugins/!NotAdopted/mDynDNS/resource.h
+++ b/plugins/!NotAdopted/mDynDNS/resource.h
@@ -4,10 +4,13 @@
//
#define IDOK 1
#define IDCANCEL 2
-#define __BUILD_NUM 2
#define IDCLOSE 8
#define IDCONTINUE 11
#define IDB_DynDNS 103
+#define IDI_ONLINE 104
+#define IDI_OFFLINE 105
+#define IDI_NA 131
+#define IDI_OCCUPIED 159
#define IDD_OPT_MDYNDNS 301
#define IDC_USERNAME 302
#define IDC_PASSWORD 303
@@ -18,21 +21,24 @@
#define IDC_DELAY_CUSTOM 308
#define IDC_DELAY_PERMANENT 309
#define IDC_DELAY 310
-#define IDC_COLORBKG 311
-#define IDC_COLORTXT 312
#define IDC_PREVIEW 313
#define IDC_ENABLEPOPUP 314
#define IDC_ENABLEUPDATEPOPUP 315
#define IDC_DynDNS 316
-#define IDC_STATIC -1
+#define IDC_COLOR_CUSTOM 321
+#define IDC_COLOR_BKG 322
+#define IDC_COLOR_TXT 323
+#define IDC_COLOR_OS 324
+#define IDC_COLOR_POPUP 325
+#define IDI_ICON1 1000
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 105
+#define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1000
-#define _APS_NEXT_SYMED_VALUE 103
+#define _APS_NEXT_CONTROL_VALUE 1003
+#define _APS_NEXT_SYMED_VALUE 111
#endif
#endif
diff --git a/plugins/!NotAdopted/mDynDNS/resource.rc b/plugins/!NotAdopted/mDynDNS/resource.rc
index ae0cdac0d6..685e8d8062 100644
--- a/plugins/!NotAdopted/mDynDNS/resource.rc
+++ b/plugins/!NotAdopted/mDynDNS/resource.rc
@@ -8,7 +8,6 @@
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
-
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -43,25 +42,28 @@ BEGIN
CONTROL 103,IDC_DynDNS,"Static",SS_BITMAP,26,20,95,18,WS_EX_TRANSPARENT
END
-IDD_OPT_POPUPS DIALOG 0, 0, 317, 141
+IDD_OPT_POPUPS DIALOGEX 0, 0, 313, 187
STYLE DS_SETFONT | WS_CHILD
-FONT 8, "MS Sans Serif"
+FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
- GROUPBOX "Delay",IDC_STATIC,160,46,137,55
- CONTROL "&From PopUp plugin",IDC_DELAY_POPUP,"Button",BS_AUTORADIOBUTTON,167,60,125,10
- CONTROL "&Custom",IDC_DELAY_CUSTOM,"Button",BS_AUTORADIOBUTTON,167,73,98,10
- CONTROL "P&ermanent",IDC_DELAY_PERMANENT,"Button",BS_AUTORADIOBUTTON,167,87,123,10
- EDITTEXT IDC_DELAY,270,71,21,14,ES_AUTOHSCROLL | ES_NUMBER
- GROUPBOX "Colours",IDC_STATIC,15,46,137,55
- LTEXT "Background",IDC_STATIC,53,63,95,8
- LTEXT "Text",IDC_STATIC,53,82,96,8
- CONTROL "",IDC_COLORBKG,"ColourPicker",WS_TABSTOP,23,61,24,12
- GROUPBOX "General Options",IDC_STATIC,15,1,282,40
- CONTROL "",IDC_COLORTXT,"ColourPicker",WS_TABSTOP,23,79,24,12
- PUSHBUTTON "Preview",IDC_PREVIEW,132,112,50,14
- CONTROL "Enable error popups",IDC_ENABLEPOPUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,13,267,10
+ GROUPBOX "General Options",IDC_STATIC,5,4,301,40
+ CONTROL "Enable error popups",IDC_ENABLEPOPUP,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,13,16,267,10
CONTROL "Enable updating notification",IDC_ENABLEUPDATEPOPUP,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,26,267,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,29,267,10
+ GROUPBOX "Delay",IDC_STATIC,159,47,147,69
+ CONTROL "&Custom",IDC_DELAY_CUSTOM,"Button",BS_AUTORADIOBUTTON,167,66,87,10
+ CONTROL "&From PopUp plugin",IDC_DELAY_POPUP,"Button",BS_AUTORADIOBUTTON,167,96,131,10
+ CONTROL "P&ermanent",IDC_DELAY_PERMANENT,"Button",BS_AUTORADIOBUTTON,167,81,131,10
+ EDITTEXT IDC_DELAY,268,64,21,12,ES_AUTOHSCROLL | ES_NUMBER
+ GROUPBOX "Colours",IDC_STATIC,5,47,147,69
+ LTEXT "Back Color",IDC_STATIC,60,54,39,8
+ LTEXT "Text Color",IDC_STATIC,104,54,39,8
+ CONTROL "",IDC_COLOR_BKG,"ColourPicker",WS_TABSTOP,59,64,39,12
+ CONTROL "",IDC_COLOR_TXT,"ColourPicker",WS_TABSTOP,103,64,39,12
+ CONTROL "Use",IDC_COLOR_CUSTOM,"Button",BS_AUTORADIOBUTTON,13,66,43,10
+ CONTROL "Use default colours",IDC_COLOR_POPUP,"Button",BS_AUTORADIOBUTTON,13,96,131,10
+ CONTROL "&Use Windows colors",IDC_COLOR_OS,"Button",BS_AUTORADIOBUTTON,13,81,131,10
+ PUSHBUTTON "Preview",IDC_PREVIEW,209,166,50,14
END
@@ -73,13 +75,19 @@ END
1 TEXTINCLUDE
BEGIN
- "resource.\0"
+ "resource.h\0"
END
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
3 TEXTINCLUDE
BEGIN
- "\r\0"
+ "\r\n"
+ "\0"
END
#endif // APSTUDIO_INVOKED
@@ -91,18 +99,40 @@ END
//
IDB_DynDNS BITMAP "dyndns.bmp"
-#endif // Deutsch (Deutschland) resources
+
/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_OPT_POPUPS, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 306
+ VERTGUIDE, 13
+ VERTGUIDE, 167
+ BOTTOMMARGIN, 180
+ HORZGUIDE, 4
+ HORZGUIDE, 47
+ HORZGUIDE, 76
+ HORZGUIDE, 106
+ END
+END
+#endif // APSTUDIO_INVOKED
-#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
-// Generated from the TEXTINCLUDE 3 resource.
+// Icon
//
-
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_ICON1 ICON "dyndns.ico"
+#endif // Deutsch (Deutschland) resources
/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/!NotAdopted/mDynDNS/version.h b/plugins/!NotAdopted/mDynDNS/version.h
index 4934854871..5e544df596 100644
--- a/plugins/!NotAdopted/mDynDNS/version.h
+++ b/plugins/!NotAdopted/mDynDNS/version.h
@@ -1,14 +1,15 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 8
#define __RELEASE_NUM 1
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
#define __STRINGIFY(x) #x
#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS)
-#define PLUGNAME "mDynDNS"
+#define __USER_AGENT_STRING "MirandaIM - mDynDns plugin - "__MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
+
#define __FILENAME "mDynDNS.dll"
#define __DESC "Alows user to update his IP on DynDNS server."
#define __AUTHOR "Kirsen, Merlin"
@@ -16,13 +17,22 @@
#define __COPYRIGHT "© 2006 Kirsen, © 2009 Merlin"
#define __AUTHORWEB "http://code.google.com/p/merlins-miranda"
+#define PLUGNAME "mDynDNS"
#ifdef _UNICODE
#define __PLUGIN_NAME PLUGNAME" (Unicode)"
- __BetaUpdateURL "http://merlins-miranda.googlecode.com/files/mDynDNS.zip"
+#define __FLVersionURL "http://addons.miranda-im.org/details.php?action=viewfile&id=4075"
+#define __FLVersionPrefix "<span class=\"fileNameHeader\">mDynDNS (Unicode) "
+#define __FLUpdateURL "http://addons.miranda-im.org/feed.php?dlfile=4075"
+#define __BetaUpdateURL "http://merlins-miranda.googlecode.com/files/mDynDNSW.zip"
#else
#define __PLUGIN_NAME PLUGNAME" (2in1)"
+#define __FLVersionURL "http://addons.miranda-im.org/details.php?action=viewfile&id=4075"
+#define __FLVersionPrefix "<span class=\"fileNameHeader\">mDynDNS (2in1) "
+#define __FLUpdateURL "http://addons.miranda-im.org/feed.php?dlfile=4075"
#define __BetaUpdateURL "http://merlins-miranda.googlecode.com/files/mDynDNS.zip"
#endif
+
#define __BetaVersionURL "http://merlins-miranda.googlecode.com/svn/trunk/miranda/plugins/mDynDNS/changelog.txt"
#define __BetaVersionPrefix "mDynDNS: "
#define __BetaChangelogURL "http://merlins-miranda.googlecode.com/svn/trunk/miranda/plugins/mDynDNS/changelog.txt"
+