Index: version.rc
===================================================================
--- version.rc	(revision 9472)
+++ version.rc	(working copy)
@@ -34,7 +34,7 @@
             VALUE "PrivateBuild", "\0"                                        
             VALUE "ProductName", "Miranda IM\0"                               
             VALUE "ProductVersion", "0.8.0 alpha build #29\0"               
-            VALUE "SpecialBuild", "\0"                                        
+            VALUE "SpecialBuild", "YB\0"                                        
         END                                                                   
     END                                                                       
     BLOCK "VarFileInfo"                                                       
Index: core/modules.cpp
===================================================================
--- core/modules.cpp	(revision 9472)
+++ core/modules.cpp	(working copy)
@@ -114,7 +114,7 @@
 int LoadSkinHotkeys(void);
 int LoadHelpModule(void);		// ui: help stuff
 int LoadUserInfoModule(void);	// ui: user info
-int LoadHistoryModule(void);	// ui: history viewer
+//int LoadHistoryModule(void);	// ui: history viewer
 int LoadAwayMsgModule(void);	// ui: setting away messages
 int LoadVisibilityModule(void);	// ui: visibility control
 int LoadCLUIModule(void);		// ui: CList UI
@@ -210,7 +210,7 @@
 	if (!disableDefaultModule[DEFMOD_SRAUTH]) if (LoadSendRecvAuthModule()) return 1;
 	if (!disableDefaultModule[DEFMOD_SRFILE]) if (LoadSendRecvFileModule()) return 1;
 	if (!disableDefaultModule[DEFMOD_UIHELP]) if (LoadHelpModule()) return 1;
-	if (!disableDefaultModule[DEFMOD_UIHISTORY]) if (LoadHistoryModule()) return 1;
+//	if (!disableDefaultModule[DEFMOD_UIHISTORY]) if (LoadHistoryModule()) return 1;
 	if (!disableDefaultModule[DEFMOD_RNDIDLE]) if (LoadIdleModule()) return 1;
 	if (!disableDefaultModule[DEFMOD_RNDAUTOAWAY]) if (LoadAutoAwayModule()) return 1;
 	if (!disableDefaultModule[DEFMOD_RNDUSERONLINE]) if (LoadUserOnlineModule()) return 1;
@@ -235,7 +235,7 @@
 	UnloadClcModule();
 	UnloadContactListModule();
 	UnloadEventsModule();
-	UnloadIdleModule();
+//	UnloadIdleModule();
 	UnloadUpdateNotifyModule();
 	UnloadNetlibModule();
 	UnloadSslModule();
Index: core/miranda.cpp
===================================================================
--- core/miranda.cpp	(revision 9472)
+++ core/miranda.cpp	(working copy)
@@ -694,11 +694,17 @@
 	verInfoSize=GetFileVersionInfoSize(filename,&unused);
 	pVerInfo=mir_alloc(verInfoSize);
 	GetFileVersionInfo(filename,0,verInfoSize,pVerInfo);
-	VerQueryValue(pVerInfo,_T("\\StringFileInfo\\000004b0\\ProductVersion"),(LPVOID*)&productVersion,&blockSize);
-	#if defined( _UNICODE )
-		mir_snprintf(( char* )lParam, wParam, "%S Unicode", productVersion );
-	#else
-		lstrcpyn((char*)lParam,productVersion,wParam);
+	VerQueryValueA(pVerInfo,("\\StringFileInfo\\000004b0\\ProductVersion"),(LPVOID*)&productVersion,&blockSize);
+	lstrcpynA((char*)lParam,(char *)productVersion,wParam);
+	unused = strlen((char*)lParam);
+	if (VerQueryValueA(pVerInfo,("\\StringFileInfo\\000004b0\\PrivateBuild"),(LPVOID*)&productVersion,&blockSize))
+		if (strlen((char *)productVersion))
+			unused += mir_snprintf(( char* )lParam+unused, wParam-unused, " Priv(%s)", productVersion );
+	if (VerQueryValueA(pVerInfo,("\\StringFileInfo\\000004b0\\SpecialBuild"),(LPVOID*)&productVersion,&blockSize))
+		if (strlen((char *)productVersion))
+			unused += mir_snprintf(( char* )lParam+unused, wParam-unused, " Spec(%s)", productVersion );
+ 	#if defined( _UNICODE )
+		lstrcpynA(( char* )lParam+unused, " Unicode", wParam-unused);
 	#endif
 	mir_free(pVerInfo);
 	return 0;
Index: resource.rc
===================================================================
--- resource.rc	(revision 9472)
+++ resource.rc	(working copy)
@@ -490,18 +490,6 @@
     PUSHBUTTON      "Cancel",IDCANCEL,201,233,54,14
 END
 
-IDD_HISTORY_FIND DIALOGEX 0, 0, 230, 46
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_CONTROLPARENT
-CAPTION "Find"
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
-    EDITTEXT        IDC_FINDWHAT,48,11,115,12,ES_AUTOHSCROLL
-    DEFPUSHBUTTON   "&Find Next",IDOK,173,7,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,173,24,50,14
-    LTEXT           "Find What:",IDC_STATIC,7,13,39,9
-END
-
 IDD_FILESEND DIALOGEX 0, 0, 256, 177
 STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU
 EXSTYLE WS_EX_CONTROLPARENT
@@ -652,19 +640,6 @@
     EDITTEXT        IDC_MSG,5,70,205,44,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
 END
 
-IDD_HISTORY DIALOGEX 0, 0, 296, 166
-STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
-EXSTYLE WS_EX_CONTROLPARENT
-CAPTION "Message History"
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
-    DEFPUSHBUTTON   "Close",IDOK,239,144,50,14
-    EDITTEXT        IDC_EDIT,7,83,282,52,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
-    LISTBOX         IDC_LIST,7,7,282,72,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
-    PUSHBUTTON      "&Find...",IDC_FIND,7,144,50,14
-    PUSHBUTTON      "Delete",IDC_DELETEHISTORY,66,144,50,14
-END
-
 IDD_OPT_SOUND DIALOGEX 0, 0, 285, 240
 STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
 EXSTYLE WS_EX_CONTROLPARENT
@@ -849,34 +824,6 @@
     LTEXT           "Variables Allowed: %userid%, %nick%, %proto%, %miranda_path%, %userprofile%",IDC_STATIC,8,27,294,11,WS_DISABLED
 END
 
-IDD_OPT_IDLE DIALOGEX 0, 0, 312, 190
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_BORDER
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
-    CONTROL         "Become idle if the following is left unattended:",IDC_IDLESHORT,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,18,259,9
-    CONTROL         "Windows",IDC_IDLEONWINDOWS,"Button",BS_AUTORADIOBUTTON,45,31,104,9
-    CONTROL         "Miranda",IDC_IDLEONMIRANDA,"Button",BS_AUTORADIOBUTTON,45,43,103,9
-    EDITTEXT        IDC_IDLE1STTIME,59,59,27,14,ES_AUTOHSCROLL | ES_NUMBER
-    CONTROL         "Spin2",IDC_IDLESPIN,"msctls_updown32",UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,71,55,12,23
-    CONTROL         "Become idle if the screen saver is active",IDC_SCREENSAVER,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,83,268,9
-    CONTROL         "Become idle if the computer is locked (2000/XP+ only)",IDC_LOCKED,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,99,249,9
-    CONTROL         "Become idle if a terminal session is disconnected",IDC_IDLETERMINAL,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,115,265,10
-    CONTROL         "Do not let protocols report any idle information",IDC_IDLEPRIVATE,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,131,251,9
-    LTEXT           "minute(s)",IDC_STATIC,91,61,76,9
-    RTEXT           "for",IDC_STATIC,12,59,41,9
-    COMBOBOX        IDC_AASTATUS,128,146,64,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
-    CONTROL         "Change my status mode to:",IDC_AASHORTIDLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,147,101,11
-    CONTROL         "Do not set status back to online when returning from idle",IDC_IDLESTATUSLOCK,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,35,164,246,10
-    GROUPBOX        "Idle Options",IDC_STATIC,3,3,304,182
-END
-
 IDD_PROFILE_SELECTION DIALOGEX 0, 0, 386, 142
 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN
 EXSTYLE WS_EX_CONTROLPARENT
@@ -1029,20 +976,23 @@
     PUSHBUTTON      "Reset",IDC_RESETPROTOCOLDATA,120,140,50,14,BS_NOTIFY
 END
 
-IDD_UPDATE_NOTIFY DIALOGEX 0, 0, 259, 103
+IDD_UPDATE_NOTIFY DIALOGEX 0, 0, 323, 103
 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
 CAPTION "Miranda IM v%s Now Available"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    LTEXT           "A new version of Miranda IM is now available.  Click the download button to download this new update.",IDC_MESSAGE,7,7,245,21
+    LTEXT           "A new version of Miranda IM is now available.  Click the download button to download this new update.",IDC_MESSAGE,7,7,309,21
     LTEXT           "Latest Version:",IDC_NEWVERSIONLABEL,7,47,65,8
     LTEXT           "Your Version:",IDC_STATIC,7,32,65,8
     LTEXT           "",IDC_CURRENTVERSION,77,32,87,8
-    CONTROL         "",IDC_VERSION,"Hyperlink",WS_TABSTOP,77,47,87,8
+    EDITTEXT        IDC_NEWMD5,177,45,139,12,ES_AUTOHSCROLL | ES_READONLY
+	CONTROL         "",IDC_VERSION,"Hyperlink",WS_TABSTOP,77,47,87,8
     LTEXT           "",IDC_UPDATE,77,47,87,8
+    EDITTEXT        IDC_CURRENTMD5,177,30,139,12,ES_AUTOHSCROLL | ES_READONLY
     PUSHBUTTON      "&Download Now",IDC_DOWNLOAD,7,61,66,15
-    DEFPUSHBUTTON   "&Close",IDOK,202,84,50,15
-    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,80,245,1
+    EDITTEXT        IDC_DOWNLOADURL,77,62,239,12,ES_AUTOHSCROLL | ES_READONLY
+    DEFPUSHBUTTON   "&Close",IDOK,266,84,50,15
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,80,309,1
 END
 
 IDD_OPT_UPDATENOTIFY DIALOGEX 0, 0, 258, 62
@@ -1516,15 +1466,6 @@
         BOTTOMMARGIN, 247
     END
 
-    IDD_HISTORY_FIND, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 223
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 39
-        HORZGUIDE, 17
-    END
-
     IDD_FILESEND, DIALOG
     BEGIN
         LEFTMARGIN, 5
@@ -1586,14 +1527,6 @@
         BOTTOMMARGIN, 135
     END
 
-    IDD_HISTORY, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 289
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 158
-    END
-
     IDD_OPT_SOUND, DIALOG
     BEGIN
         LEFTMARGIN, 4
@@ -2086,6 +2019,7 @@
 // Generated from the TEXTINCLUDE 3 resource.
 //
 
+#include "saa-res.rc"
 
 /////////////////////////////////////////////////////////////////////////////
 #endif    // not APSTUDIO_INVOKED
Index: miranda32.dsp
===================================================================
--- miranda32.dsp	(revision 9472)
+++ miranda32.dsp	(working copy)
@@ -45,7 +45,7 @@
 # PROP Ignore_Export_Lib 1
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /Zi /O1 /I "../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_NOSDK" /D "_STATIC" /Yu"commonheaders.h" /FD /c
+# ADD CPP /nologo /G4 /Zp4 /MD /W3 /GX /Zi /O1 /I "../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_NOSDK" /D "_STATIC" /Yu"commonheaders.h" /FD /c
 # SUBTRACT CPP /Fr
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
@@ -56,8 +56,12 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
-# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib shell32.lib winspool.lib comdlg32.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib winmm.lib version.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:"../bin/release/miranda32.exe" /fixed /ALIGN:4096 /ignore:4108
+# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib winmm.lib version.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:"../bin/upload/08/A/miranda32.exe" /fixed /ALIGN:4096 /FILEALIGN:0x200 /ignore:4108
 # SUBTRACT LINK32 /pdb:none /incremental:yes
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Cmds=$(COMSPEC) /c "cd ../bin/upload/ && upx --compress-icons=0 --best --lzma --force 08/A/miranda32.exe && md5 -t -s -o08/A/miranda32.exe.md5 08/A/miranda32.exe"
+# End Special Build Tool
 
 !ELSEIF  "$(CFG)" == "miranda32 - Win32 Debug"
 
@@ -73,7 +77,7 @@
 # PROP Ignore_Export_Lib 1
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_NOSDK" /D "_STATIC" /Fr /Yu"commonheaders.h" /FD /c
+# ADD CPP /nologo /G4 /Zp4 /MDd /W3 /Gm /GX /ZI /Od /I "../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_NOSDK" /D "_STATIC" /Fr /Yu"commonheaders.h" /FD /c
 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
@@ -83,7 +87,7 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib shell32.lib winspool.lib comdlg32.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib winmm.lib version.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:"../bin/debug/miranda32.exe"
+# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib winmm.lib version.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:"../bin/debug/miranda32.exe"
 # SUBTRACT LINK32 /profile /pdb:none /incremental:no
 
 !ELSEIF  "$(CFG)" == "miranda32 - Win32 Release Unicode"
@@ -101,8 +105,7 @@
 # PROP Ignore_Export_Lib 1
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MD /W3 /GX /Zi /O1 /I "../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_NOSDK" /Fr /Yu"../../core/commonheaders.h" /FD /c
-# ADD CPP /nologo /MD /W3 /GX /Zi /O1 /I "../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_NOSDK" /D "UNICODE" /D "_STATIC" /Yu"commonheaders.h" /FD /c
-# SUBTRACT CPP /Fr
+# ADD CPP /nologo /G4 /Zp4 /MD /W3 /GX /Zi /O1 /I "../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_NOSDK" /D "UNICODE" /D "_STATIC" /Fr /Yu"commonheaders.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
 # ADD BASE RSC /l 0x409 /d "NDEBUG"
@@ -113,8 +116,12 @@
 LINK32=link.exe
 # ADD BASE LINK32 wsock32.lib comctl32.lib winmm.lib version.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /map /machine:I386 /out:"../bin/release/miranda32.exe" /fixed /ALIGN:4096 /ignore:4108
 # SUBTRACT BASE LINK32 /pdb:none /debug
-# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib shell32.lib winspool.lib comdlg32.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib winmm.lib version.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:"../bin/Release Unicode/miranda32.exe" /fixed /ALIGN:4096 /ignore:4108
+# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib winmm.lib version.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:"../bin/upload/08/W/miranda32.exe" /fixed /ALIGN:4096 /FILEALIGN:0x200 /ignore:4108
 # SUBTRACT LINK32 /pdb:none /incremental:yes
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Cmds=$(COMSPEC) /c "cd ../bin/upload/ && upx --compress-icons=0 --best --lzma --force 08/W/miranda32.exe && md5 -t -s -o08/W/miranda32.exe.md5 08/W/miranda32.exe"
+# End Special Build Tool
 
 !ELSEIF  "$(CFG)" == "miranda32 - Win32 Debug Unicode"
 
@@ -132,7 +139,7 @@
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_NOSDK" /Fr /FD /c
 # SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_NOSDK" /D "UNICODE" /D "_STATIC" /Fr /Yu"commonheaders.h" /FD /c
+# ADD CPP /nologo /G4 /Zp4 /MDd /W3 /Gm /GX /ZI /Od /I "../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_NOSDK" /D "UNICODE" /D "_STATIC" /Fr /Yu"commonheaders.h" /FD /c
 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
@@ -143,7 +150,7 @@
 LINK32=link.exe
 # ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib winmm.lib version.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:"../bin/debug/miranda32.exe"
 # SUBTRACT BASE LINK32 /profile
-# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib shell32.lib winspool.lib comdlg32.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib winmm.lib version.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:"../bin/Debug Unicode/miranda32.exe"
+# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib winmm.lib version.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:"../bin/Debug Unicode/miranda32.exe"
 # SUBTRACT LINK32 /profile /pdb:none /incremental:no
 
 !ENDIF 
@@ -390,14 +397,6 @@
 
 # End Source File
 # End Group
-# Begin Group "autoaway"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\modules\autoaway\autoaway.cpp
-# End Source File
-# End Group
 # Begin Group "button"
 
 # PROP Default_Filter ""
@@ -479,22 +478,6 @@
 SOURCE=.\modules\help\help.cpp
 # End Source File
 # End Group
-# Begin Group "history"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\modules\history\history.cpp
-# End Source File
-# End Group
-# Begin Group "idle"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\modules\idle\idle.cpp
-# End Source File
-# End Group
 # Begin Group "ignore"
 
 # PROP Default_Filter ""
@@ -972,7 +955,56 @@
 SOURCE=.\modules\xml\xmlParser.h
 # End Source File
 # End Group
+# Begin Group "saa"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE="..\extra\saa-cpp\aa_utils.cpp"
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE="..\extra\saa-cpp\autoaway.cpp"
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE="..\extra\saa-cpp\dlgproc.cpp"
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE="..\extra\saa-cpp\globals.cpp"
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE="..\extra\saa-cpp\idle.cpp"
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE="..\extra\saa-cpp\idleMenu.cpp"
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE="..\extra\saa-cpp\idleMessages.cpp"
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE="..\extra\saa-cpp\reconnect.cpp"
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE="..\extra\saa-cpp\saamain.cpp"
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
 # End Group
+# End Group
 # Begin Group "Resources"
 
 # PROP Default_Filter ""
@@ -983,6 +1015,8 @@
 # Begin Source File
 
 SOURCE=.\vc6.rc
+# ADD BASE RSC /l 0x402
+# ADD RSC /l 0x402 /i "../extra/saa"
 # End Source File
 # End Group
 # End Target
Index: modules/netlib/netlibhttpproxy.cpp
===================================================================
--- modules/netlib/netlibhttpproxy.cpp	(revision 9472)
+++ modules/netlib/netlibhttpproxy.cpp	(working copy)
@@ -22,6 +22,7 @@
 */
 #include "commonheaders.h"
 #include "netlib.h"
+#define FILENAME "netlibhttpproxy.c"
 
 #define HTTPGETTIMEOUT   55000  //in ms. http GETs through most proxies will give up after a while so the request needs to be re-sent
 
@@ -34,12 +35,12 @@
 
 	nlc->s=socket(AF_INET,SOCK_STREAM,0);
 	if(nlc->s==INVALID_SOCKET) {
-		Netlib_Logf(nlc->nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"socket",WSAGetLastError());
+		Netlib_Logf(nlc->nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"socket",WSAGetLastError());
 		return 0;
 	}
 
 	if(connect(nlc->s,(SOCKADDR *)&nlc->sinProxy,sizeof(nlc->sinProxy))==SOCKET_ERROR) {
-		Netlib_Logf(nlc->nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"connect",WSAGetLastError());
+		Netlib_Logf(nlc->nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"connect",WSAGetLastError());
 		return 0;
 	}
 
@@ -81,7 +82,7 @@
 
 	if (nlc->nlhpi.szHttpGetUrl != NULL) {
 
-		Netlib_Logf(nlc->nlu,"%s %d: Sending data.[ICQ GET] ",__FILE__,__LINE__);
+		Netlib_Logf(nlc->nlu,"%s %d: Sending data.[ICQ GET] ",FILENAME,__LINE__);
 		if(NetlibHttpSendRequest((WPARAM)&nlcSend,(LPARAM)&nlhrSend)==SOCKET_ERROR) {
 			nlc->usingHttpGateway=1;
 			return 0;
@@ -148,7 +149,7 @@
 	nlcSend.hNtlmSecurity=nlc->hNtlmSecurity;
 	nlcSend.s=socket(AF_INET,SOCK_STREAM,0);
 	if(nlcSend.s==INVALID_SOCKET) {
-		Netlib_Logf(nlc->nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"socket",WSAGetLastError());
+		Netlib_Logf(nlc->nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"socket",WSAGetLastError());
 		return SOCKET_ERROR;
 	}
 	nlcSend.hOkToCloseEvent=CreateEvent(NULL,TRUE,TRUE,NULL);
@@ -157,7 +158,7 @@
 	NetlibInitializeNestedCS(&nlcSend.ncsSend);
 
 	if(connect(nlcSend.s,(SOCKADDR *)&nlc->sinProxy,sizeof(nlc->sinProxy))==SOCKET_ERROR) {
-		Netlib_Logf(nlc->nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"connect",WSAGetLastError());
+		Netlib_Logf(nlc->nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"connect",WSAGetLastError());
 		NetlibDeleteNestedCS(&nlcSend.ncsRecv);
 		NetlibDeleteNestedCS(&nlcSend.ncsSend);
 		CloseHandle(nlcSend.hOkToCloseEvent);
@@ -362,7 +363,7 @@
 				nlc->s = INVALID_SOCKET;
 				Sleep(NETLIBHTTP_RETRYTIMEOUT); // wait 5 seconds
 				// retry the connection
-				Netlib_Logf(nlc->nlu,"%s %d: ResultCode?? Doing GET.",__FILE__,__LINE__);
+				Netlib_Logf(nlc->nlu,"%s %d: ResultCode?? Doing GET.",FILENAME,__LINE__);
 				if(HttpGatewaySendGet(nlc))
 					continue;
 				SetLastError(ERROR_GEN_FAILURE);
@@ -385,7 +386,7 @@
 		 *
 		 */
 		if (nlc->nlhpi.szHttpGetUrl != NULL)  {
-			Netlib_Logf(nlc->nlu,"%s %d: Doing GET, Again????",__FILE__,__LINE__);
+			Netlib_Logf(nlc->nlu,"%s %d: Doing GET, Again????",FILENAME,__LINE__);
 
 			if(!HttpGatewaySendGet(nlc)) {
 				NetlibHttpFreeRequestStruct(0,(LPARAM)nlhrReply);
@@ -433,7 +434,7 @@
 	nlhrReply->dataLength = 0;
 	NetlibHttpFreeRequestStruct(0,(LPARAM)nlhrReply);
 
-	Netlib_Logf(nlc->nlu,"%s %d: NetlibHTTPGatewayRecv EXIT!",__FILE__,__LINE__);
+	Netlib_Logf(nlc->nlu,"%s %d: NetlibHTTPGatewayRecv EXIT!",FILENAME,__LINE__);
 	return len;
 }
 
Index: modules/netlib/netlibupnp.cpp
===================================================================
--- modules/netlib/netlibupnp.cpp	(revision 9472)
+++ modules/netlib/netlibupnp.cpp	(working copy)
@@ -22,6 +22,10 @@
 */
 #include "commonheaders.h"
 #include "netlib.h"
+#ifdef __GNUC__
+	#define IP_MULTICAST_IF	2
+	#define IP_TTL              7           /* set/get IP Time To Live          */
+#endif
 
 extern struct NetlibUser **netlibUser;
 extern int netlibUserCount;
Index: modules/netlib/netlibbind.cpp
===================================================================
--- modules/netlib/netlibbind.cpp	(revision 9472)
+++ modules/netlib/netlibbind.cpp	(working copy)
@@ -22,6 +22,7 @@
 */
 #include "commonheaders.h"
 #include "netlib.h"
+#define FILENAME "netlibbind.c"
 
 extern CRITICAL_SECTION csNetlibUser;
 
@@ -171,7 +172,7 @@
 	nlbp->s=socket(AF_INET,SOCK_STREAM,0);
 	nlbp->pExtra= (nlb->cbSize != NETLIBBIND_SIZEOF_V1) ? nlb->pExtra : NULL;
 	if(nlbp->s==INVALID_SOCKET) {
-		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"socket",WSAGetLastError());
+		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"socket",WSAGetLastError());
 		mir_free(nlbp);
 		return (INT_PTR)NULL;
 	}
@@ -195,20 +196,20 @@
 		/* if ->wPort==0 then they'll get any free port, otherwise they'll
 		be asking for whatever was in nlb->wPort*/
 		if (nlb->wPort!=0) {
-			Netlib_Logf(nlu,"%s %d: trying to bind port %d, this 'feature' can be abused, please be sure you want to allow it.",__FILE__,__LINE__,nlb->wPort);
+			Netlib_Logf(nlu,"%s %d: trying to bind port %d, this 'feature' can be abused, please be sure you want to allow it.",FILENAME,__LINE__,nlb->wPort);
 			sin.sin_port=htons(nlb->wPort);
 		}
 		if(bind(nlbp->s,(SOCKADDR *)&sin,sizeof(sin))==0) foundPort=1;
 	}
 	if(!foundPort) {
-		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"bind",WSAGetLastError());
+		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"bind",WSAGetLastError());
 		closesocket(nlbp->s);
 		mir_free(nlbp);
 		return (INT_PTR)NULL;
 	}
 
 	if(listen(nlbp->s,5)) {
-		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"listen",WSAGetLastError());
+		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"listen",WSAGetLastError());
 		closesocket(nlbp->s);
 		mir_free(nlbp);
 		return (INT_PTR)NULL;
@@ -220,7 +221,7 @@
 		ZeroMemory(&sin,sizeof(sin));
 		len=sizeof(sin);
 		if(getsockname(nlbp->s,(SOCKADDR *)&sin,&len)) {
-			Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"getsockname",WSAGetLastError());
+			Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"getsockname",WSAGetLastError());
 			closesocket(nlbp->s);
 			mir_free(nlbp);
 			return (INT_PTR)NULL;
Index: modules/netlib/netlibopenconn.cpp
===================================================================
--- modules/netlib/netlibopenconn.cpp	(revision 9472)
+++ modules/netlib/netlibopenconn.cpp	(working copy)
@@ -22,6 +22,7 @@
 */
 #include "commonheaders.h"
 #include "netlib.h"
+#define FILENAME "netlibopenconn.c"
 
 extern CRITICAL_SECTION csNetlibUser;
 extern DWORD g_LastConnectionTick; // protected by csNetlibUser
@@ -41,7 +42,7 @@
 	if ( host )
 		return *( u_long* )host->h_addr_list[0];
 
-	Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"gethostbyname",WSAGetLastError());
+	Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"gethostbyname",WSAGetLastError());
 	return 0;
 }
 
@@ -141,14 +142,14 @@
 		len=9+nUserLen;
 	}
 	if(NLSend(nlc,(char*)pInit,len,MSG_DUMPPROXY)==SOCKET_ERROR) {
-		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"NLSend",GetLastError());
+		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"NLSend",GetLastError());
 		mir_free(pInit);
 		return 0;
 	}
 	mir_free(pInit);
 
 	if (!RecvUntilTimeout(nlc,(char*)reply,SIZEOF(reply),MSG_DUMPPROXY,RECV_DEFAULT_TIMEOUT)) {
-		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"RecvUntilTimeout",GetLastError());
+		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"RecvUntilTimeout",GetLastError());
 		return 0;
 	}
 	if ( reply[1] != 90 ) {
@@ -158,7 +159,7 @@
 			case 93: SetLastError(ERROR_INVALID_ACCESS); break;
 			default: SetLastError(ERROR_INVALID_DATA); break;
 		}
-		Netlib_Logf(nlu,"%s %d: Proxy connection failed (%u)",__FILE__,__LINE__, GetLastError());
+		Netlib_Logf(nlu,"%s %d: Proxy connection failed (%u)",FILENAME,__LINE__, GetLastError());
 		return 0;
 	}
 	//connected
@@ -173,18 +174,18 @@
 	buf[1]=1;  //one auth method
 	buf[2]=nlu->settings.useProxyAuth?2:0;
 	if(NLSend(nlc,(char*)buf,3,MSG_DUMPPROXY)==SOCKET_ERROR) {
-		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"NLSend",GetLastError());
+		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"NLSend",GetLastError());
 		return 0;
 	}
 
 	//confirmation of auth method
 	if (!RecvUntilTimeout(nlc,(char*)buf,2,MSG_DUMPPROXY,RECV_DEFAULT_TIMEOUT)) {
-		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"RecvUntilTimeout",GetLastError());
+		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"RecvUntilTimeout",GetLastError());
 		return 0;
 	}
 	if((buf[1]!=0 && buf[1]!=2)) {
 		SetLastError(ERROR_INVALID_ID_AUTHORITY);
-		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"NLRecv",GetLastError());
+		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"NLRecv",GetLastError());
 		return 0;
 	}
 
@@ -201,19 +202,19 @@
 		pAuthBuf[2+nUserLen]=nPassLen;
 		memcpy(pAuthBuf+3+nUserLen,nlu->settings.szProxyAuthPassword,nPassLen);
 		if(NLSend(nlc,(char*)pAuthBuf,3+nUserLen+nPassLen,MSG_DUMPPROXY)==SOCKET_ERROR) {
-			Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"NLSend",GetLastError());
+			Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"NLSend",GetLastError());
 			mir_free(pAuthBuf);
 			return 0;
 		}
 		mir_free(pAuthBuf);
 
 		if (!RecvUntilTimeout(nlc,(char*)buf,2,MSG_DUMPPROXY,RECV_DEFAULT_TIMEOUT)) {
-			Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"RecvUntilTimeout",GetLastError());
+			Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"RecvUntilTimeout",GetLastError());
 			return 0;
 		}
 		if(buf[1]) {
 			SetLastError(ERROR_ACCESS_DENIED);
-			Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"RecvUntilTimeout",GetLastError());
+			Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"RecvUntilTimeout",GetLastError());
 			return 0;
 		}
 	}
@@ -247,7 +248,7 @@
 		}
 		*(PWORD)(pInit+4+nHostLen)=htons(nloc->wPort);
 		if(NLSend(nlc,(char*)pInit,6+nHostLen,MSG_DUMPPROXY)==SOCKET_ERROR) {
-			Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"NLSend",GetLastError());
+			Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"NLSend",GetLastError());
 			mir_free(pInit);
 			return 0;
 		}
@@ -255,7 +256,7 @@
 	}
 
 	if (!RecvUntilTimeout(nlc,(char*)buf,5,MSG_DUMPPROXY,RECV_DEFAULT_TIMEOUT)) {
-		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"RecvUntilTimeout",GetLastError());
+		Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"RecvUntilTimeout",GetLastError());
 		return 0;
 	}
 
@@ -275,7 +276,7 @@
 				case 8: SetLastError(ERROR_INVALID_ADDRESS); err = "Address type not supported"; break;
 				default: SetLastError(ERROR_INVALID_DATA); break;
 			}
-		Netlib_Logf(nlu,"%s %d: Proxy conection failed. %s.",__FILE__,__LINE__, err);
+		Netlib_Logf(nlu,"%s %d: Proxy conection failed. %s.",FILENAME,__LINE__, err);
 		return 0;
 	}
 	{
@@ -291,11 +292,11 @@
 			nRecvSize = 17;
 			break;
 		default:
-			Netlib_Logf(nlu,"%s %d: %s() unknown address type (%u)",__FILE__,__LINE__,"NetlibInitSocks5Connection",(int)buf[3]);
+			Netlib_Logf(nlu,"%s %d: %s() unknown address type (%u)",FILENAME,__LINE__,"NetlibInitSocks5Connection",(int)buf[3]);
 			return 0;
 		}
 		if (!RecvUntilTimeout(nlc,(char*)buf,nRecvSize,MSG_DUMPPROXY,RECV_DEFAULT_TIMEOUT)) {
-			Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"RecvUntilTimeout",GetLastError());
+			Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"RecvUntilTimeout",GetLastError());
 			return 0;
 	}	}
 
@@ -338,7 +339,7 @@
 	if(nlhrReply==NULL) return 0;
 	if(nlhrReply->resultCode<200 || nlhrReply->resultCode>=300) {
 		NetlibHttpSetLastErrorUsingHttpResult(nlhrReply->resultCode);
-		Netlib_Logf(nlu,"%s %d: %s request failed (%u %s)",__FILE__,__LINE__,nlu->settings.proxyType==PROXYTYPE_HTTP?"HTTP":"HTTPS",nlhrReply->resultCode,nlhrReply->szResultDescr);
+		Netlib_Logf(nlu,"%s %d: %s request failed (%u %s)",FILENAME,__LINE__,nlu->settings.proxyType==PROXYTYPE_HTTP?"HTTP":"HTTPS",nlhrReply->resultCode,nlhrReply->szResultDescr);
 		NetlibHttpFreeRequestStruct(0,(LPARAM)nlhrReply);
 		return 0;
 	}
@@ -517,7 +518,7 @@
 	if(nlc->sinProxy.sin_addr.S_un.S_addr==0
 	   || my_connect(nlc, nloc)==SOCKET_ERROR) {
 		if(nlc->sinProxy.sin_addr.S_un.S_addr)
-			Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"connect",WSAGetLastError());
+			Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"connect",WSAGetLastError());
 		FreePartiallyInitedConnection(nlc);		
 		return (INT_PTR)(HANDLE)NULL;
 	}
@@ -566,7 +567,7 @@
 						if(nlc->sinProxy.sin_addr.S_un.S_addr==0 || my_connect(nlc, nloc)==SOCKET_ERROR) 
                         {
 							if(nlc->sinProxy.sin_addr.S_un.S_addr)
-								Netlib_Logf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"connect",WSAGetLastError());
+								Netlib_Logf(nlu,"%s %d: %s() failed (%u)",FILENAME,__LINE__,"connect",WSAGetLastError());
 							FreePartiallyInitedConnection(nlc);
 							return (INT_PTR)NULL;
 						}
Index: modules/updatenotify/updatenotify.cpp
===================================================================
--- modules/updatenotify/updatenotify.cpp	(revision 9472)
+++ modules/updatenotify/updatenotify.cpp	(working copy)
@@ -30,9 +30,14 @@
 #define UN_CURRENTVERSION    "UpdateNotifyCurrentVersion"
 #define UN_CURRENTVERSIONFND "UpdateNotifyCurrentVersionFound"
 #define UN_NOTIFYALPHA       "UpdateNotifyNotifyAlpha"
-#define UN_NOTIFYALPHA_DEF   0
+#define UN_CURRENTMD5       "UpdateNotifyCurrentMD5"
+#define UN_NOTIFYALPHA_DEF   1
 #define UN_CUSTOMURL         "UpdateNotifyCustomURL"
-#define UN_URL               "http://update.miranda-im.org/update.php"
+#ifdef DEBUG
+#define UN_URL               "http://saaplugin.no-ip.info/mirupdate-test.cgi"
+#else 
+#define UN_URL               "http://saaplugin.no-ip.info/mirupdate.cgi"
+#endif
 #define UN_MINCHECKTIME      60*60 /* Check no more than once an hour */
 #define UN_DEFAULTCHECKTIME  60*48*60 /* Default to check once every 48 hours */
 #define UN_FIRSTCHECK        15 /* First check 15 seconds after startup */
@@ -46,6 +51,9 @@
     char notesUrl[256];
 	char downloadUrl[256];
 	DWORD reqTime;
+	char newMD5[33];
+	char oldVersion[64];
+	char oldMD5[33];
 } UpdateNotifyData;
 
 static BOOL bModuleInitialized = FALSE;
@@ -186,22 +194,53 @@
 	}
 }
 
+void md5_init(mir_md5_state_t *pms);
+void md5_append(mir_md5_state_t *pms, const mir_md5_byte_t *data, int nbytes);
+void md5_finish(mir_md5_state_t *pms, mir_md5_byte_t digest[16]);
+
+static void getMD5(char *target){
+#define BIT 0x4000
+	char filename[MAX_PATH];
+	char *buff=(char *)mir_alloc(BIT);
+	FILE *in = NULL;
+	DWORD digest[4];
+	digest[0] = 0;
+	GetModuleFileNameA(NULL,filename,SIZEOF(filename));
+	if (in = fopen(filename, "rb")){
+		mir_md5_state_t state;
+		int len = 0;
+		md5_init(&state);
+		do {
+			len = fread(buff,1,BIT,in);
+			md5_append(&state,(const mir_md5_byte_t *)buff,len);
+		} while (len==BIT);
+		md5_finish(&state,(unsigned char *)digest);
+		fclose(in);
+	}
+	mir_free(buff);
+	sprintf( target, "%08X%08X%08X%08X", htonl(digest[0]), htonl(digest[1]), htonl(digest[2]), htonl(digest[3]));
+}
+
 static int UpdateNotifyMakeRequest(UpdateNotifyData *und) {
 	NETLIBHTTPREQUEST req;
 	NETLIBHTTPREQUEST *resp;
 	NETLIBHTTPHEADER headers[1];
 	DWORD dwVersion;
 	char szVersion[32], szUrl[256], szVersionText[128];
+	char szMD5[33];
 	int isUnicode, isAlpha, isAlphaBuild;
 	DBVARIANT dbv;
 	
 	if (!und) 
 		return 0;
+	getMD5(szMD5);
 	und->version[0] = 0;
 	und->versionReal[0] = 0;
 	und->notesUrl[0] = 0;
 	und->downloadUrl[0] = 0;
 	und->reqTime = time(NULL);
+	memcpy(&und->oldMD5,szMD5,sizeof(und->oldMD5));
+	mir_snprintf(und->oldVersion, sizeof(und->oldVersion), "%s", szVersionText);
 	
 	DBWriteContactSettingDword(NULL, UN_MOD, UN_LASTCHECK, und->reqTime);
 	CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(szVersionText), (LPARAM)szVersionText);
@@ -213,10 +252,22 @@
 		HIBYTE(HIWORD(dwVersion)), LOBYTE(HIWORD(dwVersion)),
 		HIBYTE(LOWORD(dwVersion)), LOBYTE(LOWORD(dwVersion)));
 	if (!DBGetContactSettingString(NULL, UN_MOD, UN_CUSTOMURL, &dbv)) {
-		mir_snprintf(szUrl, sizeof(szUrl), "%s?version=%s&unicode=%d&alpha=%d&alphaBuild=%d", dbv.pszVal?dbv.pszVal:UN_URL, szVersion, isUnicode, isAlpha, isAlphaBuild);
+		mir_snprintf(szUrl, sizeof(szUrl), "%s?version=%s&unicode=%d&alpha=%d&alphaBuild=%d&md5sum=%s", dbv.pszVal?dbv.pszVal:UN_URL, szVersion, isUnicode, isAlpha, isAlphaBuild, szMD5);
 		DBFreeVariant(&dbv);
 	}
-	else mir_snprintf(szUrl, sizeof(szUrl), "%s?version=%s&unicode=%d&alpha=%d&alphaBuild=%d", UN_URL, szVersion, isUnicode, isAlpha, isAlphaBuild);
+	else mir_snprintf(szUrl, sizeof(szUrl), "%s?version=%s&unicode=%d&alpha=%d&alphaBuild=%d&md5sum=%s", UN_URL, szVersion, isUnicode, isAlpha, isAlphaBuild, szMD5);
+	/*{
+			UpdateNotifyData und;
+			ZeroMemory(&und, sizeof(und));
+			memcpy(&und.oldMD5,szMD5,sizeof(und.oldMD5));
+			mir_snprintf(und.oldVersion, sizeof(und.oldVersion), "%s", szVersionText);
+			mir_snprintf(und.version, sizeof(und.version), "%s", szVersionText);
+			memcpy(&und.newMD5,szMD5,sizeof(und.oldMD5));
+			mir_snprintf(und.downloadUrl, sizeof(und.downloadUrl), "%s", "http://www.miranda-im.org/2007/12/09/miranda-im-v080-build-4/");
+			//DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_UPDATE_NOTIFY), 0, UpdateNotifyProc,(LPARAM)&und);
+			hwndUpdateDlg = 0;
+			return 1;
+	}//*/
 
 	ZeroMemory(&req, sizeof(req));
 	req.cbSize = sizeof(req);
@@ -224,7 +275,7 @@
 	req.szUrl = szUrl;
 	req.flags = 0;
 	headers[0].szName = "User-Agent";
-	headers[0].szValue = "MirandaUpdate/0.3";
+	headers[0].szValue = "MirandaUpdate/0.3y";
 	req.headersCount = 1;
 	req.headers = headers;
 	resp = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hNetlibUser, (LPARAM)&req);
@@ -252,6 +303,10 @@
 					Netlib_Logf(hNetlibUser, "Notes url found (%s)", resp->headers[i].szValue);
 					mir_snprintf(und->notesUrl, sizeof(und->notesUrl), "%s", resp->headers[i].szValue);
 				}
+				else if (strcmp(resp->headers[i].szName, "X-Miranda-MD5")==0&&resp->headers[i].szValue) {
+					Netlib_Logf(hNetlibUser, "New MD5 found (%s)", resp->headers[i].szValue);
+					mir_snprintf(und->newMD5, sizeof(und->newMD5), "%s", resp->headers[i].szValue);
+				}
 				else if (strcmp(resp->headers[i].szName, "X-Miranda-Download-URL")==0&&resp->headers[i].szValue) {
 					Netlib_Logf(hNetlibUser, "Download url found (%s)", resp->headers[i].szValue);
 					mir_snprintf(und->downloadUrl, sizeof(und->downloadUrl), "%s", resp->headers[i].szValue);
@@ -269,7 +324,7 @@
 					}
 				}
 			}
-			if (resUpdate&&und->version&&und->versionReal&&und->notesUrl&&und->downloadUrl) {
+			if (resUpdate&&und->version&&und->versionReal&&und->notesUrl&&und->downloadUrl&&und->newMD5) {
 				und->isNew = 1;
 			}
 		}
@@ -305,10 +360,26 @@
 				DBFreeVariant(&dbv);
 			}
 		}
+		if (!notify) if (!DBGetContactSettingString(NULL, UN_MOD, UN_CURRENTMD5, &dbv)) {
+			if (!strcmp(dbv.pszVal, und.newMD5)) { // already notified of this MD5
+			
+				DWORD dwNotifyLast = DBGetContactSettingDword(NULL, UN_MOD, UN_CURRENTVERSIONFND, 0);
+
+				if (dwNotifyLast>und.reqTime) { // fix last check date if time has changed
+					DBWriteContactSettingDword(NULL, UN_MOD, UN_CURRENTVERSIONFND, und.reqTime);
+					notify = 0;
+				}
+				else if (und.reqTime-dwNotifyLast<UN_REPEATNOTIFYDLY) {
+					notify = 0;
+				}
+				DBFreeVariant(&dbv);
+			}
+		}
 		if (notify) {
 			DBWriteContactSettingString(NULL, UN_MOD, UN_CURRENTVERSION, und.versionReal);
 			DBWriteContactSettingDword(NULL, UN_MOD, UN_CURRENTVERSIONFND, und.reqTime);
-			DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_UPDATE_NOTIFY), 0, UpdateNotifyProc,(LPARAM)&und);
+			DBWriteContactSettingString(NULL, UN_MOD, UN_CURRENTMD5, und.newMD5);
+			DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_UPDATE_NOTIFY), 0, UpdateNotifyProc,(LPARAM)&und);
 			hwndUpdateDlg = 0;
 		}
 	}
@@ -364,6 +435,9 @@
 				hFont = CreateFontIndirect(&lf);
 				SendDlgItemMessage(hwndDlg, IDC_NEWVERSIONLABEL, WM_SETFONT, (WPARAM)hFont, 0);
 			}
+			SetDlgItemTextA(hwndDlg, IDC_CURRENTMD5, und->oldMD5);
+			SetDlgItemTextA(hwndDlg, IDC_NEWMD5, und->newMD5);
+			SetDlgItemTextA(hwndDlg, IDC_DOWNLOADURL, und->downloadUrl);
 			SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
 		}
 		break;
Index: resource.h
===================================================================
--- resource.h	(revision 9472)
+++ resource.h	(working copy)
@@ -22,7 +22,6 @@
 #define IDD_URLRECV                     120
 #define IDD_AUTHREQ                     121
 #define IDD_DETAILS                     125
-#define IDD_HISTORY                     127
 #define IDI_AWAY                        128
 #define IDI_FREE4CHAT                   129
 #define IDI_INVISIBLE                   130
@@ -49,7 +48,6 @@
 #define IDR_CONTEXT                     180
 #define IDR_ICOLIB_CONTEXT              181
 #define IDC_DROP                        183
-#define IDD_HISTORY_FIND                192
 #define IDI_SENDEMAIL                   193
 #define IDD_FILERECV                    194
 #define IDD_PROFILEMANAGER              197
@@ -467,6 +465,9 @@
 #define IDC_NEWVERSIONLABEL             1696
 #define IDC_CURRENTVERSION              1697
 #define IDC_DOWNLOAD                    1699
+#define IDC_CURRENTMD5                  1700
+#define IDC_NEWMD5                      1701
+#define IDC_DOWNLOADURL                 1702
 #define IDC_ENABLEUPDATES               1700
 #define IDC_ENABLEALPHA                 1701
 #define IDC_RESETMENU                   1702
@@ -483,6 +484,10 @@
 #define IDC_PROTOTYPECOMBO              1715
 #define IDC_ACCINTERNALNAME             1716
 #define IDC_OPTIONS                     1717
+//<<<<<<< .mine
+//#define IDC_BUTTON1                     1633
+//=======
+//>>>>>>> .r9160
 #define IDC_CLEAR                       1718
 #define IDC_PROGRESS1                   1719
 #define IDC_PROGRESSBAR                 1719
