summaryrefslogtreecommitdiff
path: root/plugins/Non-IM Contact
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Non-IM Contact')
-rw-r--r--plugins/Non-IM Contact/docs/nimcontact_readme.txt305
-rw-r--r--plugins/Non-IM Contact/docs/todo.txt29
-rw-r--r--plugins/Non-IM Contact/nimcontact_10.vcxproj214
-rw-r--r--plugins/Non-IM Contact/nimcontact_10.vcxproj.filters65
-rw-r--r--plugins/Non-IM Contact/nimcontact_11.vcxproj218
-rw-r--r--plugins/Non-IM Contact/nimcontact_11.vcxproj.filters65
-rw-r--r--plugins/Non-IM Contact/res/Version.rc38
-rw-r--r--plugins/Non-IM Contact/res/nimc.jpgbin0 -> 20471 bytes
-rw-r--r--plugins/Non-IM Contact/res/resource.rc356
-rw-r--r--plugins/Non-IM Contact/res/star8.icobin0 -> 894 bytes
-rw-r--r--plugins/Non-IM Contact/src/Version.h14
-rw-r--r--plugins/Non-IM Contact/src/commonheaders.h128
-rw-r--r--plugins/Non-IM Contact/src/contactinfo.cpp707
-rw-r--r--plugins/Non-IM Contact/src/dialog.cpp368
-rw-r--r--plugins/Non-IM Contact/src/files.cpp350
-rw-r--r--plugins/Non-IM Contact/src/http.cpp103
-rw-r--r--plugins/Non-IM Contact/src/main.cpp199
-rw-r--r--plugins/Non-IM Contact/src/namereplacing.cpp662
-rw-r--r--plugins/Non-IM Contact/src/resource.h77
-rw-r--r--plugins/Non-IM Contact/src/services.cpp127
-rw-r--r--plugins/Non-IM Contact/src/stdafx.cpp18
-rw-r--r--plugins/Non-IM Contact/src/timer.cpp84
22 files changed, 4127 insertions, 0 deletions
diff --git a/plugins/Non-IM Contact/docs/nimcontact_readme.txt b/plugins/Non-IM Contact/docs/nimcontact_readme.txt
new file mode 100644
index 0000000000..4ff9131aa4
--- /dev/null
+++ b/plugins/Non-IM Contact/docs/nimcontact_readme.txt
@@ -0,0 +1,305 @@
+Non-IM Contact
+--------------
+
+Non-IM Contact allows you to add "contacts" that can act as shortcuts to other programs, or links to web pages.
+The contacts name can be read from a text file (includes any ASCII file).
+(This plugin is a combination of Favorites and Text Reader plugins both made by me)
+
+Why would you use this plugin?
+Well... lets say you are lazy and want to be able to load up the c:\ drive by double clicking a contact in your CList. So what you do to set this up is create a new contact (from the main menu), give the contact a name, then in the "Link and CList settings" tab, type c:\ into the link field.
+This is the very simplest way of using NimC.
+Now lets take this contact 1 step further.
+Lets say you have a script that you have scheduled to run every 30min or so that prints the available disk space into a text file.
+This script for example. http://www.coolmon.org/extensions/extension.php?id=154 prints something like this
+"
+Last Updated: 5/17/2004 7:04:13 PM
+
+C:
+Fixed : NTFS
+25.35gb
+6.13gb
+19.5%
+80.5%
+[++========]
+"
+into a txt file. So, what can we do with information?
+Lets set our contact to display as its nick the available disk space on the drive (i.e it would look like "C:\ 25.35gb free" )
+all we need to do is load the file in the "files" tab then type something like this into the "display Name" field "file(0)wholeline(line(2))\ file(0)wholeline(line(4)) free".
+This may look cryptic but it really is very simple !!! (see Explanation of Variables below)
+
+
+Detailed Explanation of Non-IM Contact Settings
+--------------------------------------------------
+
+"Contacts Display Info" tab
+-> "Contacts display name" this is the only compulsary field.. this is what the contact will display as their nick, more info below how to make it kewl :)
+-> "Contacts tooltip" well this isnt really their tooltip becuase to make it easier for me, the info u type here after being replaced with info from the files gets copied into the user "notes" field in their "user info" display, so u can use this is mtooltip with the %notes variable (dont know about other tooltip plugins)
+
+"Link and CList settings" tab
+-> "Link" the file to load/ program to run/ web page to open etc, when u double click the contact
+-> "program parameters" any parameters for the program
+-> "status icon" the contacts status icon. (See below)
+
+"Timer settings"
+-> "use timer", if this is set then the contact can be updated using the timer
+-> the blank text field... the number of intervals between checking... the intervals are set in the options... default of 1 second)
+
+"Copy Contact"
+this dialog is explained below..
+
+"Files"
+here is a list of all the available files (and eventually web pages) that u can use in all the contacts. the %fn ID box shows the text to type to use the file (explained below)
+the big text box shows the contents and line numbers of the file, and the drop list has a list of availablew files.
+
+Options window...
+-> "ignore global status change" with this set, nimc will only change status if manually set (using the status bar icon, or status menu)
+-> "aways as another status" changes the way away status works. if set then only contacts with away set as their icon will be displayed when the protocol chnages to away, and timer wont be turned off.. otherwise away acts the same as online but with the timer off)
+-> "disable timer" disables the timer, no web pages or contacts will be updated if this is checked
+-> "timer interval" this is the global timer interval. the individual contact timers are a multiple of this timer. so if this is set to 15 and a contacts individual timer is set to 3, then that contact will be updated every 45 seconds. (same for web pages)
+
+String Maker window...
+-> "string to test" you can type anything here, when you press Test String this string will get parsed and the result will be displayed in the other edit box
+-> the row of varables is used to tell you which variable you are in.
+
+
+Explanation of Variables
+-------------------------
+
+NEW VARIABLES IN 0.5
+--------------------
+lastchecked(file(X)) <- displays the time and date the file was last modified (im 2 lazy to make it editable, so live with it.. its DD/MM/YY HH:MM) (X is the file number)
+
+for the next 5 the "" marks are compulsary... if they arnt there it wont work as expected!
+the following are all done after the string has been complety replaced, and compare(..) is done the very last....
+
+compare("A","B","X","Y") <- what this does is after all the strings have been replaced it compares A and B, if they are the same then X will get inserted into the final string, otherwise Y will be inserted. (this is the last variable that is checked so u can put file(x)start(.....)...) inside it and it will work the way u want it to. )
+
+save("A","B") <- this saves whatever B is to a db variable named A in the contact's "NIM_Contact" module
+
+load("A") <- this loads the setting A from the contact and inserts it into the string.
+
+saveN("A","B","C","D") <- this is the same as save(...) except it lets you save to the setting contact in the db. A is module, B is setting, C is value, D is type (0 or b = byte, 1 or w = word, 2 or d = dword, 3 or s = string) (not 100% sure this is safe or useful.. but i dunno. an examlpe use of this might be to wright a quick script that spits out the name of a picture (from a defined list) and it will set your clist background pic to it... ?)
+
+loadN("A","B") <- same as load(...) except it loads from the settings contact from the module A and setting B
+
+REMEMBER... THE "" MARKS ARE NESCASSERY
+------------------------------------------
+
+from version 0.4 the variables have all been changed.. this new system is slightly worse but allows much better control over what u can display...
+
+firstly the easiest variable.... filename(X) <- displays the filename of the Xth file in the files tab
+
+now the hard variables...
+each string replace thingy must look losmething like this...
+file(X)start(line(...)...)end(line(...)...) or file(X)wholeline(line(...))
+confused? good :)
+
+file(X) <- choose which file to read from
+start(...) and/or end(...) must follow. You can use both, or only 1 of them. If you use both start MUST be before end.. (obvious???).
+OR you can follow file() with wholeline(line(...)), which as u can guess will display the entire line.
+
+So, how does start(...) and end() work?
+... Like this...
+start(line(...)X) where X is either a number, or s string in "" marks, or the csv() variable. (we will get to the line() part in a minute).
+ - If X a number then it will start or finish copying from the Xth character in the line (remember, 0 is the frst char).
+ - If X is a string inside "" marks, then the line will be searched for the string and either start or stop copying depening if you are in start() or end().
+ - If X is csv(seperatorY) then the line is expected a comma seperated variable list (or similar). the seperator must either be "tab" (for tab seperated list), "space" (for space seperated list), or any SINGLE character (e.g , or ;). and Y is which variable to start or finish copying from
+simple isnt it? *head falls off in fit of laughter*
+
+Now ill explain the line(...) var and then show some examples
+line(...) is very similar to start() and end() with some slight changes...
+line(X) where X is a number, string in "" marks, or lastline(...)
+ - If X is a number then the rest of the start() or end() or wholeline() will use the Xth line of the file (remember 0 is the first line)
+ - If X is a string it will search through the file (starting from the first line if in start() or wholeline() OR the line used by start() if in end() and will use the first line with the string if it is found.
+ - You can add a +Y or -Y after the closing ) to go Y lines up (- sign) or down (+ sign) from the line found (e.g ...line("hello")+5... will find the word hello and use the 5ht line after it)
+ - If X is lastline(Y) then it will use the line Y lines up from the last line of the file. (e.g 0 or blank is the very last line of the file, 1 is the 2nd last line etc...)
+
+and thats it.... so lets c some examples...
+.
+filename(0) <- will display the filename of the 0th file
+
+file(0)wholeline(line(0)) <- will display the whole first line of the 0th file
+
+file(0)wholeline(line("hello")-1)) <- the wholeline above the first occurance of \"hello\" in the file
+
+file(0)start(line(lastline(1))csv(tab2))end(line(lastline())csv(tab4)) <- starts at the 2nd last line of the file, from the 2nd tab variable, untill the 4th tab variable in the last line (in the 0th file)
+
+file(0)start(line("hello")+1"zzzz")end(line(6)17)) <- starts from the first occurance of zzzz in the line after the first occurance of hello, untill the 17th character in the 6th line (starting from line 0) of the 0th file.
+
+i plan on adding regexp ability and some other vars (tell me what u want...)
+EVERY EDITABLE TEXT FIELD (EXCEPT GROUP FIELD) CAN USE THESE STRINGS
+
+The Copy Contact Dialog
+-----------------------
+Since the oriognal text reader (plugin this is based on, no longer available..) i wanted to be able to copy a contact easily, so this is how you do it.
+The Edit box in this window lets you automatically change any string in the new contact. i.e this lets you change all occurances of %fn2 to %fn3 in the contacts settings (i.e their name, tooltip, etc).
+the way you do is like this. if you want to change fn2 to fn3 you type fn2,fn3 in the box. ONE PER LINE... and make sure you dont forget the , or miranda may crash, and WILL KILL YOUR DB IF IT DOES.
+You can do a maximum of 15 of the replaces.
+
+press Copy Non-IM Contact to copy with the replaced strings.
+
+To export the single contact to a txt file press export contact. (you cant import contacts yet, but ill add that soon..ish)
+
+ToolTip stuff
+--------------
+OK.. if you want to actually use the "ToolTip" field then you'll need either mToolTip or another tooltip plugin.
+NimC copies the string (after having all the variables replaced) from the "ToolTip" field into the Notes field in the contacts User Details window. in mToolTip use the variable %notes to display this.
+NimC also copies the program (or link) that the contact points to when you double click it as the contacts First Name field in the contacts User Details window. in mToolTip use the variable %first to display this.
+
+
+Contact Status Icon
+-------------------
+I have included all available statuses so you can seperate contacts by thier status icons, and so you can quickly differentiate between different "types" of contacts (by this i mean, you can set all web links to one icon, and all local folders to another, etc.)
+BUT...
+- ONLINE icon - this contact will always be displayed as online unless the plugin's status is set to offline
+- AWAY icon - same as online (unless u choose to use away as any other status, i.e contacts wont be online if not set to away)
+- all other icons means only display this contact if the plugins' status is set to that status or set to away or online.
+
+Plugin Status's
+---------------
+If the plugins' status is:
+- ONLINE - all contacts are displayed and the timer is ON (so names get updates)
+- AWAY - all contacts are displayed and the timer is OFF (so names dont get updates ... unless u choose to use away as any other status)
+- OFFLINE - all contacts are displayed as offline and the timer is OFF (so names dont get updates)
+- other - only contacts set to online, away or the set status are shown as not offline and the timer is ON (so names get updates)
+
+
+Last Minute Stuff To Remember
+-----------------------------
+- If you hold CTRL down when you double click a contact it will open the contacts settings (this also happens if no link is set)
+- the file(X) variable is "global" in that all contacts with file(X) will be reading the same file. this also means that if you remove the file(X) file from the list, then all other files will get pushed up and any contact with file(X) set will be reading the new file, not the one you were expecting.
+
+IMPORTANT NOTES ON WEB PAGES:
+-----------------------------
+- in the files tab you can enter urls into the URL box, it must be the full url.. i.e http://www.miranda-im.org/ (nothing happens if the url doesnt work)
+- web pages can then be used as any of file.
+- the files are downloaded into the \plugins dir with the filename fnX.html where X is the %fn number in the plugin. im lazy and want to get this release out so the files arent deleted when u remove the link yet. (soz)
+
+
+Todo list
+---------
+- fix any mistakes with the string replacing (i dont know if there are any :) )
+- add a program schedular to execute the scripts before updating the contacts' names
+- suggestions?
+
+Change-log
+-----------
+0.1
+- Initial public release.. pretty much everything works
+
+0.1.1
+- fixed some stupid bugs (the timer actually works now, and it wont crash if you stuff up the string to replace (hopefully))
+- made it ignore global status change
+
+0.2
+- added heaps of code to hopefully eliminate most of the crashes
+ - files tab wont crash anymore if the file is too long
+ - wont crash if you try to make a string too long (hard-coded max to 10000 chars which should be big enough)
+- added support for web pages
+
+0.2.0.1
+- fixed it so it returns to the previous status when you start miranda
+- fixed it so only status changes to Non-IM contacts protocol change the status
+- fixed it so that you can change the timer for the web pages in the files tab (change the number and press apply)
+- did a big plug on the overclockers australia forums :) (http://www.overclockers.com.au)
+
+0.2.0.2
+- removed the startup status thing to hopefully finally fix the status changing bugs.. if you want to have it start with a status use the startupstatus plugin
+- fixed it so nconvers doesnt popup its msg dialoge when you double click a Non-IM Contact
+
+0.3
+- added multi-threading support so it doesnt freeze miranda while it waits for the websites to download. (thans Matrix)
+- added ability to import/export/copy contacts
+
+0.3.1
+- sorry, didnt do enouhg testing again and the fiiles tab vanished...
+
+0.3.2.1
+- added %csv variable
+- fixed status changing bug (hopefully the last 1)
+- fixed timer so it works again
+- fixed the contact copying
+- fixed a crash when you want to show the tooltip for the contact
+- got the menu items where i want them
+
+0.4
+- changed the vairable system
+- added multi-threading so miranda doesnt freeze while it updates web sites (thanx Matrix and noname)
+- removed contact importing coz i wanted to release this build but importing needed a rewrite and i cbf...
+- added a String Maker window to help make strings to get replaced.. (with a kewl display that tells youn which variable you are in..)
+- timer _MAY_ be a bit screwy if we pages dont update fast enough, but shouldnt...
+- added options dialog
+- fixed status changing bug (hopefully the last 1.. again)
+
+0.4.0.1
+-fixed the timer..
+
+0.4.1.0
+- fixed a bug where the files tab would crash if more than 10 files were loaded. (now wont crash untill 1000 files are loaded)
+- added the "NIM_Contact/DoubleClick" service for other devs if they want to simulate a double click on a non-im contact. (wparam=hcontact, lparam=0)
+- added some error-checking to the string replacing code so it doesnt crash..
+
+0.5
+- added 6 new variables..
+- fixed some minor stuff
+- new stanslation strings...
+
+0.5.0.1
+- fixed bug where you couldnt add new contacts if u are running the mwclist.dll plugin
+- fixed the netlib code so its not naughty...
+Translation strings
+--------------------
+im pretty sure i havn't set up all the strings as translatable, so if i miss any, email or msg me on the forums and ill fix it.
+this is the lot....
+
+New strings for 0.5
+[lastchecked(file(]
+[loadN(\"]
+[load(\"]
+[saveN(\"]
+[save[(\"]
+{compare(\"]
+
+
+
+[Select Folder]
+[New Non-IM Contact]
+[File couldn't be opened]
+[line(%-3d) = | %s]
+[Non-IM Contacts]
+[&Non-IM Contact]
+[&Add Non-IM Contact]
+[&View/Edit Files]
+[&Export all Non-IM Contacts]
+[&Import Non-IM Contacts] <- will be back in the next release...
+[&String Maker]
+[E&dit Contact Settings]
+[(\"]
+[\")]
+[lastline(]
+[csv(]
+[file(]
+[wholeline(line(]
+[start(]
+[start(line(]
+[end(]
+[end(line(]
+[filename(]
+[%s - ERROR: no line specified or line not found (in %s)]
+[%s - ERROR: file couldnt be opened (in %s)]
+[%s - ERROR: no file specified in settings (in %s)]
+[String replacing variables....\r\nThe following are all the valid variables that can be used. Refer to the readme for a proper explanation.\r\n\r\n]
+[file(X)\t\t<- specifies the file to read from\r\nMUST be followed by either start() or end() or wholeline()\r\n]
+[filename(X)\t\t<- copyies the filename of file X.\r\n]
+[start(...)\t\t<-specifies where to start copying from.\r\n]
+[end(...)\t\t<-specifies where to stop copying.\r\n]
+[wholeline(line(...))\t<-specifies a whole line to copy\r\n\r\n]
+[start() and end() explained\r\n.........................\r\n]
+[MUST start with line() followed by a number or a string inside \" marks, OR csv(seperatorX) variable\r\n]
+[The number specifies which character in the line to start/end copying.\r\nThe string specifies a string in the line to start/end copying.\r\n]
+[csv(seperatorX) explained...\r\nseperator is either \"tab\" or \"space\" or any SINGLE character.\r\nX is the Xth seperator to pass before copying, (or to stop before)\r\n\r\n]
+[Lastly the line(...) variable...\r\n]
+[Inside the brackets must be either a number (to specify the line number), or a string inside \" marks (to use the line with that string), or lastline(X).\r\nthe X in lastline is the Xth line above the last line. i.e lastline(1) will use the 2nd last line of the file.\r\n]
+[If searching for a line with u may put a + or - X after the closing ) i.e line(\"some words\")+3 to go 3 lines after the line with \"some words\".\r\n\r\n]
+[Some Expamples...\r\n\r\n]
+[filename(0) <- will display the filename of the 0th file\r\nfile(0)wholeline(line(0))) <- will display the whole first line of the 0th file\r\nfile(0)wholeline(line(\"hello\")-1))) <- the wholeline above the first occurance of \"hello\" in the file\r\nfile(0)start(line(lastline(1))csv(tab2))end(line(lastline())csv(tab4))) <- starts at the 2nd last line of the file, from the 2nd tab variable, untill the 4th tab variable in the last line (in the 0th file)\r\nfile(0)start(line(\"hello\")+1\"zzzz\")end(line(6)17)) <- starts from the first occurance of zzzz in the line after the first occurance of hello, untill the 17th character in the 6th line (starting from line 0) of the 0th file.\r\n]
diff --git a/plugins/Non-IM Contact/docs/todo.txt b/plugins/Non-IM Contact/docs/todo.txt
new file mode 100644
index 0000000000..4fb4ffe442
--- /dev/null
+++ b/plugins/Non-IM Contact/docs/todo.txt
@@ -0,0 +1,29 @@
+file() vars
+ plain number
+ ??????
+
+line() vars
+ plain number
+ lastline(X)... where X is the number of lines above the last i.e 0 is last, 1 is second last
+ "Word"...
+ random... between 0 and LinesInFile-1 ?????
+
+print()
+ wholeline(line()).. line as above
+ start()
+ number (first char to start coping from)
+ line()
+ "" ... find the word inside
+ csv(line()seperator()) seperator is any single CHAR and "space" or "tab" without ""'s
+ end()
+ same as start
+
+
+- ignore global status change
+- only show contacts with protocols visibility (i.e if nimc is set to dnd then only contacts with dnd will be shown) and somehow an option to reverse this...
+- a fwe other hidden options which no1 else but me knows about... :D
+- hide the protocol status icon in the status menu.. (may as well c how hard it is to add...)
+- treat away as another status. (i.e not the same as online where the contacts r always online)
+- never allow timer
+
+ \ No newline at end of file
diff --git a/plugins/Non-IM Contact/nimcontact_10.vcxproj b/plugins/Non-IM Contact/nimcontact_10.vcxproj
new file mode 100644
index 0000000000..0147a23d41
--- /dev/null
+++ b/plugins/Non-IM Contact/nimcontact_10.vcxproj
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>NimContact</ProjectName>
+ <ProjectGuid>{A556E0B5-73A1-4676-BA1F-133820DE7D5A}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary>true</IgnoreImportLibrary>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <Optimization>Full</Optimization>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>true</MinimalRebuild>
+ <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <ExceptionHandling>false</ExceptionHandling>
+ <PrecompiledHeaderFile>commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <LinkDLL>true</LinkDLL>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <BaseAddress>0x30040000</BaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
+ <AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <Optimization>Disabled</Optimization>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>true</MinimalRebuild>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <ExceptionHandling>false</ExceptionHandling>
+ <PrecompiledHeaderFile>commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <LinkDLL>true</LinkDLL>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <BaseAddress>0x30040000</BaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <Optimization>Full</Optimization>
+ <WarningLevel>Level3</WarningLevel>
+ <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <ExceptionHandling>false</ExceptionHandling>
+ <PrecompiledHeaderFile>commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <LinkDLL>true</LinkDLL>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <BaseAddress>0x30040000</BaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
+ <AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <Optimization>Disabled</Optimization>
+ <WarningLevel>Level3</WarningLevel>
+ <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <ExceptionHandling>false</ExceptionHandling>
+ <PrecompiledHeaderFile>commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <LinkDLL>true</LinkDLL>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <BaseAddress>0x30040000</BaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="src\commonheaders.h" />
+ <ClInclude Include="src\resource.h" />
+ <ClInclude Include="src\Version.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="res\resource.rc" />
+ <ResourceCompile Include="res\Version.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="src\contactinfo.cpp" />
+ <ClCompile Include="src\dialog.cpp" />
+ <ClCompile Include="src\files.cpp" />
+ <ClCompile Include="src\http.cpp" />
+ <ClCompile Include="src\main.cpp" />
+ <ClCompile Include="src\namereplacing.cpp" />
+ <ClCompile Include="src\services.cpp" />
+ <ClCompile Include="src\stdafx.cpp">
+ <PrecompiledHeader>Create</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="src\timer.cpp" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/plugins/Non-IM Contact/nimcontact_10.vcxproj.filters b/plugins/Non-IM Contact/nimcontact_10.vcxproj.filters
new file mode 100644
index 0000000000..d26dfe6647
--- /dev/null
+++ b/plugins/Non-IM Contact/nimcontact_10.vcxproj.filters
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{08a21636-368d-4feb-8d0d-0a27f237e1a2}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{9e6f20dc-3391-4299-9f74-e91d4f984ad3}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{18fd6180-ebb2-4558-b945-c4dac823f11b}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="src\resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\Version.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\commonheaders.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="res\Version.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ <ResourceCompile Include="res\resource.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="src\stdafx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\contactinfo.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\dialog.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\files.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\http.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\main.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\namereplacing.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\services.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\timer.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/plugins/Non-IM Contact/nimcontact_11.vcxproj b/plugins/Non-IM Contact/nimcontact_11.vcxproj
new file mode 100644
index 0000000000..21867e454e
--- /dev/null
+++ b/plugins/Non-IM Contact/nimcontact_11.vcxproj
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>NimContact</ProjectName>
+ <ProjectGuid>{A556E0B5-73A1-4676-BA1F-133820DE7D5A}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary>true</IgnoreImportLibrary>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <Optimization>Full</Optimization>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>true</MinimalRebuild>
+ <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <ExceptionHandling>false</ExceptionHandling>
+ <PrecompiledHeaderFile>commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <LinkDLL>true</LinkDLL>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <BaseAddress>0x30040000</BaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
+ <AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <Optimization>Disabled</Optimization>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>true</MinimalRebuild>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <ExceptionHandling>false</ExceptionHandling>
+ <PrecompiledHeaderFile>commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <LinkDLL>true</LinkDLL>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <BaseAddress>0x30040000</BaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <Optimization>Full</Optimization>
+ <WarningLevel>Level3</WarningLevel>
+ <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <ExceptionHandling>false</ExceptionHandling>
+ <PrecompiledHeaderFile>commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <LinkDLL>true</LinkDLL>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <BaseAddress>0x30040000</BaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
+ <AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <Optimization>Disabled</Optimization>
+ <WarningLevel>Level3</WarningLevel>
+ <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <ExceptionHandling>false</ExceptionHandling>
+ <PrecompiledHeaderFile>commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <LinkDLL>true</LinkDLL>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <BaseAddress>0x30040000</BaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="src\commonheaders.h" />
+ <ClInclude Include="src\resource.h" />
+ <ClInclude Include="src\Version.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="res\resource.rc" />
+ <ResourceCompile Include="res\Version.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="src\contactinfo.cpp" />
+ <ClCompile Include="src\dialog.cpp" />
+ <ClCompile Include="src\files.cpp" />
+ <ClCompile Include="src\http.cpp" />
+ <ClCompile Include="src\main.cpp" />
+ <ClCompile Include="src\namereplacing.cpp" />
+ <ClCompile Include="src\services.cpp" />
+ <ClCompile Include="src\stdafx.cpp">
+ <PrecompiledHeader>Create</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="src\timer.cpp" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/plugins/Non-IM Contact/nimcontact_11.vcxproj.filters b/plugins/Non-IM Contact/nimcontact_11.vcxproj.filters
new file mode 100644
index 0000000000..d26dfe6647
--- /dev/null
+++ b/plugins/Non-IM Contact/nimcontact_11.vcxproj.filters
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{08a21636-368d-4feb-8d0d-0a27f237e1a2}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{9e6f20dc-3391-4299-9f74-e91d4f984ad3}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{18fd6180-ebb2-4558-b945-c4dac823f11b}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="src\resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\Version.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\commonheaders.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="res\Version.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ <ResourceCompile Include="res\resource.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="src\stdafx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\contactinfo.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\dialog.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\files.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\http.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\main.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\namereplacing.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\services.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\timer.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/plugins/Non-IM Contact/res/Version.rc b/plugins/Non-IM Contact/res/Version.rc
new file mode 100644
index 0000000000..5bfbab4754
--- /dev/null
+++ b/plugins/Non-IM Contact/res/Version.rc
@@ -0,0 +1,38 @@
+// Microsoft Visual C++ generated resource script.
+//
+#ifdef APSTUDIO_INVOKED
+#error this file is not editable by Microsoft Visual C++
+#endif //APSTUDIO_INVOKED
+
+#include "afxres.h"
+#include "..\src\version.h"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION __FILEVERSION_STRING
+ PRODUCTVERSION __FILEVERSION_STRING
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x0L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "000004b0"
+ BEGIN
+ VALUE "FileDescription", __DESCRIPTION
+ VALUE "InternalName", __PLUGIN_NAME
+ VALUE "LegalCopyright", __COPYRIGHT
+ VALUE "OriginalFilename", __FILENAME
+ VALUE "ProductName", __PLUGIN_NAME
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0, 1200
+ END
+END
diff --git a/plugins/Non-IM Contact/res/nimc.jpg b/plugins/Non-IM Contact/res/nimc.jpg
new file mode 100644
index 0000000000..bd345bfb62
--- /dev/null
+++ b/plugins/Non-IM Contact/res/nimc.jpg
Binary files differ
diff --git a/plugins/Non-IM Contact/res/resource.rc b/plugins/Non-IM Contact/res/resource.rc
new file mode 100644
index 0000000000..0385c90289
--- /dev/null
+++ b/plugins/Non-IM Contact/res/resource.rc
@@ -0,0 +1,356 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "../src/resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ADD_FILE DIALOG DISCARDABLE 0, 0, 283, 190
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION |
+ WS_SYSMENU
+CAPTION "View/Edit Files"
+FONT 8, "MS Sans Serif"
+BEGIN
+ COMBOBOX IDC_FILE_LIST,49,4,227,99,CBS_DROPDOWNLIST |
+ CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ EDITTEXT IDC_URL,26,20,250,12,ES_AUTOHSCROLL
+ EDITTEXT IDC_WWW_TIMER,69,37,30,12,ES_NUMBER
+ PUSHBUTTON "Add File",IDC_ADD_FILE,201,37,34,12
+ PUSHBUTTON "Add URL",IDC_ADD_URL,237,37,39,12
+ PUSHBUTTON "Remove Selected File",IDC_DEL_FILE,202,52,74,12
+ LISTBOX IDC_FILE_CONTENTS,4,70,272,113,LBS_NOINTEGRALHEIGHT |
+ LBS_DISABLENOSCROLL | WS_VSCROLL | WS_HSCROLL |
+ WS_TABSTOP
+ LTEXT "file(#)",IDC_STATIC,4,6,18,8
+ EDITTEXT IDC_FN,26,4,16,12,ES_READONLY | ES_NUMBER
+ LTEXT "URL",IDC_STATIC,4,22,16,8
+ LTEXT "Update URL every",IDC_STATIC,4,39,60,8
+ LTEXT "Intervals",IDC_STATIC,105,39,28,8
+ LTEXT "If the protocol timer is disabled web pages wont be updated",
+ IDC_STATIC,4,52,188,8
+END
+
+IDD_CONTACT_INFO DIALOG DISCARDABLE 0, 0, 283, 190
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "contact display info"
+FONT 8, "MS Sans Serif"
+BEGIN
+ EDITTEXT IDC_DISPLAY_NAME,88,6,188,12,ES_AUTOHSCROLL
+ EDITTEXT IDC_TOOLTIP,7,40,269,143,ES_MULTILINE | ES_AUTOVSCROLL |
+ ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL
+ LTEXT "Contacts display name",IDC_STATIC,7,8,72,8
+ LTEXT "Contacts Tooltip",IDC_STATIC,7,26,52,8
+END
+
+IDD_OTHER_STUFF DIALOG DISCARDABLE 0, 0, 283, 190
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "other settings"
+FONT 8, "MS Sans Serif"
+BEGIN
+ LTEXT "Link",IDC_STATIC,12,18,14,8
+ EDITTEXT IDC_LINK,39,16,233,12,ES_AUTOHSCROLL
+ LTEXT "Program parameters:",IDC_STATIC,12,33,66,8
+ EDITTEXT IDC_PARAMS,91,31,181,12,ES_AUTOHSCROLL
+ PUSHBUTTON "O&pen File",IDC_OPEN_FILE,161,47,50,14
+ PUSHBUTTON "O&pen Folder",IDC_OPEN_FOLDER,222,47,50,14
+ GROUPBOX "Link Settings",IDC_STATIC,7,4,269,60
+ GROUPBOX "CList Settings",IDC_STATIC,7,68,269,64
+ COMBOBOX IDC_GROUP,39,79,161,74,CBS_DROPDOWN | CBS_AUTOHSCROLL |
+ CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "",CHK_ONLINE,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE |
+ WS_TABSTOP,58,95,16,16
+ CONTROL "",CHK_AWAY,"Button",BS_AUTORADIOBUTTON | BS_ICON |
+ BS_PUSHLIKE | WS_TABSTOP,77,95,16,16
+ CONTROL "",CHK_NA,"Button",BS_AUTORADIOBUTTON | BS_ICON |
+ BS_PUSHLIKE | WS_TABSTOP,96,95,16,16
+ CONTROL "",CHK_OCC,"Button",BS_AUTORADIOBUTTON | BS_ICON |
+ BS_PUSHLIKE | WS_TABSTOP,115,95,16,16
+ CONTROL "",CHK_DND,"Button",BS_AUTORADIOBUTTON | BS_ICON |
+ BS_PUSHLIKE | WS_TABSTOP,134,95,16,16
+ CONTROL "",CHK_FFC,"Button",BS_AUTORADIOBUTTON | BS_ICON |
+ BS_PUSHLIKE | WS_TABSTOP,153,95,16,16
+ CONTROL "",CHK_INVISIBLE,"Button",BS_AUTORADIOBUTTON | BS_ICON |
+ BS_PUSHLIKE | WS_TABSTOP,172,95,16,16
+ CONTROL "",CHK_PHONE,"Button",BS_AUTORADIOBUTTON | BS_ICON |
+ BS_PUSHLIKE | WS_TABSTOP,191,95,16,16
+ CONTROL "",CHK_LUNCH,"Button",BS_AUTORADIOBUTTON | BS_ICON |
+ BS_PUSHLIKE | WS_TABSTOP,210,95,16,16
+ LTEXT "Group:",IDC_STATIC,12,81,22,8
+ LTEXT "Status Icon",IDC_STATIC,12,99,37,8
+ LTEXT "Group\\Sub-Group",IDC_STATIC,211,81,61,8
+ GROUPBOX "Timer Settings",IDC_STATIC,7,139,269,44
+ CONTROL "Use Timer",CHK_USE_TIMER,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,12,148,48,10
+ EDITTEXT IDC_TIMER,22,162,35,12,ES_NUMBER | WS_DISABLED
+ CONTROL "Contact is always visible",IDC_ALWAYS_VISIBLE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,12,115,92,10
+ CONTROL "Unless Non-IM Contacts protocol is OFFLINE",
+ IDC_VISIBLE_UNLESS_OFFLINE,"Button",BS_AUTOCHECKBOX |
+ WS_DISABLED | WS_TABSTOP,112,115,158,10
+ LTEXT "Timer Intervals. ",IDC_TIMER_INTERVAL_MSG,61,166,205,8
+END
+
+IDD_OPTIONS DIALOG DISCARDABLE 0, 0, 291, 180
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Dialog"
+FONT 8, "MS Sans Serif"
+BEGIN
+ CONTROL "Ignore global status change",IDC_IGNORE_GLOBALSTATUS,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,28,103,10
+ CONTROL "Away as another status",IDC_AWAYISNOTONLINE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,7,42,89,10
+ CONTROL "Disable timer",IDC_DISABLETIMER,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,99,56,10
+ LTEXT "Timer interval (in seconds)",IDC_TIMER_TEXT,13,111,83,8
+ EDITTEXT IDC_TIMER_INT,102,109,20,12,ES_NUMBER
+ LTEXT "This will take affect after Non-IM Contacts' status is changed",
+ IDC_TIMER_MSG,13,123,192,8
+ GROUPBOX "Timer Options",IDC_STATIC,7,87,277,49
+END
+
+IDD_TEST_LINE DIALOG DISCARDABLE 0, 0, 435, 119
+STYLE DS_MODALFRAME | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE |
+ WS_CAPTION | WS_SYSMENU
+CAPTION "String Maker"
+FONT 8, "MS Sans Serif"
+BEGIN
+ EDITTEXT IDC_STRING,15,17,409,14,ES_AUTOHSCROLL
+ DEFPUSHBUTTON "&Test String",IDOK,385,56,43,14
+ PUSHBUTTON "&Exit",IDCANCEL,385,92,43,14
+ GROUPBOX "String to test",IDC_STATIC,7,7,421,41
+ GROUPBOX "Returns....",IDC_STATIC,7,51,371,61
+ EDITTEXT IDC_ANSWER,15,62,353,43,ES_MULTILINE | ES_AUTOHSCROLL |
+ ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL
+ LTEXT "line()",IDC_LINE,73,36,16,8,WS_DISABLED
+ LTEXT "start()",IDC_START,32,36,18,8,WS_DISABLED
+ LTEXT "end()",IDC_END,53,36,17,8,WS_DISABLED
+ LTEXT "wholeline()",IDC_WHOLELINE,111,36,34,8,WS_DISABLED
+ LTEXT "csv()",IDC_CSV,92,36,16,8,WS_DISABLED
+ LTEXT "file()",IDC_FILE,15,36,14,8,WS_DISABLED
+ LTEXT "filename()",IDC_FILENAME,148,36,31,8,WS_DISABLED
+ PUSHBUTTON "Help",IDC_HELPMSG,385,73,43,14
+END
+
+IDD_HELP DIALOG DISCARDABLE 0, 0, 280, 161
+STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | DS_CENTERMOUSE |
+ WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Help!!!"
+FONT 8, "MS Sans Serif"
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,223,140,50,14
+ EDITTEXT IDC_HELPTEXT,7,7,266,128,ES_MULTILINE | ES_READONLY |
+ WS_VSCROLL | WS_HSCROLL
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE
+BEGIN
+ IDD_ADD_FILE, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 276
+ VERTGUIDE, 26
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 183
+ HORZGUIDE, 4
+ HORZGUIDE, 26
+ HORZGUIDE, 37
+ HORZGUIDE, 43
+ HORZGUIDE, 52
+ END
+
+ IDD_CONTACT_INFO, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 276
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 183
+ HORZGUIDE, 12
+ HORZGUIDE, 34
+ END
+
+ IDD_OTHER_STUFF, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 276
+ VERTGUIDE, 12
+ VERTGUIDE, 39
+ VERTGUIDE, 272
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 183
+ HORZGUIDE, 22
+ HORZGUIDE, 37
+ HORZGUIDE, 47
+ HORZGUIDE, 85
+ HORZGUIDE, 103
+ HORZGUIDE, 120
+ HORZGUIDE, 149
+ HORZGUIDE, 174
+ END
+
+ IDD_OPTIONS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 284
+ VERTGUIDE, 13
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 173
+ HORZGUIDE, 99
+ HORZGUIDE, 115
+ END
+
+ IDD_TEST_LINE, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 428
+ VERTGUIDE, 15
+ VERTGUIDE, 385
+ VERTGUIDE, 424
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 112
+ HORZGUIDE, 36
+ END
+
+ IDD_HELP, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 273
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 154
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_MAIN ICON DISCARDABLE "star8.ico"
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (Australia) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENA)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_CONTACT_COPYEXPORT DIALOG DISCARDABLE 0, 0, 283, 190
+STYLE DS_MODALFRAME | WS_CHILD | WS_CAPTION | WS_SYSMENU
+CAPTION "Copy / Export contact"
+FONT 8, "MS Sans Serif"
+BEGIN
+ EDITTEXT IDC_STRING_REPLACE,13,43,254,108,ES_MULTILINE |
+ ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL
+ PUSHBUTTON "&Export Non-IM Contact",IDC_EXPORT,13,159,94,14
+ PUSHBUTTON "Co&py Non-IM Contact",IDC_DOIT,173,159,94,14
+ GROUPBOX "",IDC_STATIC,7,7,269,176
+ CONTROL "Type one replace string per line in the format ""origional text,new text""",
+ IDC_STATIC,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,13,18,
+ 243,10
+ LTEXT "EXAMPLE: %fn1,%fn2",IDC_STATIC,13,31,71,8
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE
+BEGIN
+ IDD_CONTACT_COPYEXPORT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 276
+ VERTGUIDE, 13
+ VERTGUIDE, 267
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 183
+ HORZGUIDE, 159
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+#endif // English (Australia) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/Non-IM Contact/res/star8.ico b/plugins/Non-IM Contact/res/star8.ico
new file mode 100644
index 0000000000..a4953cd753
--- /dev/null
+++ b/plugins/Non-IM Contact/res/star8.ico
Binary files differ
diff --git a/plugins/Non-IM Contact/src/Version.h b/plugins/Non-IM Contact/src/Version.h
new file mode 100644
index 0000000000..ae84abc336
--- /dev/null
+++ b/plugins/Non-IM Contact/src/Version.h
@@ -0,0 +1,14 @@
+#define __MAJOR_VERSION 0
+#define __MINOR_VERSION 6
+#define __RELEASE_NUM 0
+#define __BUILD_NUM 1
+
+#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
+
+#define __PLUGIN_NAME "Non-IM Contact"
+#define __FILENAME "NimContact.dll"
+#define __DESCRIPTION "Non-IM Contact allows you to add 'contacts' that can act as shortcuts to other programs, or links to web pages.\r\nThe contacts name can be read from a text file (includes any ASCII file).\r\nThis plugin is a combination of Favorites and Text Reader plugins both made by me)"
+#define __AUTHOR "Jonathan Gordon"
+#define __AUTHOREMAIL "ICQ 98791178, MSN jonnog@hotmail.com"
+#define __AUTHORWEB "http://miranda-ng.org/"
+#define __COPYRIGHT "© 2003-2004 Jonathan Gordon, jdgordy@gmail.com"
diff --git a/plugins/Non-IM Contact/src/commonheaders.h b/plugins/Non-IM Contact/src/commonheaders.h
new file mode 100644
index 0000000000..a512a40b06
--- /dev/null
+++ b/plugins/Non-IM Contact/src/commonheaders.h
@@ -0,0 +1,128 @@
+//=====================================================
+// Includes (yea why not include lots of stuff :p )
+//=====================================================
+#ifndef COMMONHEADERS
+#define COMMONHEADERS
+
+#define _CRT_SECURE_NO_WARNINGS
+
+#include <windows.h>
+#include <commctrl.h>
+#include <winsock.h>
+#include <shlobj.h>
+
+#include <stdio.h>
+#include <time.h>
+#include <stddef.h>
+#include <process.h>
+#include <string.h>
+
+struct DLGTEMPLATEEX
+{
+ WORD dlgVer;
+ WORD signature;
+ DWORD helpID;
+ DWORD exStyle;
+ DWORD style;
+ WORD cDlgItems;
+ short x;
+ short y;
+ short cx;
+ short cy;
+};
+
+#include <newpluginapi.h>
+#include <m_clist.h>
+#include <m_clui.h>
+#include <m_skin.h>
+#include <m_langpack.h>
+#include <m_protomod.h>
+#include <m_database.h>
+#include <m_system.h>
+#include <m_protocols.h>
+#include <m_userinfo.h>
+#include <m_options.h>
+#include <m_protosvc.h>
+#include <m_utils.h>
+#include <m_ignore.h>
+#include <m_clc.h>
+#include <m_netlib.h>
+#include <win2k.h>
+
+#include "resource.h"
+
+//=======================================================
+// Definitions
+//=======================================================
+#define MODNAME "NIM_Contact"
+#define modFullname "Non-IM Contact"
+#define MAXLINES 10000
+#define MAX_STRING_LENGTH 10000
+#define LINE_LENGTH 10000
+#define msg(a,b) MessageBoxA(0,a,b,MB_OK);
+#define TIMER (db_get_w(NULL, MODNAME, "Timer", 1) * 1000)
+/* ERROR VALUES */
+#define ERROR_NO_LINE_AFTER_VAR_F -1
+#define ERROR_LINE_NOT_READ -2
+#define ERROR_NO_FILE -3
+
+//=======================================================
+// Defines
+//=======================================================
+//General
+extern HINSTANCE hInst;
+extern int LCStatus;
+static HANDLE hWindowList=NULL;
+
+//Services.c
+INT_PTR GetLCCaps(WPARAM wParam,LPARAM lParam);
+INT_PTR GetLCName(WPARAM wParam,LPARAM lParam);
+INT_PTR LoadLCIcon(WPARAM wParam,LPARAM lParam);
+int SetLCStatus(WPARAM wParam,LPARAM lParam);
+INT_PTR GetLCStatus(WPARAM wParam,LPARAM lParam);
+
+// dialog.c
+INT_PTR addContact(WPARAM wParam,LPARAM lParam) ;
+INT_PTR editContact(WPARAM wParam,LPARAM lParam);
+INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR testStringReplacer(WPARAM wParam, LPARAM lParam);
+INT_PTR LoadFilesDlg(WPARAM wParam, LPARAM lParam);
+
+
+// files.c
+int Openfile(char* outputFile, int saveOpen);
+INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+int savehtml(char* outFile);
+char* getMimDir(char* file);
+INT_PTR exportContacts(WPARAM wParam,LPARAM lParam) ;
+
+// contactinfo.c
+INT_PTR CALLBACK DlgProcContactInfo(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+void ExportContact(HANDLE hContact);
+INT_PTR ImportContacts(WPARAM wParam, LPARAM lParam);
+
+// stringreplacer.c
+int stringReplacer(const char* oldString, char* newString, HANDLE hContact);
+void replaceAllStrings(HANDLE hContact);
+void WriteSetting(HANDLE hContact, char* module1, char* setting1 , char* module12, char* setting2);
+
+//timer.c
+extern UINT_PTR timerId;
+void CALLBACK timerProc();
+int startTimer(int interval);
+int killTimer();
+
+// http.c
+void NetlibInit();
+int InternetDownloadFile (CHAR *szUrl);
+extern char *szInfo;
+extern char *szData;
+extern HANDLE hNetlibUser;
+
+int db_get_static(HANDLE hContact, const char *moduleName, const char *fn, char *buf);
+
+#endif
+
+#pragma comment(lib,"comctl32.lib")
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp
new file mode 100644
index 0000000000..7b79a6c6f2
--- /dev/null
+++ b/plugins/Non-IM Contact/src/contactinfo.cpp
@@ -0,0 +1,707 @@
+#include "commonheaders.h"
+
+INT_PTR CALLBACK DlgProcContactInfo(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch(msg) {
+ case WM_INITDIALOG:
+ {
+ HANDLE hContact = (HANDLE)((PROPSHEETPAGE*)lParam)->lParam;
+ char name[2048];
+ TranslateDialogDefault(hwnd);
+ SetWindowLong(hwnd, GWLP_USERDATA, (LPARAM)(HANDLE)hContact);
+
+ if (!db_get_static(hContact, MODNAME, "Name", name)) break;
+ SetDlgItemTextA(hwnd, IDC_DISPLAY_NAME, name);
+ if (!db_get_static(hContact, MODNAME, "ToolTip", name)) break;
+ SetDlgItemTextA(hwnd, IDC_TOOLTIP, name);
+ }
+ return TRUE;
+
+ case WM_COMMAND:
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ return TRUE;
+
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ HANDLE hContact = (HANDLE)GetWindowLong(hwnd, GWLP_USERDATA);
+ if (GetWindowTextLength(GetDlgItem(hwnd,IDC_DISPLAY_NAME))) {
+ char text[512];
+ GetDlgItemTextA(hwnd,IDC_DISPLAY_NAME,text,sizeof(text));
+ db_set_s(hContact, MODNAME, "Name", text);
+ WriteSetting(hContact, MODNAME, "Name", MODNAME, "Nick");
+ }
+ else {
+ db_unset(hContact, MODNAME, "Name");
+ db_unset(hContact, MODNAME, "Nick");
+ }
+
+ if (GetWindowTextLength(GetDlgItem(hwnd,IDC_TOOLTIP))) {
+ char text[2048];
+ GetDlgItemTextA(hwnd,IDC_TOOLTIP,text,sizeof(text));
+ db_set_s(hContact, MODNAME, "ToolTip", text);
+ WriteSetting(hContact, MODNAME, "ToolTip", "UserInfo", "MyNotes");
+ }
+ else {
+ db_unset(hContact, MODNAME, "ToolTip");
+ db_unset(hContact, "UserInfo", "MyNotes");
+ }
+ }
+ return TRUE;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+static WNDPROC g_PrevBtnWndProc = 0;
+
+LRESULT CALLBACK ButtWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ LRESULT res = CallWindowProc(g_PrevBtnWndProc, hWnd, message, wParam, lParam);
+ if (WM_PAINT == message) {
+ RECT rc;
+ HDC dc = GetDC(hWnd);
+ BOOL isPressed = BST_CHECKED == SendMessage(hWnd, BM_GETCHECK, 0, 0);
+
+ GetClientRect(hWnd, &rc);
+ rc.left += (rc.right - rc.left - 16) / 2;
+ rc.top += (rc.bottom - rc.top - 16) / 2;
+ if (isPressed)
+ OffsetRect(&rc, 1, 1);
+ DrawIconEx(dc, rc.left, rc.top, (HICON)GetWindowLong(hWnd, GWLP_USERDATA),
+ 16, 16, 0, 0, DI_NORMAL);
+ ReleaseDC(hWnd, dc);
+ }
+
+ return res;
+}
+
+void checkGroups(char* group)
+{
+ int i;
+ char str[50], name[256];
+ DBVARIANT dbv;
+
+ if (lstrlenA(group) < 1)
+ return;
+
+ for (i = 0;; i++) {
+ _itoa(i, str, 10);
+ if (DBGetContactSetting(NULL, "CListGroups", str, &dbv))
+ break;
+
+ if (dbv.type == DBVT_ASCIIZ) {
+ if (dbv.pszVal[0] != '\0' && !lstrcmpiA(dbv.pszVal + 1, group)) {
+ db_free(&dbv);
+ return;
+ }
+
+ db_free(&dbv);
+ }
+ }
+ name[0] = 1 | GROUPF_EXPANDED;
+ strncpy(name + 1, group, sizeof(name) - 1);
+ name[strlen(group) + 1] = '\0';
+ db_set_s(NULL, "CListGroups", str, name);
+ CallService(MS_CLUI_GROUPADDED, i + 1, 0);
+}
+
+int BrowseForFolder(HWND hwnd,char *szPath)
+{
+ int result=0;
+
+ if (SUCCEEDED(OleInitialize(NULL))) {
+ LPMALLOC pMalloc;
+ if (SUCCEEDED(CoGetMalloc(1,&pMalloc))) {
+ mir_ptr<TCHAR> tszPath( mir_a2t(szPath));
+ BROWSEINFO bi={0};
+ bi.hwndOwner = hwnd;
+ bi.pszDisplayName = tszPath;
+ bi.lpszTitle = TranslateT("Select Folder");
+ bi.ulFlags = BIF_EDITBOX | BIF_RETURNONLYFSDIRS; // Use this combo instead of BIF_USENEWUI
+ bi.lParam = (LPARAM)szPath;
+
+ ITEMIDLIST *pidlResult = SHBrowseForFolder(&bi);
+ if (pidlResult) {
+ SHGetPathFromIDListA(pidlResult, szPath);
+ lstrcatA(szPath,"\\");
+ result = 1;
+ }
+ pMalloc->Free(pidlResult);
+ pMalloc->Release();
+ }
+ OleUninitialize();
+ }
+ return result;
+}
+
+INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch(msg) {
+ case WM_INITDIALOG:
+ {
+ int i = 0;
+ DBVARIANT dbv;
+ char string[512];
+ HANDLE hContact = (HANDLE)((PROPSHEETPAGE*)lParam)->lParam;
+ TranslateDialogDefault(hwnd);
+ SetWindowLong(hwnd, GWLP_USERDATA, (LPARAM)(HANDLE)hContact);
+ if (!hContact)
+ break;
+
+ /* link*/
+ if (db_get_static(hContact, MODNAME, "ProgramString", string))
+ SetDlgItemTextA(hwnd, IDC_LINK, string);
+ if (db_get_static(hContact, MODNAME, "ProgramParamsString", string))
+ SetDlgItemTextA(hwnd, IDC_PARAMS, string);
+ /* group*/
+ while (i != -1)
+ {
+ char str[3], name[256];
+ wsprintfA(str, "%d", i);
+ if (!DBGetContactSetting(NULL, "CListGroups", str, &dbv))
+ {
+ lstrcpynA(name,dbv.pszVal+1,sizeof(name));
+ SendMessage(GetDlgItem(hwnd, IDC_GROUP), CB_INSERTSTRING,0, (LPARAM)name);
+ i++;
+ }
+ else i = -1;
+ }
+ if (!DBGetContactSetting(hContact, "CList", "Group", &dbv))
+ SetDlgItemTextA(hwnd, IDC_GROUP, dbv.pszVal);
+
+ /* icons */
+ CheckRadioButton(hwnd, 40072, 40080, db_get_w(hContact, MODNAME, "Icon", ID_STATUS_ONLINE));
+ SetWindowLong(GetDlgItem(hwnd, CHK_ONLINE), GWLP_USERDATA, (LONG)LoadSkinnedProtoIcon(MODNAME, ID_STATUS_ONLINE));
+ g_PrevBtnWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwnd, CHK_ONLINE), GWLP_WNDPROC, (LONG)ButtWndProc);
+ for (i = ID_STATUS_ONLINE; i<=ID_STATUS_OUTTOLUNCH; i++) {
+ SetWindowLong(GetDlgItem(hwnd, i), GWLP_USERDATA, (LONG)LoadSkinnedProtoIcon(MODNAME, i));
+ SetWindowLong(GetDlgItem(hwnd, i), GWLP_WNDPROC, (LONG)ButtWndProc);
+ }
+ db_free(&dbv);
+ /* timer */
+ CheckDlgButton(hwnd, CHK_USE_TIMER, db_get_b(hContact, MODNAME ,"UseTimer", 0));
+ if (db_get_w(hContact, MODNAME ,"Timer", 15)) {
+ CheckDlgButton(hwnd, CHK_USE_TIMER,1);
+ EnableWindow(GetDlgItem(hwnd, IDC_TIMER), 1);
+ SetDlgItemTextA(hwnd, IDC_TIMER, _itoa(db_get_w(hContact, MODNAME ,"Timer", 15), string, 10));
+ if (!db_get_w(NULL, MODNAME ,"Timer", 1))
+ SetDlgItemTextA(hwnd,IDC_TIMER_INTERVAL_MSG, "Non-IM Contact protocol timer is Disabled");
+ else {
+ _snprintf(string, sizeof(string), "Timer intervals... Non-IM Contact Protocol timer is %d seconds",db_get_w(NULL, MODNAME ,"Timer", 1));
+ SetDlgItemTextA(hwnd,IDC_TIMER_INTERVAL_MSG, string);
+ }
+ }
+ /* always visible */
+ if (db_get_b(hContact, MODNAME ,"AlwaysVisible", 0)) {
+ CheckDlgButton(hwnd, IDC_ALWAYS_VISIBLE, 1);
+ EnableWindow(GetDlgItem(hwnd, IDC_VISIBLE_UNLESS_OFFLINE),1);
+ CheckDlgButton(hwnd, IDC_VISIBLE_UNLESS_OFFLINE, db_get_b(hContact, MODNAME ,"VisibleUnlessOffline", 1));
+ }
+ }
+ return TRUE;
+
+ case WM_COMMAND:
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ switch(LOWORD(wParam)) {
+ case IDC_ALWAYS_VISIBLE:
+ if (IsDlgButtonChecked(hwnd, IDC_ALWAYS_VISIBLE)) {
+ HANDLE hContact = (HANDLE)GetWindowLong(hwnd, GWLP_USERDATA);
+ EnableWindow(GetDlgItem(hwnd, IDC_VISIBLE_UNLESS_OFFLINE),1);
+ CheckDlgButton(hwnd, IDC_VISIBLE_UNLESS_OFFLINE, db_get_b(hContact, MODNAME ,"VisibleUnlessOffline", 1));
+ }
+ else EnableWindow(GetDlgItem(hwnd, IDC_VISIBLE_UNLESS_OFFLINE),0);
+ break;
+
+ case CHK_USE_TIMER:
+ if (IsDlgButtonChecked(hwnd, CHK_USE_TIMER)) {
+ HANDLE hContact = (HANDLE)GetWindowLong(hwnd, GWLP_USERDATA);
+ char string[4];
+ EnableWindow(GetDlgItem(hwnd, IDC_TIMER), 1);
+ SetDlgItemTextA(hwnd, IDC_TIMER, _itoa(db_get_w(hContact, MODNAME ,"Timer", 15), string, 10));
+ }
+ else EnableWindow(GetDlgItem(hwnd, IDC_TIMER), 0);
+ break;
+
+ case IDC_OPEN_FILE:
+ {
+ char szFileName[512];
+ if ( Openfile(szFileName,1))
+ SetDlgItemTextA(hwnd, IDC_LINK, szFileName);
+ }
+ break;
+
+ case IDC_OPEN_FOLDER:
+ {
+ char szFileName[512];
+ if (BrowseForFolder(hwnd, szFileName)) {
+ wsprintfA(szFileName, "%s ,/e", szFileName);
+ SetDlgItemTextA(hwnd, IDC_LINK, "explorer.exe");
+ SetDlgItemTextA(hwnd, IDC_PARAMS, szFileName);
+ }
+ }
+ }
+ break;
+
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ int status = GetLCStatus(0,0);
+ HANDLE hContact = (HANDLE)GetWindowLong(hwnd, GWLP_USERDATA);
+ int i;
+ if (GetWindowTextLength(GetDlgItem(hwnd,IDC_LINK)))
+ {
+ char text[512];
+ GetDlgItemTextA(hwnd,IDC_LINK,text,sizeof(text));
+ db_set_s(hContact, MODNAME, "ProgramString", text);
+ WriteSetting(hContact, MODNAME, "ProgramString", MODNAME, "Program");
+ }
+ else db_unset(hContact, MODNAME, "ProgramString");
+ if (GetWindowTextLength(GetDlgItem(hwnd,IDC_PARAMS)))
+ {
+ char text[512];
+ GetDlgItemTextA(hwnd,IDC_PARAMS,text,sizeof(text));
+ db_set_s(hContact, MODNAME, "ProgramParamsString", text);
+ WriteSetting(hContact, MODNAME, "ProgramParamsString", MODNAME, "ProgramParams");
+ }
+ else db_unset(hContact, MODNAME, "ProgramParamsString");
+ if (GetWindowTextLength(GetDlgItem(hwnd,IDC_GROUP)))
+ {
+ char text[512];
+ GetDlgItemTextA(hwnd,IDC_GROUP,text,sizeof(text));
+ checkGroups(text);
+ db_set_s(hContact, "CList", "Group", text);
+ }
+ else db_unset(hContact, "CList", "Group");
+ for (i = ID_STATUS_ONLINE; i<=ID_STATUS_OUTTOLUNCH; i++)
+ {
+ if (IsDlgButtonChecked(hwnd, i))
+ db_set_w(hContact, MODNAME, "Icon", (WORD)i);
+ }
+ /* set correct status */
+ if ( (status == ID_STATUS_ONLINE) || (status == ID_STATUS_AWAY) ||
+ (status == db_get_w(hContact, MODNAME, "Icon", ID_STATUS_ONLINE) )
+ )
+ db_set_w(hContact, MODNAME, "Status", (WORD)db_get_w(hContact, MODNAME, "Icon", ID_STATUS_ONLINE));
+ else
+ db_set_w(hContact, MODNAME, "Status", ID_STATUS_OFFLINE);
+
+ if (IsDlgButtonChecked(hwnd, CHK_USE_TIMER))
+ {
+ if (GetWindowTextLength(GetDlgItem(hwnd,IDC_TIMER)))
+ {
+ char text[512];
+ GetDlgItemTextA(hwnd,IDC_TIMER,text,sizeof(text));
+ db_set_w(hContact, MODNAME, "Timer", (WORD)atoi(text));
+ }
+ else db_set_w(hContact, MODNAME, "Timer", 15);
+ }
+ else db_set_w(hContact, MODNAME, "Timer", 0);
+ // always visible
+ db_set_b(hContact, MODNAME, "AlwaysVisible", (BYTE)IsDlgButtonChecked(hwnd, IDC_ALWAYS_VISIBLE));
+ db_set_b(hContact, MODNAME, "VisibleUnlessOffline", (BYTE)IsDlgButtonChecked(hwnd, IDC_VISIBLE_UNLESS_OFFLINE));
+ }
+ return TRUE;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+char* copyReplaceString(char* oldStr, char* newStr, char* findStr, char* replaceWithStr)
+{
+ int i=0;
+ while (oldStr[i] != '\0') {
+ // msg(&oldStr[i],"");
+ if (!strncmp(&oldStr[i],findStr, strlen(findStr))) {
+ strcat(newStr,replaceWithStr);
+ i += (int)strlen(findStr);
+ }
+ else {
+ strncat(newStr,&oldStr[i],1);
+ i++;
+ }
+ }
+ return newStr;
+}
+
+#define MAX_REPLACES 15
+
+INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch(msg) {
+ case WM_INITDIALOG:
+ {
+ HANDLE hContact = (HANDLE)((PROPSHEETPAGE*)lParam)->lParam;
+ TranslateDialogDefault(hwnd);
+ SetWindowLong(hwnd, GWLP_USERDATA, (LPARAM)(HANDLE)hContact);
+ }
+ return TRUE;
+
+ case WM_COMMAND:
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ switch(LOWORD(wParam)) {
+ case IDC_EXPORT:
+ ExportContact((HANDLE)GetWindowLong(hwnd, GWLP_USERDATA));
+ break;
+
+ case IDC_DOIT:
+ if (GetWindowTextLength(GetDlgItem(hwnd, IDC_STRING_REPLACE))) {
+ char *replace = (char*)malloc(GetWindowTextLength(GetDlgItem(hwnd, IDC_STRING_REPLACE)) +1);
+ char newString[MAX_REPLACES][512], oldString[MAX_REPLACES][512];
+ char dbVar1[2000], dbVar2[2000];
+ int i=0,j=0, k=0;
+ char *string = oldString[k];
+ HANDLE hContact1 = (HANDLE)GetWindowLong(hwnd, GWLP_USERDATA), hContact2;
+ GetDlgItemTextA(hwnd, IDC_STRING_REPLACE, replace, GetWindowTextLength(GetDlgItem(hwnd, IDC_STRING_REPLACE)) +1);
+ if (db_get_static(hContact1, MODNAME, "Name", dbVar1)) {
+ // get the list of replace strings
+ while (replace[i] != '\0') {
+ if (replace[i] == ',') {
+ string = newString[k];
+ j=0;
+ }
+ else if (!strncmp(&replace[i], "\r\n",2)) {
+ if (string == newString[k])
+ k--;
+ if (k = MAX_REPLACES) break;
+ string = oldString[++k];
+ i+=2;
+ continue;
+ }
+ else {
+ string[j] = replace[i];
+ string[++j] = '\0';
+ }
+ i++;
+ }
+ hContact2 =(HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact2,(LPARAM)MODNAME);
+ CallService(MS_IGNORE_IGNORE, (WPARAM)hContact2, IGNOREEVENT_USERONLINE);
+ db_set_s(hContact2, MODNAME, "Nick", Translate("New Non-IM Contact"));
+ // blank dbVar2 so the replaceing doesnt crash..
+ strcpy(dbVar2, "");
+ // copy the name (dbVar1 is the name)
+ for (i=0;i<=k;i++)
+ copyReplaceString(dbVar1, dbVar2, oldString[i],newString[i] );
+
+ db_set_s(hContact2, MODNAME, "Name", dbVar2);
+ // copy the ProgramString
+ if (db_get_static(hContact1, MODNAME, "ProgramString",dbVar1)) {
+ strcpy(dbVar2, "");
+ for (i=0;i<=k;i++)
+ copyReplaceString(dbVar1, dbVar2, oldString[i],newString[i] );
+
+ db_set_s(hContact2, MODNAME, "ProgramString", dbVar2);
+ }
+ // copy the ProgramParamString
+ if (db_get_static(hContact1, MODNAME, "ProgramParamString",dbVar1)) {
+ strcpy(dbVar2, "");
+ for (i=0;i<=k;i++)
+ copyReplaceString(dbVar1, dbVar2, oldString[i],newString[i] );
+
+ db_set_s(hContact2, MODNAME, "ProgramParamString", dbVar2);
+ }
+ // copy the group
+ if (db_get_static(hContact1, "CList", "Group",dbVar1)) {
+ strcpy(dbVar2, "");
+ for (i=0;i<=k;i++)
+ copyReplaceString(dbVar1, dbVar2, oldString[i],newString[i] );
+
+ db_set_s(hContact2, "CList", "Group", dbVar2);
+ }
+ // copy the ToolTip
+ if (db_get_static(hContact1, MODNAME, "ToolTip",dbVar1)) {
+ strcpy(dbVar2, "");
+ for (i=0;i<=k;i++)
+ copyReplaceString(dbVar1, dbVar2, oldString[i],newString[i] );
+
+ db_set_s(hContact2, MODNAME, "ToolTip", dbVar2);
+ }
+ // timer
+ db_set_b(hContact2, MODNAME, "UseTimer", (BYTE)db_get_b(hContact1, MODNAME, "UseTimer", 0));
+ db_set_b(hContact2, MODNAME, "Minutes", (BYTE)db_get_b(hContact1, MODNAME, "Minutes", 0));
+ db_set_w(hContact2, MODNAME, "Timer", (WORD)db_get_w(hContact1, MODNAME, "Timer", 0));
+ //icon
+ db_set_w(hContact2, MODNAME, "Icon", (WORD)db_get_w(hContact1, MODNAME, "Icon", 40072));
+ replaceAllStrings(hContact2);
+ }
+ }
+ else {
+ char dbVar1[2000];
+ HANDLE hContact1 = (HANDLE)GetWindowLong(hwnd, GWLP_USERDATA), hContact2;
+ if (db_get_static(hContact1, MODNAME, "Name", dbVar1)) {
+ if (!(hContact2 =(HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0))) {
+ msg("contact did not get created","");
+ return 0;
+ }
+ CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact2,(LPARAM)MODNAME);
+ CallService(MS_IGNORE_IGNORE, (WPARAM)hContact2, IGNOREEVENT_USERONLINE);
+ db_set_s(hContact2, MODNAME, "Nick", Translate("New Non-IM Contact"));
+ db_set_s(hContact2, MODNAME, "Name", dbVar1);
+ if (db_get_static(hContact1, MODNAME, "ProgramString",dbVar1))
+ db_set_s(hContact2, MODNAME, "ProgramString", dbVar1);
+
+ // copy the ProgramParamString
+ if (db_get_static(hContact1, MODNAME, "ProgramParamString",dbVar1))
+ db_set_s(hContact2, MODNAME, "ProgramParamString", dbVar1);
+
+ // copy the group
+ if (db_get_static(hContact1, "CList", "Group",dbVar1))
+ db_set_s(hContact2, "CList", "Group", dbVar1);
+
+ // copy the ToolTip
+ if (db_get_static(hContact1, MODNAME, "ToolTip",dbVar1))
+ db_set_s(hContact2, MODNAME, "ToolTip", dbVar1);
+
+ // timer
+ db_set_b(hContact2, MODNAME, "UseTimer", (BYTE)db_get_b(hContact1, MODNAME, "UseTimer", 0));
+ db_set_b(hContact2, MODNAME, "Minutes", (BYTE)db_get_b(hContact1, MODNAME, "Minutes", 0));
+ db_set_w(hContact2, MODNAME, "Timer", (WORD)db_get_w(hContact1, MODNAME, "Timer", 0));
+
+ //icon
+ db_set_w(hContact2, MODNAME, "Icon", (WORD)db_get_w(hContact1, MODNAME, "Icon", 40072));
+ replaceAllStrings(hContact2);
+ }
+ }
+ }
+ break;
+
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ return TRUE;
+ }
+ }
+ break;
+ }
+ return FALSE;
+}
+
+void ExportContact(HANDLE hContact)
+{
+ FILE* file;
+ char szFileName[MAX_PATH];
+ char DBVar[1024];
+ int tmp;
+
+ if (Openfile(szFileName, 0))
+ {
+ // if (tmp = MessageBox(0, "Do you want to overwrite the contents of the file?\r\n\r\nPressing No will append this contact to the end of the file.",modFullname, MB_YESNO) == IDYES)
+ // file = fopen(szFileName, "w");
+ // else
+ file = fopen(szFileName, "a");
+ if (file)
+ {
+ if (db_get_static(hContact, MODNAME, "Name", DBVar))
+ {
+ fprintf(file, "\r\n[Non-IM Contact]\r\nName=%s\r\n", DBVar);
+ if (db_get_static(hContact, MODNAME, "ProgramString", DBVar))
+ fprintf(file, "ProgramString=%s\r\n", DBVar);
+ if (db_get_static(hContact, MODNAME, "ProgramParamString", DBVar))
+ fprintf(file, "ProgramParamString=%s\r\n", DBVar);
+ if (db_get_static(hContact, MODNAME, "ToolTip", DBVar))
+ fprintf(file, "ToolTip=%s</tooltip>\r\n", DBVar);
+ if (db_get_static(hContact, "CList", "Group", DBVar))
+ fprintf(file, "Group=%s\r\n", DBVar);
+ if (tmp = db_get_w(hContact, MODNAME, "Icon", 40072))
+ fprintf(file, "Icon=%d\r\n", tmp);
+ if (tmp = db_get_b(hContact, MODNAME, "UseTimer", 0))
+ fprintf(file, "UseTimer=%d\r\n", tmp);
+ if (tmp = db_get_b(hContact, MODNAME, "Minutes", 1))
+ fprintf(file, "Minutes=%d\r\n", tmp);
+ if (tmp = db_get_w(hContact, MODNAME, "Timer", 0))
+ fprintf(file, "Timer=%d\r\n", tmp);
+ fprintf(file, "[/Non-IM Contact]\r\n");
+ }
+ else ("Contact is invalid",modFullname);
+ fclose(file);
+ }
+ }
+}
+
+INT_PTR ImportContacts(WPARAM wParam, LPARAM lParam)
+{
+ HANDLE hContact;
+ char name[256] = "", program[256] = "", programparam[256] = "", group[256] = "", tooltip[3000] = "", line[2001] = "";
+ int icon = 40072, usetimer = 0, minutes = 1, timer = 0;
+ char fn[MAX_PATH];
+ int i,j, contactDone = 0;
+ if ( !Openfile(fn, 1))
+ return 1;
+
+ FILE *file = fopen(fn, "r");
+ if (!file)
+ return 1;
+
+ while (fgets(line,2000,file)) {
+ if (!strcmp(line, "\r\n\0"))
+ continue;
+ if (!strcmp(line,"[Non-IM Contact]\r\n"))
+ contactDone = 0;
+ else if (!strncmp(line, "Name=" ,strlen("Name="))) {
+ i = (int)strlen("Name=");j=0;
+ while (line[i] != '\r' && line[i] != '\n' && line[i] != '\0') {
+ name[j] = line[i++];
+ name[++j] = '\0';
+ }
+ contactDone =1;
+ }
+ else if (!strncmp(line, "ProgramString=" ,strlen("ProgramString="))) {
+ i = (int)strlen("ProgramString=");j=0;
+ while (line[i] != '\r' && line[i] != '\n' && line[i] != '\0') {
+ program[j] = line[i++];
+ program[++j] = '\0';
+ }
+ }
+ else if (!strncmp(line, "ProgramParamString=" ,strlen("ProgramParamString="))) {
+ i = (int)strlen("ProgramParamString=");j=0;
+ while (line[i] != '\r' && line[i] != '\n' && line[i] != '\0') {
+ programparam[j] = line[i++];
+ programparam[++j] = '\0';
+ }
+ }
+ else if (!strncmp(line, "Group=" ,strlen("Group="))) {
+ i = (int)strlen("Group=");j=0;
+ while (line[i] != '\r' && line[i] != '\n' && line[i] != '\0') {
+ group[j] = line[i++];
+ group[++j] = '\0';
+ }
+ }
+ else if (!strncmp(line, "ToolTip=" ,strlen("ToolTip="))) {
+ i = (int)strlen("ToolTip=");
+ strcpy(tooltip, &line[i]);
+ fgets(line,2000,file);
+ while (!strstr(line,"</tooltip>\r\n")) {
+ strcat(tooltip,line);
+ fgets(line,2000,file);
+ }
+ // the line that has the </tooltip>
+ strncat(tooltip,line, strlen(line) - strlen("</tooltip>\r\n"));
+ }
+ else if (!strncmp(line, "Icon=", strlen("Icon="))) {
+ i = (int)strlen("Icon=");
+ sscanf(&line[i], "%d", &icon);
+ }
+ else if (!strncmp(line, "UseTimer=", strlen("UseTimer="))) {
+ i = (int)strlen("UseTimer=");
+ sscanf(&line[i], "%d", &usetimer);
+ }
+ else if (!strncmp(line, "Timer=" ,strlen("Timer="))) {
+ i = (int)strlen("Timer=");
+ sscanf(&line[i], "%d", &timer);
+ }
+ else if (!strncmp(line, "Minutes=", strlen("Minutes="))) {
+ i = (int)strlen("Minutes=");
+ sscanf(&line[i], "%d", &minutes);
+ }
+ else if (contactDone && !strcmp(line,"[/Non-IM Contact]\r\n")) {
+ if (!name) continue;
+ char *msg = (char*)malloc(strlen(name) + strlen("Do you want to import this Non-IM Contact?\r\n\r\nName: \r\n") + 1);
+ wsprintfA(msg, "Do you want to import this Non-IM Contact?\r\n\r\nName: %s\r\n", name);
+ if (program) {
+ msg = (char*)realloc(msg, strlen(msg) + strlen(program) +strlen("Program: \r\n") +1);
+ strcat(msg, "Program: ");
+ strcat(msg,program);
+ strcat(msg,"\r\n");
+ }
+ if (programparam) {
+ msg = (char*)realloc(msg, strlen(msg) + strlen(programparam) +strlen("Program Parameters: \r\n") +1);
+ strcat(msg, "Program Parameters: ");
+ strcat(msg,programparam);
+ strcat(msg,"\r\n");
+ }
+ if (tooltip) {
+ msg = (char*)realloc(msg, strlen(msg) + strlen(tooltip) +strlen("ToolTip: \r\n") +1);
+ strcat(msg, "ToolTip: ");
+ strcat(msg,tooltip);
+ strcat(msg,"\r\n");
+ }
+ if (group) {
+ msg = (char*)realloc(msg, strlen(msg) + strlen(group) +strlen("Group: \r\n") +1);
+ strcat(msg, "Group: ");
+ strcat(msg,group);
+ strcat(msg,"\r\n");
+ }
+ if (icon) {
+ char tmp[64];
+ if (icon == ID_STATUS_ONLINE)
+ wsprintfA(tmp, "Icon: Online\r\n");
+ else if (icon == ID_STATUS_AWAY)
+ wsprintfA(tmp, "Icon: Away\r\n");
+ else if (icon == ID_STATUS_NA)
+ wsprintfA(tmp, "Icon: NA\r\n");
+ else if (icon == ID_STATUS_DND)
+ wsprintfA(tmp, "Icon: DND\r\n");
+ else if (icon == ID_STATUS_OCCUPIED)
+ wsprintfA(tmp, "Icon: Occupied\r\n");
+ else if (icon == ID_STATUS_FREECHAT)
+ wsprintfA(tmp, "Icon: Free For Chat\r\n");
+ else if (icon == ID_STATUS_INVISIBLE)
+ wsprintfA(tmp, "Icon: Invisible\r\n");
+ else if (icon == ID_STATUS_ONTHEPHONE)
+ wsprintfA(tmp, "Icon: On The Phone\r\n");
+ else if (icon == ID_STATUS_OUTTOLUNCH)
+ wsprintfA(tmp, "Icon: Out To Lunch\r\n");
+ msg = (char*)realloc(msg, strlen(msg) + strlen(tmp) +1);
+ strcat(msg,tmp);
+ }
+ if (usetimer && timer) {
+ char tmp[64],tmp2[8];
+ if (minutes)
+ strcpy(tmp2,"Minutes");
+ else strcpy(tmp2,"Seconds");
+ wsprintfA(tmp, "UseTimer: Yes\r\nTimer: %d %s",timer, tmp2);
+ msg = (char*)realloc(msg, strlen(msg) + strlen(tmp) +1);
+ strcat(msg,tmp);
+ }
+
+ if (MessageBoxA(0,msg,modFullname,MB_YESNO) == IDYES) {
+ if (!(hContact =(HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0))) {
+ msg("contact did get created","");
+ continue;
+ }
+ CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)MODNAME);
+ CallService(MS_IGNORE_IGNORE, (WPARAM)hContact, IGNOREEVENT_USERONLINE);
+ db_set_s(hContact, MODNAME, "Nick", Translate("New Non-IM Contact"));
+ db_set_s(hContact, MODNAME, "Name", name);
+ db_set_s(hContact, MODNAME, "ProgramString", program);
+ // copy the ProgramParamString
+ db_set_s(hContact, MODNAME, "ProgramParamString", programparam);
+ // copy the group
+ db_set_s(hContact, "CList", "Group", group);
+ // copy the ToolTip
+ db_set_s(hContact, MODNAME, "ToolTip", tooltip);
+ // timer
+ db_set_b(hContact, MODNAME, "UseTimer", (BYTE)usetimer);
+ db_set_b(hContact, MODNAME, "Minutes", (BYTE)minutes);
+ db_set_w(hContact, MODNAME, "Timer", (WORD)timer);
+ //icon
+ db_set_w(hContact, MODNAME, "Icon", (WORD)icon);
+ replaceAllStrings(hContact);
+ }
+ free(msg);
+ contactDone = 0;
+ name[0] = '\0';
+ program[0] = '\0';
+ programparam[0] = '\0';
+ group[0] = '\0';
+ tooltip[0] = '\0';
+ line[0] = '\0';
+ icon = 40072;
+ usetimer = 0;
+ minutes = 1;
+ timer = 0;
+ }
+ }
+ fclose(file);
+
+ return 1;
+}
diff --git a/plugins/Non-IM Contact/src/dialog.cpp b/plugins/Non-IM Contact/src/dialog.cpp
new file mode 100644
index 0000000000..cf3aa6a977
--- /dev/null
+++ b/plugins/Non-IM Contact/src/dialog.cpp
@@ -0,0 +1,368 @@
+#include "commonheaders.h"
+
+int CALLBACK PropSheetProc(HWND hwnd, UINT uMsg, LPARAM lParam);
+
+void DoPropertySheet(HANDLE hContact, HINSTANCE hInst)
+{
+ char title[256], nick[256];
+ PROPSHEETPAGEA psp[4];
+ PROPSHEETHEADERA psh;
+
+ /* contact info */
+ ZeroMemory(&psp[0], sizeof(PROPSHEETPAGE));
+ psp[0].dwSize = sizeof(PROPSHEETPAGE);
+ psp[0].dwFlags = PSP_USEICONID | PSP_USETITLE;
+ psp[0].hInstance = hInst;
+ psp[0].pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_INFO);
+ psp[0].pszIcon = NULL;
+ psp[0].pfnDlgProc = DlgProcContactInfo;
+ psp[0].pszTitle = "Contacts Display Info";
+ psp[0].lParam = (LPARAM)(HANDLE)hContact;
+ psp[0].pfnCallback = NULL;
+
+ /* other settings */
+ ZeroMemory(&psp[1], sizeof(PROPSHEETPAGE));
+ psp[1].dwSize = sizeof(PROPSHEETPAGE);
+ psp[1].dwFlags = PSP_USEICONID | PSP_USETITLE;
+ psp[1].hInstance = hInst;
+ psp[1].pszTemplate = MAKEINTRESOURCEA(IDD_OTHER_STUFF);
+ psp[1].pszIcon = NULL;
+ psp[1].pfnDlgProc = DlgProcOtherStuff;
+ psp[1].pszTitle = "Link and CList Settings";
+ psp[1].lParam = (LPARAM)(HANDLE)hContact;
+ psp[1].pfnCallback = NULL;
+
+ /* files */
+ ZeroMemory(&psp[3], sizeof(PROPSHEETPAGE));
+ psp[3].dwSize = sizeof(PROPSHEETPAGE);
+ psp[3].dwFlags = PSP_USEICONID | PSP_USETITLE;
+ psp[3].hInstance = hInst;
+ psp[3].pszTemplate = MAKEINTRESOURCEA(IDD_ADD_FILE);
+ psp[3].pszIcon = NULL;
+ psp[3].pfnDlgProc = DlgProcFiles;
+ psp[3].pszTitle = "Files";
+ psp[3].lParam = 0;
+ psp[3].pfnCallback = NULL;
+
+ /* copy contact */
+ ZeroMemory(&psp[2], sizeof(PROPSHEETPAGE));
+ psp[2].dwSize = sizeof(PROPSHEETPAGE);
+ psp[2].dwFlags = PSP_USEICONID | PSP_USETITLE;
+ psp[2].hInstance = hInst;
+ psp[2].pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_COPYEXPORT);
+ psp[2].pszIcon = NULL;
+ psp[2].pfnDlgProc = DlgProcCopy;
+ psp[2].pszTitle = "Copy Contact";
+ psp[2].lParam = (LPARAM)(HANDLE)hContact;
+ psp[2].pfnCallback = NULL;
+
+
+ /* propery sheet header.. dont touch !!!! */
+ ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
+ psh.dwSize = sizeof(PROPSHEETHEADER);
+ psh.dwFlags = PSH_USEICONID | PSH_PROPSHEETPAGE | PSH_USECALLBACK;
+ psh.hwndParent = NULL;
+ psh.hInstance = hInst;
+ psh.pszIcon = MAKEINTRESOURCEA(IDI_MAIN);
+ db_get_static(hContact, MODNAME, "Nick", nick);
+ wsprintfA(title, "Edit Non-IM Contact \"%s\"", nick);
+ psh.pszCaption = title;
+ psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
+ psh.nStartPage = 0;
+ psh.ppsp = (LPCPROPSHEETPAGEA) &psp;
+ psh.pfnCallback = PropSheetProc;
+
+ // Now do it and return
+ PropertySheetA(&psh);
+}
+
+INT_PTR addContact(WPARAM wParam,LPARAM lParam)
+{
+ char tmp[256];
+ HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)MODNAME);
+ CallService(MS_IGNORE_IGNORE, (WPARAM)hContact, IGNOREEVENT_USERONLINE);
+ db_set_s(hContact, MODNAME, "Nick", Translate("New Non-IM Contact"));
+ DoPropertySheet(hContact, hInst);
+ if (!db_get_static(hContact, MODNAME, "Name", tmp))
+ CallService(MS_DB_CONTACT_DELETE,(WPARAM)hContact,0);
+ replaceAllStrings(hContact);
+ return 0;
+}
+
+INT_PTR editContact(WPARAM wParam,LPARAM lParam)
+{
+ HANDLE hContact = (HANDLE)wParam;
+ char tmp[256];
+ if (!hContact)
+ {
+ hContact =(HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)MODNAME);
+ CallService(MS_IGNORE_IGNORE, (WPARAM)hContact, IGNOREEVENT_USERONLINE);
+ db_set_s(hContact, MODNAME, "Nick", Translate("New Non-IM Contact"));
+ }
+ DoPropertySheet(hContact, hInst);
+ if (!db_get_static(hContact, MODNAME, "Name", tmp))
+ CallService(MS_DB_CONTACT_DELETE,(WPARAM)hContact,0);
+ replaceAllStrings(hContact);
+ return 0;
+}
+
+int CALLBACK PropSheetProc(HWND hwnd, UINT uMsg, LPARAM lParam)
+{
+ if (uMsg == PSCB_PRECREATE)
+ {
+ // Remove the DS_CONTEXTHELP style from the
+ // dialog box template
+ if (((DLGTEMPLATEEX*)lParam)->signature == 0xFFFF)
+ {
+ ((DLGTEMPLATEEX*)lParam)->style
+ &= ~DS_CONTEXTHELP;
+ }
+ else {
+ ((LPDLGTEMPLATE)lParam)->style
+ &= ~DS_CONTEXTHELP;
+ }
+ return TRUE;
+ }
+
+ /* prob not the best way but it works... i hope */
+ switch (lParam) {
+ case PSBTN_OK:
+ break;
+ case PSBTN_CANCEL:
+ break;
+ case PSBTN_FINISH:
+ break;
+ case PSBTN_APPLYNOW:
+ break;
+ }
+ return 0;
+}
+
+INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch(msg) {
+ case WM_INITDIALOG:
+ {
+ char tmp[5];
+ TranslateDialogDefault(hwnd);
+ CheckDlgButton(hwnd, IDC_IGNORE_GLOBALSTATUS, db_get_b(NULL, MODNAME, "IgnoreGlobalStatusChange", 0));
+ CheckDlgButton(hwnd, IDC_AWAYISNOTONLINE, db_get_b(NULL, MODNAME, "AwayAsStatus", 0));
+ if (db_get_w(NULL, MODNAME, "Timer", 1))
+ {
+ EnableWindow(GetDlgItem(hwnd,IDC_TIMER_INT),1);
+ SetDlgItemTextA(hwnd, IDC_TIMER_INT, _itoa(db_get_w(NULL, MODNAME, "Timer", 1),tmp,10));
+ EnableWindow(GetDlgItem(hwnd,IDC_TIMER_TEXT),1);
+ }
+ else
+ {
+ CheckDlgButton(hwnd, IDC_DISABLETIMER, 1);
+ EnableWindow(GetDlgItem(hwnd,IDC_TIMER_INT),0);
+ EnableWindow(GetDlgItem(hwnd,IDC_TIMER_TEXT),0);
+ }
+
+ }
+ return TRUE;
+ case WM_COMMAND:
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ switch(LOWORD(wParam)) {
+ case IDC_DISABLETIMER:
+ if (IsDlgButtonChecked(hwnd, IDC_DISABLETIMER))
+ {
+ EnableWindow(GetDlgItem(hwnd,IDC_TIMER_INT),0);
+ EnableWindow(GetDlgItem(hwnd,IDC_TIMER_TEXT),0);
+ }
+ else
+ {
+ EnableWindow(GetDlgItem(hwnd,IDC_TIMER_TEXT),1);
+ EnableWindow(GetDlgItem(hwnd,IDC_TIMER_INT),1);
+ if (!GetWindowTextLength(GetDlgItem(hwnd, IDC_TIMER_INT)))
+ SetDlgItemTextA(hwnd, IDC_TIMER_INT,"1");
+ }
+ break;
+
+
+ return TRUE;
+ }
+ break;
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ char tmp[5];
+ db_set_b(NULL, MODNAME, "IgnoreGlobalStatusChange", (BYTE)IsDlgButtonChecked(hwnd, IDC_IGNORE_GLOBALSTATUS));
+ db_set_b(NULL, MODNAME, "AwayAsStatus", (BYTE)IsDlgButtonChecked(hwnd, IDC_AWAYISNOTONLINE));
+ if (!IsDlgButtonChecked(hwnd, IDC_DISABLETIMER) && GetWindowTextLength(GetDlgItem(hwnd, IDC_TIMER_INT))) {
+ GetDlgItemTextA(hwnd, IDC_TIMER_INT, tmp, 4);
+ db_set_w(NULL, MODNAME, "Timer",(WORD)atoi(tmp));
+ }
+ else db_set_w(NULL, MODNAME, "Timer",0);
+ return TRUE;
+ }
+ }
+ break;
+ }
+ return FALSE;
+}
+
+
+// string replace test window thingamijig....
+
+// struct to keep track of ()'s in the test sring window
+#define MAX_BRACES 32
+#define VARS 7
+struct braces {
+ char var[64];
+ int idCtrl;
+} braceList[VARS] =
+{
+ {"file(", IDC_FILE},
+ {"start(", IDC_START},
+ {"end(", IDC_END},
+ {"csv(", IDC_CSV},
+ {"wholeline(", IDC_WHOLELINE},
+ {"filename(", IDC_FILENAME},
+ {"line(", IDC_LINE}
+};
+int braceOrder[MAX_BRACES] = {0};
+
+INT_PTR CALLBACK HelpWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch(msg) {
+ case WM_INITDIALOG:
+ {
+ char string[10000];
+ TranslateDialogDefault(hwnd);
+
+ strcpy(string, Translate("String replacing variables....\r\nThe following are all the valid variables that can be used. Refer to the readme for a proper explanation.\r\n\r\n"));
+ strcat(string, Translate("file(X)\t\t<- specifies the file to read from\r\nMUST be followed by either start() or end() or wholeline()\r\n"));
+ strcat(string, Translate("filename(X)\t\t<- copyies the filename of file X.\r\n"));
+ strcat(string, Translate("start(...)\t\t<-specifies where to start copying from.\r\n"));
+ strcat(string, Translate("end(...)\t\t<-specifies where to stop copying.\r\n"));
+ strcat(string, Translate("wholeline(line(...))\t<-specifies a whole line to copy\r\n\r\n"));
+ strcat(string, Translate("start() and end() explained\r\n.........................\r\n"));
+ strcat(string, Translate("MUST start with line() followed by a number or a string inside \" marks, OR csv(seperatorX) variable\r\n"));
+ strcat(string, Translate("The number specifies which character in the line to start/end copying.\r\nThe string specifies a string in the line to start/end copying.\r\n"));
+ strcat(string, Translate("csv(seperatorX) explained...\r\nseperator is either \"tab\" or \"space\" or any SINGLE character.\r\nX is the Xth seperator to pass before copying, (or to stop before)\r\n\r\n"));
+ strcat(string, Translate("Lastly the line(...) variable...\r\n"));
+ strcat(string, Translate("Inside the brackets must be either a number (to specify the line number), or a string inside \" marks (to use the line with that string), or lastline(X).\r\nthe X in lastline is the Xth line above the last line. i.e lastline(1) will use the 2nd last line of the file.\r\n"));
+ strcat(string, Translate("If searching for a line with u may put a + or - X after the closing ) i.e line(\"some words\")+3 to go 3 lines after the line with \"some words\".\r\n\r\n"));
+ strcat(string, Translate("Some Expamples...\r\n\r\n"));
+ strcat(string, Translate("filename(0) <- will display the filename of the 0th file\r\nfile(0)wholeline(line(0))) <- will display the whole first line of the 0th file\r\nfile(0)wholeline(line(\"hello\")-1))) <- the wholeline above the first occurance of \"hello\" in the file\r\nfile(0)start(line(lastline(1))csv(tab2))end(line(lastline())csv(tab4))) <- starts at the 2nd last line of the file, from the 2nd tab variable, untill the 4th tab variable in the last line (in the 0th file)\r\nfile(0)start(line(\"hello\")+1\"zzzz\")end(line(6)17)) <- starts from the first occurance of zzzz in the line after the first occurance of hello, untill the 17th character in the 6th line (starting from line 0) of the 0th file.\r\n"));
+ SetDlgItemTextA(hwnd, IDC_HELPTEXT,string);
+ }
+ return TRUE;
+
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+ case IDOK:
+ DestroyWindow(hwnd);
+ break;
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+INT_PTR CALLBACK TestWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch(msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwnd);
+ return TRUE;
+
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+ case IDC_HELPMSG:
+ CreateDialog(hInst,MAKEINTRESOURCE(IDD_HELP), 0, HelpWindowDlgProc);
+ break;
+
+ case IDCANCEL:
+ DestroyWindow(hwnd);
+ break;
+
+ case IDC_STRING:
+ if (HIWORD(wParam) == EN_CHANGE) {
+ char tmp[MAX_STRING_LENGTH];
+ int i=0,j;
+ if (GetWindowTextLength(GetDlgItem(hwnd, IDC_STRING))) {
+ GetDlgItemTextA(hwnd, IDC_STRING, tmp, MAX_STRING_LENGTH);
+ if (tmp[strlen(tmp)-1] == '(') {
+ for (i=0; i<VARS; i++) {
+ if (!strcmp(braceList[i].var,&tmp[strlen(tmp)-strlen(braceList[i].var)])) {
+ for (j=0;j<MAX_BRACES;j++) {
+ if (!braceOrder[j]) {
+ braceOrder[j]=i;
+ EnableWindow(GetDlgItem(hwnd, braceList[i].idCtrl),1);
+ if (j)
+ EnableWindow(GetDlgItem(hwnd, braceList[braceOrder[j-1]].idCtrl),0);
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+ else if (tmp[strlen(tmp)-1] == ')') {
+ for (j=0; j<MAX_BRACES; j++) {
+ if (!braceOrder[j]) {
+ EnableWindow(GetDlgItem(hwnd, braceList[braceOrder[j-1]].idCtrl),0);
+ if (j > 1)
+ EnableWindow(GetDlgItem(hwnd, braceList[braceOrder[j-2]].idCtrl),1);
+ braceOrder[j-1] = 0;
+ break;
+ }
+ }
+ }
+ }
+ else {
+ for (j=0; j<MAX_BRACES; j++) {
+ if (!braceOrder[j]) break;
+ EnableWindow(GetDlgItem(hwnd, braceList[braceOrder[j]].idCtrl),0);
+ }
+ }
+ }
+ break;
+
+ case IDOK:
+ char str2replace[MAX_STRING_LENGTH], replacedString[MAX_STRING_LENGTH];
+ int error;
+ if (GetWindowTextLength(GetDlgItem(hwnd, IDC_STRING))) {
+ GetDlgItemTextA(hwnd, IDC_STRING, str2replace, MAX_STRING_LENGTH);
+ switch (stringReplacer(str2replace, replacedString, NULL)) {
+ case ERROR_NO_LINE_AFTER_VAR_F:
+ wsprintfA(replacedString, "ERROR: no %s","%line or %wholeline or %lastline after %fn");
+ error = 1;
+ break;
+ case ERROR_LINE_NOT_READ:
+ wsprintfA(replacedString, "ERROR: file couldnt be opened ");
+ error = 1;
+ break;
+ case ERROR_NO_FILE:
+ wsprintfA(replacedString, "ERROR: no file specified in settings");
+ error = 1;
+ break;
+ default:
+ error = 0;
+ }
+ SetDlgItemTextA(hwnd, IDC_ANSWER, replacedString);
+ }
+ }
+ break;
+ }
+ return FALSE;
+}
+
+INT_PTR testStringReplacer(WPARAM wParam, LPARAM lParam)
+{
+ CreateDialog(hInst, MAKEINTRESOURCE(IDD_TEST_LINE), 0, TestWindowDlgProc);
+ return 0;
+}
+
+INT_PTR LoadFilesDlg(WPARAM wParam, LPARAM lParam)
+{
+ CreateDialog(hInst,MAKEINTRESOURCE(IDD_ADD_FILE),0,DlgProcFiles);
+ return 0;
+}
diff --git a/plugins/Non-IM Contact/src/files.cpp b/plugins/Non-IM Contact/src/files.cpp
new file mode 100644
index 0000000000..5fdc819604
--- /dev/null
+++ b/plugins/Non-IM Contact/src/files.cpp
@@ -0,0 +1,350 @@
+#include "commonheaders.h"
+
+INT_PTR exportContacts(WPARAM wParam,LPARAM lParam)
+{
+ char fn[MAX_PATH];
+ if (!Openfile(fn, 0))
+ return 0;
+
+ FILE* file;
+ if (MessageBoxA(0, "Do you want to overwrite the contents of the file?\r\n\r\nPressing No will append these contacts to the end of the file.",modFullname, MB_YESNO) == IDYES)
+ file = fopen(fn, "w");
+ else
+ file = fopen(fn, "a");
+ if (!file)
+ return 0;
+
+ for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ const char* proto = GetContactProto(hContact);
+ if (proto && !strcmp(proto, MODNAME)) {
+ int tmp;
+ char DBVar[1024];
+ if (db_get_static(hContact, MODNAME, "Name", DBVar)) {
+ fprintf(file, "\r\n[Non-IM Contact]\r\nName=%s\r\n", DBVar);
+ if (db_get_static(hContact, MODNAME, "ProgramString", DBVar))
+ fprintf(file, "ProgramString=%s\r\n", DBVar);
+ if (db_get_static(hContact, MODNAME, "ProgramParamString", DBVar))
+ fprintf(file, "ProgramParamString=%s\r\n", DBVar);
+ if (db_get_static(hContact, MODNAME, "ToolTip", DBVar))
+ fprintf(file, "ToolTip=%s</tooltip>\r\n", DBVar);
+ if (db_get_static(hContact, "CList", "Group", DBVar))
+ fprintf(file, "Group=%s\r\n", DBVar);
+ if (tmp = db_get_w(hContact, MODNAME, "Icon", 40072))
+ fprintf(file, "Icon=%d\r\n", tmp);
+ if (tmp = db_get_b(hContact, MODNAME, "UseTimer", 0))
+ fprintf(file, "UseTimer=%d\r\n", tmp);
+ if (tmp = db_get_b(hContact, MODNAME, "Minutes", 1))
+ fprintf(file, "Minutes=%d\r\n", tmp);
+ if (tmp = db_get_w(hContact, MODNAME, "Timer", 0))
+ fprintf(file, "Timer=%d\r\n", tmp);
+ fprintf(file, "[/Non-IM Contact]\r\n");
+ }
+ }
+ }
+ fclose(file);
+ return 0;
+}
+
+int Openfile(char *outputFile, int saveOpen) //0=save, 1=open
+{
+ char filename[MAX_PATH] = "";
+ char *filter = "All Files\0*.*\0";
+ int r;
+ char title[16];
+ if (saveOpen)
+ strcpy(title, "Open file");
+ else strcpy(title, "Save to file");
+
+ OPENFILENAMEA ofn = { sizeof(ofn) };
+ ofn.lpstrFile = filename;
+ ofn.lpstrFilter = filter;
+ ofn.Flags = saveOpen? OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_SHAREAWARE | OFN_PATHMUSTEXIST: OFN_HIDEREADONLY | OFN_SHAREAWARE | OFN_PATHMUSTEXIST;
+ ofn.lpstrTitle = title;
+ ofn.nMaxFile = MAX_PATH;
+
+ if (saveOpen)
+ r = GetOpenFileNameA(&ofn);
+ else
+ r = GetSaveFileNameA(&ofn);
+ if (!r)
+ return 0;
+ lstrcpyA(outputFile,filename);
+ return 1;
+}
+
+
+void reloadFiles(HWND fileList)
+{
+ int i, index;
+ char file[MAX_PATH], fn[6];
+ SendMessage(fileList,CB_RESETCONTENT, 0,0);
+ for (i=0; ;i++)
+ {
+ wsprintfA(fn, "fn%d", i);
+ if (db_get_static(NULL, MODNAME, fn, file)) {
+ index = SendMessageA(fileList, CB_ADDSTRING,0, (LPARAM)(char*)file);
+ SendMessage(fileList, CB_SETITEMDATA, index, (LPARAM)(int)i);
+ SendMessage(fileList, CB_SETCURSEL, index,0);
+ SetDlgItemTextA(GetParent(fileList), IDC_FN, _itoa(i, fn, 10));
+ /* add the file contents to the edit box */
+ }
+ else break;
+ }
+}
+
+int savehtml(char* outFile)
+{
+ FILE* file = fopen(outFile, "w");
+ if (!file)
+ {
+ fclose(file);
+ return 0;
+ }
+ fprintf(file, "%s", szInfo);
+ fclose(file);
+ return 1;
+}
+
+void readFile(HWND hwnd)
+{
+ int lineNumber, fileLength=0, width=0;
+ char temp[MAX_STRING_LENGTH], szFileName[512], temp1[MAX_STRING_LENGTH], fn[8];
+ FILE* filen;
+ int fileNumber = SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_GETCURSEL, 0,0);
+ wsprintfA(fn, "fn%d", fileNumber);
+ if (!db_get_static(NULL, MODNAME, fn, szFileName)) {
+ msg(Translate("File couldn't be opened"),fn);
+ return;
+ }
+
+ if ( (!strncmp("http://", szFileName, strlen("http://"))) || (!strncmp("https://", szFileName, strlen("https://"))) )
+ wsprintfA(szFileName,"%s\\plugins\\fn%d.html",getMimDir(temp), fileNumber);
+
+ filen = fopen(szFileName,"r");
+ if (!filen) {
+ MessageBoxA(0, Translate("File couldn't be opened,2"), modFullname,MB_OK);
+ return;
+ }
+ lineNumber = 0;
+ SendMessage(GetDlgItem(hwnd, IDC_FILE_CONTENTS),LB_RESETCONTENT, 0,0);
+ while (lineNumber < (MAXLINES) && (fgets(temp, MAX_STRING_LENGTH, filen)))
+ {
+ if (temp[0] == '\t') temp[0] = ' ';
+ if (temp[strlen(temp)-1]=='\n' && temp[strlen(temp)-2]=='\r')
+ temp[strlen(temp)-2]='\0';
+ else if (temp[strlen(temp)-1]=='\n')
+ temp[strlen(temp)-1]='\0';
+ else temp[strlen(temp)]='\0';
+ wsprintfA( temp1, Translate("line(%-3d) = | %s"), lineNumber, temp);
+ SendMessage(GetDlgItem(hwnd, IDC_FILE_CONTENTS),LB_ADDSTRING,0,(LPARAM)(char*)temp1);
+ lineNumber++;
+ fileLength++;
+ if ((unsigned int)SendMessage(GetDlgItem(hwnd, IDC_FILE_CONTENTS),LB_GETHORIZONTALEXTENT,0,0) <= (strlen(temp1)*db_get_b(NULL, MODNAME, "WidthMultiplier", 5)))
+ SendMessage(GetDlgItem(hwnd, IDC_FILE_CONTENTS),LB_SETHORIZONTALEXTENT,(strlen(temp1)*db_get_b(NULL, MODNAME, "WidthMultiplier", 5)),0);
+ }
+ fclose(filen);
+
+ return ;
+}
+
+#define WM_RELOADWINDOW (WM_USER+11)
+
+INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch(msg) {
+ case WM_RELOADWINDOW:
+ {
+ char fn[MAX_PATH], string[MAX_STRING_LENGTH], tmp[MAX_STRING_LENGTH];
+ reloadFiles(GetDlgItem(hwnd, IDC_FILE_LIST));
+ int i = SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_GETCURSEL, 0 ,0);
+ wsprintfA(fn , "fn%d", i);
+ SendMessage(GetDlgItem(hwnd, IDC_FILE_CONTENTS),LB_RESETCONTENT, 0,0);
+ if (db_get_static(NULL, MODNAME, fn, string) )
+ {
+ if ( (!strncmp("http://", string, strlen("http://"))) || (!strncmp("https://", string, strlen("https://"))) )
+ {
+ SetDlgItemTextA(hwnd,IDC_URL, string);
+ SetDlgItemTextA(hwnd, IDC_WWW_TIMER, _itoa(db_get_w(NULL, MODNAME, strcat(fn, "_timer"), 60), tmp, 10));
+ }
+ readFile(hwnd);
+ }
+ }
+ break;
+
+ case WM_INITDIALOG:
+ {
+ SendMessage(hwnd, WM_RELOADWINDOW, 0,0);
+ TranslateDialogDefault(hwnd);
+ }
+ return TRUE;
+ case WM_COMMAND:
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ switch(LOWORD(wParam)) {
+ case IDC_ADD_URL:
+ {
+ if (GetWindowTextLength(GetDlgItem(hwnd,IDC_URL)))
+ {
+ char text[512], url[512], fn[10] = "fn0", szFileName[MAX_PATH], temp[512];
+ int i, timer;
+ GetDlgItemTextA(hwnd,IDC_URL,text,sizeof(text));
+ strcpy(url, text);
+ if (!InternetDownloadFile(text))
+ {
+ for (i=0; ;i++)
+ {
+ wsprintfA(fn, "fn%d", i);
+ if (!db_get_static(NULL, MODNAME, fn, text))
+ break;
+ }
+ wsprintfA(szFileName,"%s\\plugins\\%s.html",getMimDir(temp), fn);
+ if (savehtml(szFileName))
+ {
+ wsprintfA(fn, "fn%d", i);
+ db_set_s(NULL, MODNAME, fn, url);
+ if (!GetWindowTextLength(GetDlgItem(hwnd,IDC_WWW_TIMER)))
+ timer = 60;
+ else
+ {
+ GetDlgItemTextA(hwnd,IDC_WWW_TIMER,text,sizeof(text));
+ timer = atoi(text);
+ }
+ db_set_w(NULL, MODNAME, strcat(fn, "_timer"), (WORD)timer);
+ SendMessage(hwnd, WM_RELOADWINDOW, 0,0);
+ }
+ }
+ }
+ }
+ break;
+ case IDC_WWW_TIMER:
+ if (HIWORD(wParam) == EN_CHANGE)
+ SendMessage(GetParent(hwnd),PSM_CHANGED,0,0);
+ break;
+ case IDC_ADD_FILE:
+ {
+ int i, index;
+ char file[MAX_PATH], fn[6];
+ for (i=0; ;i++)
+ {
+ wsprintfA(fn, "fn%d", i);
+ if (!db_get_static(NULL, MODNAME, fn, file))
+ break;
+ }
+ if (Openfile(file,1))
+ {
+ db_set_s(NULL, MODNAME, fn, file);
+ index = SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_ADDSTRING,0,(LPARAM)(char*)file);
+ SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_SETITEMDATA,index,(LPARAM)(int)i);
+ SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_SETCURSEL, index ,0);
+ SetDlgItemTextA(hwnd, IDC_FN, _itoa(i, fn, 10));
+ wsprintfA(fn , "fn%d", index);
+ readFile(hwnd);
+ }
+
+ }
+ break;
+ case IDC_DEL_FILE:
+ {
+ int index = SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_GETCURSEL, 0,0),i= (int)SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_GETITEMDATA, index,0);
+ char fn[6], fn1[4], tmp[256];
+ int count = SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_GETCOUNT, 0,0) -1;
+ if (index == count)
+ {
+ wsprintfA(fn, "fn%d", index);
+ db_unset(NULL, MODNAME, fn);
+ SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_DELETESTRING, index ,0);
+ SendMessage(hwnd, WM_RELOADWINDOW, 0,0);
+ if (!index) {
+ SetDlgItemTextA(hwnd, IDC_FN,"");
+ SetDlgItemTextA(hwnd, IDC_FILE_CONTENTS,"");
+ }
+
+ }
+ else
+ {
+ wsprintfA(fn, "fn%d", i);
+ while (db_get_static(NULL, MODNAME, fn,tmp))
+ {
+ wsprintfA(fn1, "fn%d", i-1);
+ db_set_s(NULL, MODNAME, fn1 , tmp);
+ wsprintfA(fn, "fn%d", ++i);
+ }
+ wsprintfA(fn, "fn%d", --i);
+ db_unset(NULL, MODNAME, fn);
+ SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_DELETESTRING, index ,0);
+ SendMessage(hwnd, WM_RELOADWINDOW, 0,0);
+ }
+
+ }
+ break;
+
+
+ case IDC_FILE_LIST:
+ if (HIWORD(wParam) == CBN_SELCHANGE )
+ {
+ int index = SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_GETCURSEL, 0,0);
+ char fn[6], tmp[MAX_PATH];
+ SetDlgItemTextA(hwnd, IDC_FN, _itoa(index, fn, 10));
+ wsprintfA(fn, "fn%d", index);
+ if (db_get_static(NULL, MODNAME, fn, tmp) )
+ {
+ if (!strncmp("http://", tmp, strlen("http://")) || !strncmp("https://", tmp, strlen("https://")))
+ {
+ SetDlgItemTextA(hwnd,IDC_URL, tmp);
+ SetDlgItemTextA(hwnd, IDC_WWW_TIMER, _itoa(db_get_w(NULL, MODNAME, strcat(fn, "_timer"), 60), tmp, 10));
+ }
+ else
+ {
+ SetDlgItemTextA(hwnd,IDC_URL, "");
+ SetDlgItemTextA(hwnd, IDC_WWW_TIMER,"");
+ }
+ readFile(hwnd);
+ }
+ }
+ break;
+ case IDCANCEL:
+ DestroyWindow(hwnd);
+ break;
+ return TRUE;
+ }
+ break;
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ int i = SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_GETCURSEL, 0 ,0);
+ int timer;
+ char fn[MAX_PATH], string[1000];;
+ wsprintfA(fn , "fn%d", i);
+ if (GetWindowTextLength(GetDlgItem(hwnd,IDC_WWW_TIMER))) {
+ char text[5];
+ GetDlgItemTextA(hwnd,IDC_WWW_TIMER,text,sizeof(text));
+ timer = atoi(text);
+ }
+ else timer = 60;
+
+ if (db_get_static(NULL, MODNAME, fn, string) )
+ if (!strncmp("http://", string, strlen("http://")) || !strncmp("https://", string, strlen("https://")))
+ db_set_w(NULL, MODNAME, strcat(fn, "_timer"), (WORD)timer);
+
+ return TRUE;
+ }
+ }
+ break;
+ }
+ return FALSE;
+}
+
+char* getMimDir(char* file)
+{
+ GetModuleFileNameA(NULL, file, MAX_PATH);
+
+ char *p1 = strrchr(file,'\\');
+ if (p1)
+ *p1 = '\0';
+
+ if (file[0] == '\\')
+ file[strlen(file)-1] = '\0';
+
+ return file;
+}
diff --git a/plugins/Non-IM Contact/src/http.cpp b/plugins/Non-IM Contact/src/http.cpp
new file mode 100644
index 0000000000..502d34e585
--- /dev/null
+++ b/plugins/Non-IM Contact/src/http.cpp
@@ -0,0 +1,103 @@
+/*
+Weather Protocol plugin for Miranda IM
+Copyright (C) 2002-2004 Calvin Che
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+/* This file contain the source related to downloading weather info
+ from the web using netlib
+*/
+
+#include "commonheaders.h"
+
+char *szInfo;
+char *szData;
+HANDLE hNetlibUser;
+
+// function to download webpage from the internet
+// szUrl = URL of the webpage to be retrieved
+// return value = 0 for success, 1 or HTTP error code for failure
+// global var used: szData, szInfo = containing the retrieved data
+int InternetDownloadFile (CHAR *szUrl)
+{
+ NETLIBHTTPREQUEST nlhr={0}, *nlhrReply;
+
+ // initialize the netlib request
+ nlhr.cbSize=sizeof(nlhr);
+ nlhr.requestType=REQUEST_GET;
+ nlhr.flags=NLHRF_DUMPASTEXT;
+ nlhr.szUrl= szUrl;
+ // change the header so the plugin is pretended to be IE 6 + WinXP
+ nlhr.headersCount++;
+ nlhr.headers=(NETLIBHTTPHEADER*)malloc(sizeof(NETLIBHTTPHEADER)*nlhr.headersCount);
+ CopyMemory(nlhr.headers,nlhr.headers,sizeof(NETLIBHTTPHEADER)*nlhr.headersCount);
+ nlhr.headers[nlhr.headersCount-1].szName="User-Agent";
+ nlhr.headers[nlhr.headersCount-1].szValue="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
+
+ // download the page
+ nlhrReply=(NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION,(WPARAM)hNetlibUser,(LPARAM)&nlhr);
+ if (nlhrReply) {
+ // return error code if the recieved code is neither 200 OK or 302 Moved
+ if (nlhrReply->resultCode != 200 && nlhrReply->resultCode != 302)
+ return (int)nlhrReply->resultCode;
+ // if the recieved code is 200 OK
+ else if (nlhrReply->resultCode == 200)
+ {
+ // allocate memory and save the retrieved data
+ szData = (char *)malloc(lstrlenA(nlhrReply->pData)+2);
+ lstrcpynA(szData, nlhrReply->pData, lstrlenA(nlhrReply->pData));
+ }
+ // if the recieved code is 302 Moved, Found, etc
+ else if (nlhrReply->resultCode == 302)
+ { // page moved
+ int i;
+ // get the url for the new location and save it to szInfo
+ // look for the reply header "Location"
+ for (i=0; i<nlhrReply->headersCount; i++) {
+ if (!lstrcmpA(nlhrReply->headers[i].szName, "Location")) {
+ szData = (char *)malloc(512);
+ // add "Moved/Location:" in front of the new URL for identification
+ wsprintfA(szData, "Moved/Location: %s\n", nlhrReply->headers[i].szValue);
+ break;
+ }
+ }
+ // log the new url into netlib log
+ CallService(MS_NETLIB_LOG,(WPARAM)hNetlibUser,(LPARAM)szData);
+ }
+ }
+ // if the data does not downloaded successfully (ie. disconnected), then return 1 as error code
+ else return 1;
+
+ // make a copy of the retrieved data, then free the memory of the http reply
+ szInfo = szData;
+ CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT,0,(LPARAM)nlhrReply);
+
+ // the recieved data is empty, data was not recieved, so return an error code of 1
+ if (!lstrcmpA(szInfo, "")) return 1;
+ return 0;
+}
+
+//============ NETLIB INITIALIZATION ============
+
+// initialize netlib support from weather protocol
+void NetlibInit() {
+ NETLIBUSER nlu={0};
+ nlu.cbSize=sizeof(nlu);
+ nlu.flags=NUF_OUTGOING|NUF_HTTPCONNS|NUF_NOHTTPSOPTION;
+ nlu.szSettingsModule= MODNAME;
+ nlu.szDescriptiveName= Translate("Non-IM Contacts");
+ hNetlibUser=(HANDLE)CallService(MS_NETLIB_REGISTERUSER,0,(LPARAM)&nlu);
+}
diff --git a/plugins/Non-IM Contact/src/main.cpp b/plugins/Non-IM Contact/src/main.cpp
new file mode 100644
index 0000000000..9a96749ed5
--- /dev/null
+++ b/plugins/Non-IM Contact/src/main.cpp
@@ -0,0 +1,199 @@
+//=====================================================
+// Includes
+//=====================================================
+
+#include "commonheaders.h"
+
+#include "Version.h"
+
+HINSTANCE hInst;
+int hLangpack;
+
+PLUGININFOEX pluginInfoEx = {
+ sizeof(pluginInfoEx),
+ __PLUGIN_NAME,
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
+ __DESCRIPTION,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
+ //2e0d2ae3-e123-4607-8539-d4448d675ddb
+ { 0x2e0d2ae3, 0xe123, 0x4607, {0x85, 0x39, 0xd4, 0x44, 0x8d, 0x67, 0x5d, 0xdb} }
+};
+
+INT_PTR doubleClick(WPARAM wParam,LPARAM lParam)
+{
+ char program[MAX_PATH], params[MAX_PATH];
+ int shellEXEerror = 0;
+ char* proto = GetContactProto((HANDLE)wParam);
+ if (proto && !strcmp(proto, MODNAME)) {
+ if (GetKeyState(VK_CONTROL)&0x8000) // ctrl is pressed
+ editContact((WPARAM)(HANDLE)wParam, (LPARAM)NULL); // for later when i add a second double click setting
+ else if (db_get_static((HANDLE)wParam, MODNAME, "Program", program) && strcmp(program, ""))
+ {
+ if (!db_get_static((HANDLE)wParam, MODNAME, "ProgramParams", params) )
+ strcpy(params, "");
+ if (strstr(program, "http://") || strstr(program, "https://"))
+ CallService(MS_UTILS_OPENURL,1,(LPARAM)program);
+ else shellEXEerror = (int)ShellExecuteA(NULL, NULL, program, params, NULL, SW_SHOW); //ignore the warning, its M$'s backwards compatabilty screwup :)
+ if (shellEXEerror == ERROR_FILE_NOT_FOUND || shellEXEerror == ERROR_PATH_NOT_FOUND)
+ CallService(MS_UTILS_OPENURL,1,(LPARAM)program);
+ }
+ else editContact((WPARAM)(HANDLE)wParam, (LPARAM)NULL);
+ return 1;
+ }
+ return 0;
+}
+
+//=====================================================
+// Definitions
+//=====================================================
+int LCStatus = ID_STATUS_OFFLINE;
+//=====================================================
+
+//=====================================================
+// Name : MainInit
+// Parameters: wparam , lparam
+// Returns : int
+// Description : Called at very beginning of plugin
+//=====================================================
+int NimcOptInit(WPARAM wParam,LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp = { sizeof(odp) };
+ odp.hInstance = hInst;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
+ odp.pszGroup = LPGEN("Plugins");
+ odp.pszTitle = LPGEN("Non-IM Contacts");
+ odp.pfnDlgProc = DlgProcNimcOpts;
+ Options_AddPage(wParam, &odp);
+ return 0;
+}
+
+int MainInit(WPARAM wparam,LPARAM lparam)
+{
+ return 0;
+}
+
+//=====================================================
+// Name : __declspec(dllexport) PLUGININFO* MirandaPluginInfo
+// Parameters: (DWORD mirandaVersion)
+// Returns :
+// Description : Sets plugin info
+//=====================================================
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+{
+ return &pluginInfoEx;
+}
+
+//=====================================================
+// Name : WINAPI DllMain
+// Parameters: HINSTANCE hinst,DWORD fdwReason,LPVOID lpvReserved
+// Returns : BOOL
+// Description :
+//=====================================================
+
+BOOL WINAPI DllMain(HINSTANCE hinst,DWORD fdwReason,LPVOID lpvReserved)
+{
+ hInst=hinst;
+ return TRUE;
+}
+
+int ModulesLoaded(WPARAM wParam,LPARAM lParam)
+{
+ NetlibInit();
+ return 0;
+}
+
+//=====================================================
+// Name : Load
+// Parameters: PLUGINLINK *link
+// Returns : int
+// Description : Called when plugin is loaded into Miranda
+//=====================================================
+
+extern "C" __declspec(dllexport) int Load()
+{
+ HookEvent(ME_CLIST_DOUBLECLICKED, (MIRANDAHOOK)doubleClick);
+ HookEvent(ME_OPT_INITIALISE,NimcOptInit);
+ HookEvent(ME_CLIST_STATUSMODECHANGE, SetLCStatus);
+
+ PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
+ pd.szName = MODNAME;
+ pd.type = PROTOTYPE_PROTOCOL;
+ CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+
+ //load services (the first 5 are the basic ones needed to make a new protocol)
+ CreateServiceFunction(MODNAME PS_GETCAPS, GetLCCaps);
+ CreateServiceFunction(MODNAME PS_GETNAME, GetLCName);
+ CreateServiceFunction(MODNAME PS_LOADICON, LoadLCIcon);
+ CreateServiceFunction(MODNAME PS_GETSTATUS, GetLCStatus);
+
+ CreateServiceFunction("AddLCcontact", addContact);
+ CreateServiceFunction("EditLCcontact", editContact);
+ CreateServiceFunction("LoadFilesDlg", LoadFilesDlg);
+ CreateServiceFunction("ExportLCcontacts", exportContacts);
+ CreateServiceFunction("ImportLCcontacts", ImportContacts);
+ CreateServiceFunction("TestStringReplaceLine", testStringReplacer);
+ CreateServiceFunction("NIM_Contact/DoubleClick", doubleClick);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.position = 600090000;
+ mi.pszPopupName = LPGEN("&Non-IM Contact");
+ mi.popupPosition = 600090000;
+ mi.pszName = LPGEN("&Add Non-IM Contact");
+ mi.pszService = "AddLCcontact";
+ mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_MAIN));
+ Menu_AddMainMenuItem(&mi);
+
+ mi.position = 600090001;
+ mi.pszName = LPGEN("&View/Edit Files");
+ mi.pszService = "LoadFilesDlg";
+ mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_MAIN));
+ Menu_AddMainMenuItem(&mi);
+
+ if (db_get_b(NULL, MODNAME, "Beta",0)) {
+ mi.position = 600090000;
+ mi.pszName = LPGEN("&Export all Non-IM Contacts");
+ mi.pszService = "ExportLCcontacts";
+ Menu_AddMainMenuItem(&mi);
+
+ mi.pszName = LPGEN("&Import Non-IM Contacts");
+ mi.pszService = "ImportLCcontacts";
+ Menu_AddMainMenuItem(&mi);
+ }
+
+ mi.position = 600090000;
+ mi.pszPopupName = LPGEN("&Non-IM Contact");
+ mi.pszName = LPGEN("&String Maker");
+ mi.pszService = "TestStringReplaceLine";
+ Menu_AddMainMenuItem(&mi);
+
+ mi.position = -2000080000;
+ mi.pszContactOwner = MODNAME;
+ mi.pszName = LPGEN("E&dit Contact Settings");
+ mi.pszService = "EditLCcontact";
+ mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_MAIN));
+ Menu_AddMainMenuItem(&mi);
+
+ hWindowList = (HWND)CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
+ HookEvent(ME_SYSTEM_MODULESLOADED,ModulesLoaded);
+
+ // known modules list
+ db_set_s(NULL, "KnownModules","Non-IM Contact", MODNAME);
+ return 0;
+}
+
+//=====================================================
+// Name : Unload
+// Parameters: void
+// Returns :
+// Description : Unloads plugin
+//=====================================================
+
+extern "C" __declspec(dllexport) int Unload(void)
+{
+ return 0;
+}
diff --git a/plugins/Non-IM Contact/src/namereplacing.cpp b/plugins/Non-IM Contact/src/namereplacing.cpp
new file mode 100644
index 0000000000..8f3f07e82e
--- /dev/null
+++ b/plugins/Non-IM Contact/src/namereplacing.cpp
@@ -0,0 +1,662 @@
+#include "commonheaders.h"
+
+int readFileIntoArray(int fileNumber, char *FileContents[])
+{
+ char dbSetting[20], temp[MAX_STRING_LENGTH];
+ wsprintfA(dbSetting, "fn%d", fileNumber);
+
+ DBVARIANT dbv;
+ char tszFileName[MAX_PATH];
+ if (db_get_ts(NULL,MODNAME, dbSetting, &dbv))
+ return 0;
+
+ if (!strncmp("http://", tszFileName, 7))
+ mir_snprintf(tszFileName, SIZEOF(tszFileName), "%s\\plugins\\fn%d.html", getMimDir(temp), fileNumber);
+
+ FILE* file = fopen(tszFileName, "r");
+ if (file == NULL)
+ return 0;
+
+ // read the file into the FileContents array
+ // free this array before stringReplacer() returns
+ int i;
+ for (i=0; fgets(temp, MAX_STRING_LENGTH-1, file); i++) {
+ if (temp[strlen(temp)-1]=='\n')
+ temp[strlen(temp)-1]='\0';
+ else temp[strlen(temp)]='\0';
+
+ FileContents[i] = (char*)malloc(strlen(temp)+1);
+ if (FileContents[i] == NULL) return i;
+ strcpy(FileContents[i], temp);
+ }
+ fclose(file);
+ return i;
+}
+
+int getNumber(const char* line)
+{
+ int i;
+ return sscanf(line, "%d", &i) == 1 ? i : -1;
+}
+
+int findWordInString(const char* line, const char* string, int* lengthOfWord, int flag) /* flag = 0 %from, flag = 1 %until */
+{
+ unsigned int i, j=0;
+ char word[64]="", OpenDivider[8], CloseDivider[8];
+ strcpy(OpenDivider, Translate("(\""));
+ strcpy(CloseDivider, Translate("\")"));
+ /* get the word we r looking for */
+ if (!strncmp(string, OpenDivider, strlen(OpenDivider))) {
+ for (i=2; strncmp(&string[i], CloseDivider, strlen(CloseDivider)); i++) {
+ word[j] = string[i];
+ word[++j] = '\0';
+ }
+ }
+ i=0;
+ *lengthOfWord = strlen(word)+strlen(CloseDivider)+strlen(OpenDivider);
+ /* find the word in the line */
+ while (i < (strlen(line) - strlen(word))) {
+ if (!strncmp(&line[i], word, strlen(word))) {
+ if (!flag) return i + strlen(word); /* the next char after the word */
+ else return i; /* the char before the word */
+ }
+ i++;
+ }
+ return -1;
+}
+
+int findLine(char* FileContents[], const char* string, int linesInFile,int startLine, int *positionInOldString)
+{
+ char tmp[5];
+ int i = getNumber(&string[*positionInOldString]);
+
+ // check if blank
+ if (string[*positionInOldString] == ')')
+ return startLine;
+
+ // check if its a number
+ if (i != -1) {
+ *positionInOldString += strlen(_itoa(i,tmp,10)) - 1;
+ return i;
+ }
+
+ // lastline
+ if (!strncmp(&string[*positionInOldString], Translate("lastline("), strlen(Translate("lastline(")))) {
+ *positionInOldString += strlen(Translate("lastline("));
+ i = getNumber(&string[*positionInOldString]);
+ if ( i != -1) {
+ *positionInOldString += strlen(_itoa(i,tmp,10));
+ return linesInFile - (i+1);
+ }
+
+ *positionInOldString ++;
+ return (linesInFile - 1);
+ }
+
+ // string
+ if (string[*positionInOldString] == '\"') {
+ char string2Find[256];
+ int j=0;
+ // get the word to find
+ for (i=(*positionInOldString+1); strncmp(&string[i], "\")", 2); i++) {
+ string2Find[j] = string[i];
+ string2Find[++j] = '\0';
+ }
+
+ // find the word
+ for (j=startLine; j<linesInFile;j++) {
+ if (strstr(FileContents[j], string2Find)) {
+ i = j;
+ break;
+ }
+ i = -1;
+ }
+ *positionInOldString += strlen(string2Find) + strlen(Translate("\"\")"));
+ if (i==-1) return i;
+ // allow for a +- after the word to go up or down lines
+ if (string[*positionInOldString] == '+') {
+ *positionInOldString += 1;
+ j = getNumber(&string[*positionInOldString]);
+ if (j != -1) {
+ *positionInOldString += strlen(_itoa(j,tmp,10))-2;
+ return i+j;
+ }
+ }
+ else if (string[*positionInOldString] == '-') {
+ *positionInOldString+=1;
+ j = getNumber(&string[*positionInOldString]);
+ if (j != -1) {
+ *positionInOldString += strlen(_itoa(j,tmp,10))-2;
+ return i-j;
+ }
+ }
+ else {
+ *positionInOldString -= 2;
+ return i;
+ }
+ }
+ return -1;
+}
+
+int findChar(char* FileContents[], const char* string, int linesInFile,int startLine, int *positionInOldString, int startChar, int startEnd) // 0=start, 1=end for startEnd
+{
+ char tmp[5];
+ int i = getNumber(&string[*positionInOldString]);
+ // check if its a number
+ if (i != -1) {
+ *positionInOldString += strlen(_itoa(i,tmp,10)) - 1;
+ return i;
+ }
+
+ // string
+ if (string[*positionInOldString] == '\"') {
+ char string2Find[256];
+ unsigned int j=0;
+ // get the word to find
+ for (i=(*positionInOldString+1); strncmp(&string[i], "\")", 2); i++) {
+ string2Find[j] = string[i];
+ string2Find[++j] = '\0';
+ }
+ // find the word
+ for (j=0;j<strlen(FileContents[startLine]);j++)
+ if (!strncmp(&FileContents[startLine][j], string2Find, strlen(string2Find)))
+ break;
+
+ if (j==strlen(FileContents[startLine]))
+ return -1;
+
+ *positionInOldString += strlen(string2Find)+1;
+ return (startEnd) ? j : j+strlen(string2Find);
+ }
+
+ // csv(
+ if (!strncmp(&string[*positionInOldString], Translate("csv("), strlen(Translate("csv(")))) {
+ char seperator;
+ int j=0, k=startChar;
+ *positionInOldString += strlen(Translate("csv("));
+ if (!strncmp(&string[*positionInOldString], "tab", 3)) {
+ *positionInOldString += 3;
+ seperator = '\t';
+ }
+ else if (!strncmp(&string[*positionInOldString], "space",5)) {
+ *positionInOldString += 5;
+ seperator = ' ';
+ }
+ else {
+ seperator =string[*positionInOldString];
+ *positionInOldString += 1;
+ }
+ i = getNumber(&string[*positionInOldString]);
+ if ( i == -1) return -1;
+ *positionInOldString += strlen(_itoa(i,tmp,10));
+ while (j<i) {
+ if (FileContents[startLine][k] == '\0') break;
+ if (FileContents[startLine][k] == seperator)
+ j++;
+ k++;
+ }
+ return k;
+ }
+ return -1;
+}
+
+// do the compare("A","B","X","Y")
+void checkStringForcompare(char *str)
+{
+ char *A,*B, *X, *Y , *newStr = (char*)malloc(strlen(str)), *copyOfStr = _strdup(str);
+ unsigned int i, j=0, s=strlen(str);
+ newStr[0] = '\0';
+ if (!strstr(str,Translate("compare(\""))) return;
+ for (i=0; i<s; i++) {
+ if (!strncmp(&str[i], Translate("compare(\""), strlen(Translate("compare(\"")))) {
+ i += strlen(Translate("compare(\""));
+ A = strtok(&copyOfStr[i], "\",\"");
+ B = strtok(NULL, "\",\"");
+ X = strtok(NULL, "\",\"");
+ Y = strtok(NULL, ",\")");
+ j = Y - &copyOfStr[i] + strlen(Y)+1;
+ if (A && B && X && Y)
+ {
+ if (!strcmp(A,B))
+ strcat(newStr, X);
+ else strcat(newStr, Y);
+ }
+ else strncat(newStr, &str[i], j);
+ i += j;
+ }
+ else strncat(newStr, &str[i], 1);
+ }
+ strcpy(str, newStr);
+ free(newStr);
+ free(copyOfStr);
+}
+
+// do save("A","B") A is DBVar name, B is value
+void checkStringForSave(HANDLE hContact, char* str)
+{
+ char *A,*B,*newStr = (char*)malloc(strlen(str)),*copyOfStr = _strdup(str);
+ unsigned int i, j=0, s=strlen(str);
+ newStr[0] = '\0';
+ if (!strstr(str,Translate("save(\""))) return;
+ for (i=0; i<s; i++) {
+ if (!strncmp(&str[i], Translate("save(\""), strlen(Translate("save(\"")))) {
+ i += strlen(Translate("save(\""));
+ A = strtok(&copyOfStr[i], "\",\"");
+ B = strtok(NULL, ",\")");
+ j = B - &copyOfStr[i] + strlen(B)+1;
+ if (A && B)
+ db_set_s(hContact,MODNAME, A, B);
+
+ else strncat(newStr, &str[i], j);
+ i += j;
+ }
+ else strncat(newStr, &str[i], 1);
+ }
+ strcpy(str, newStr);
+ free(newStr);
+ free(copyOfStr);
+}
+
+// do load("A") A is DBVar name
+void checkStringForLoad(HANDLE hContact, char* str)
+{
+ char *A,*newStr = (char*)malloc(strlen(str)),*copyOfStr = _strdup(str);
+ unsigned int i, j=0, s=strlen(str);
+ newStr[0] = '\0';
+ if (!strstr(str,Translate("load(\""))) return;
+ for (i=0; i<s; i++) {
+ if (!strncmp(&str[i], Translate("load(\""), strlen(Translate("load(\"")))) {
+ i += strlen(Translate("load(\""));
+ A = strtok(&copyOfStr[i], "\")");
+ j = A - &copyOfStr[i] + strlen(A)+1;
+ if (A) {
+ DBVARIANT dbv;
+ if ( !db_get_s(hContact, MODNAME, A, &dbv)) {
+ strcat(newStr, dbv.pszVal);
+ db_free(&dbv);
+ }
+ }
+ else strncat(newStr, &str[i], j);
+ i += j;
+ }
+ else strncat(newStr, &str[i], 1);
+ }
+ strcpy(str, newStr);
+ free(newStr);
+ free(copyOfStr);
+}
+
+// do saveN("A","B","C","D") A is module, B is setting, c is value, D is type 0/b 1/w 2/d 3/s
+void checkStringForSaveN(char* str)
+{
+ char *A,*B,*C,*D,*newStr = (char*)malloc(strlen(str)),*copyOfStr = _strdup(str);
+ unsigned int i, j=0, s=strlen(str);
+ newStr[0] = '\0';
+ if (!strstr(str,Translate("saveN(\""))) return;
+ for (i=0; i<s; i++) {
+ if (!strncmp(&str[i], Translate("saveN(\""), strlen(Translate("saveN(\"")))) {
+ i += strlen(Translate("saveN(\""));
+ A = strtok(&copyOfStr[i], "\",\"");
+ B = strtok(NULL, ",\"");
+ C = strtok(NULL, ",\"");
+ D = strtok(NULL, ",\")");
+ j = D - &copyOfStr[i] + strlen(D)+1;
+ if (A && B && C && D) {
+ switch (D[0]) {
+ case '0':
+ case 'b':
+ db_set_b(NULL, A, B, (BYTE)atoi(C));
+ break;
+ case '1':
+ case 'w':
+ db_set_w(NULL, A, B, (WORD)atoi(C));
+ break;
+ case '2':
+ case 'd':
+ db_set_dw(NULL, A, B, (DWORD)atoi(C));
+ break;
+ case '3':
+ case 's':
+ db_set_s(NULL, A, B, C);
+ break;
+ }
+ }
+ else strncat(newStr, &str[i], j);
+ i += j;
+ }
+ else strncat(newStr, &str[i], 1);
+ }
+ strcpy(str, newStr);
+ free(newStr);
+ free(copyOfStr);
+}
+
+// do loadN("A","B") A is module, B is setting
+void checkStringForLoadN(char* str)
+{
+ char *A,*B,*newStr = (char*)malloc(strlen(str)),*copyOfStr = _strdup(str), temp[32];
+ unsigned int i, j=0, s=strlen(str);
+ newStr[0] = '\0';
+ if (!strstr(str,Translate("loadN(\""))) return;
+ for (i=0; i<s; i++) {
+ if (!strncmp(&str[i], Translate("loadN(\""), strlen(Translate("loadN(\"")))) {
+ i += strlen(Translate("loadN(\""));
+ A = strtok(&copyOfStr[i], "\",\"");
+ B = strtok(NULL, ",\")");
+ j = B - &copyOfStr[i] + strlen(B)+1;
+ if (A && B) {
+ DBVARIANT dbv;
+ if ( !db_get(NULL, A, B, &dbv)) {
+ switch (dbv.type) {
+ case DBVT_BYTE:
+ strcat(newStr,_itoa(dbv.bVal,temp,10));
+ break;
+ case DBVT_WORD:
+ strcat(newStr,_itoa(dbv.wVal,temp,10));
+ break;
+ case DBVT_DWORD:
+ strcat(newStr,_itoa(dbv.dVal,temp,10));
+ break;
+ case DBVT_ASCIIZ:
+ strcat(newStr, dbv.pszVal);
+ break;
+ }
+ db_free(&dbv);
+ }
+ }
+ else strncat(newStr, &str[i], j);
+ i += j;
+ }
+ else strncat(newStr, &str[i], 1);
+ }
+ strcpy(str, newStr);
+ free(newStr);
+ free(copyOfStr);
+}
+
+BOOL GetLastWriteTime(HANDLE hFile, LPSTR lpszString)
+{
+ FILETIME ftCreate, ftAccess, ftWrite;
+ SYSTEMTIME stUTC, stLocal;
+
+ // Retrieve the file times for the file.
+ if (!GetFileTime(hFile, &ftCreate, &ftAccess, &ftWrite))
+ return FALSE;
+
+ // Convert the last-write time to local time.
+ FileTimeToSystemTime(&ftWrite, &stUTC);
+ SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal);
+
+ // Build a string showing the date and time.
+ wsprintfA(lpszString, "%02d/%02d/%d %02d:%02d",
+ stLocal.wDay, stLocal.wMonth, stLocal.wYear,
+ stLocal.wHour, stLocal.wMinute);
+
+ return TRUE;
+}
+
+// do lastchecked(file(X)) returns amount of chars to add to str pointer
+int lastChecked(char *newStr, const char *str)
+{
+ char *szPattern = Translate("lastchecked(file(");
+ size_t cbPattern = strlen(szPattern);
+
+ if (!strncmp(str, szPattern, cbPattern)) {
+ int file;
+ char tszFileName[MAX_PATH], temp[MAX_PATH], szSetting[20];
+ sscanf(&str[cbPattern], "%d", &file);
+ mir_snprintf(szSetting, SIZEOF(szSetting), "fn%d", file);
+
+ DBVARIANT dbv;
+ if (db_get_s(NULL, MODNAME, szSetting, &dbv))
+ return 0;
+
+ if (!strncmp("http://", dbv.pszVal, 7) || !strncmp("https://", dbv.pszVal, 8))
+ mir_snprintf(tszFileName, SIZEOF(tszFileName), "%s\\plugins\\fn%d.html", getMimDir(temp), file);
+ else
+ strncpy(tszFileName, dbv.pszVal, SIZEOF(tszFileName));
+ HANDLE hFile = CreateFileA(tszFileName, 0, FILE_SHARE_READ, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (hFile == INVALID_HANDLE_VALUE)
+ return 0;
+
+ if (GetLastWriteTime(hFile, tszFileName)) {
+ CloseHandle(hFile);
+ strcat(newStr, tszFileName);
+ _snprintf(tszFileName, MAX_PATH, "%s%d))", szPattern, file);
+ return strlen(tszFileName);
+ }
+ CloseHandle(hFile);
+ }
+ return 0;
+}
+
+
+// do icon(x) 0=offline, 1=online, 10=lunch
+void checkIcon(HANDLE hContact, char* string)
+{
+ char* str = strstr(string,"icon(");
+ if (str) {
+ int icon = getNumber(str+5);
+ if (icon >=0)
+ db_set_w(hContact, MODNAME, "Status", (WORD)(ID_STATUS_OFFLINE+icon));
+ }
+}
+
+int stringReplacer(const char* oldString, char* newString, HANDLE hContact)
+{
+ char var_file[8];
+ int tempInt;
+ int startLine = 0, endLine = 0, startChar=0, endChar = 0, wholeLine=-1, linesInFile;
+ int positionInOldString = 0;
+ char *fileContents[MAXLINES] = {NULL}, tempString[MAX_STRING_LENGTH];
+
+ // setup the variable names
+ strcpy(newString, "");
+ strcpy(var_file, Translate("file("));
+
+ while ((positionInOldString < (int)strlen(oldString)) && (oldString[positionInOldString] != '\0'))
+ {
+ // load the file... must be first
+ if (!strncmp(&oldString[positionInOldString], var_file, strlen(var_file)))
+ {
+ positionInOldString += strlen(var_file);
+ // check if its a number
+ tempInt = getNumber(&oldString[positionInOldString]);
+ if (tempInt == -1)
+ {
+ // not a number so check vars..
+ // there are none yet
+ return ERROR_NO_FILE;
+ }
+ // read the file
+ linesInFile = readFileIntoArray(tempInt, fileContents);
+ if (linesInFile == 0) return ERROR_NO_FILE;
+ positionInOldString += strlen(_itoa(tempInt, tempString,10)) + 1; // +1 for the closing )
+
+ // wholeline()
+ if (!strncmp(&oldString[positionInOldString], Translate("wholeline(line("), strlen(Translate("wholeline(line("))))
+ {
+ positionInOldString += strlen(Translate("wholeline(line("));
+ tempInt = findLine(fileContents,oldString, linesInFile, startLine,&positionInOldString);
+ if (tempInt == -1|| !fileContents[tempInt])
+ return ERROR_NO_LINE_AFTER_VAR_F;
+ else wholeLine =tempInt;
+ positionInOldString += 3; // add 2 for the )) for wholeline(line())
+ }
+
+ if (!strncmp(&oldString[positionInOldString], Translate("start("), strlen(Translate("start("))))
+ {
+ positionInOldString += strlen(Translate("start(line("));
+ tempInt = findLine(fileContents,oldString, linesInFile, startLine,&positionInOldString);
+ if (tempInt == -1 || !fileContents[tempInt])
+ return ERROR_NO_LINE_AFTER_VAR_F;
+ else
+ {
+ positionInOldString+=2;
+ startLine = tempInt;
+ if (!endChar ) endChar = strlen(fileContents[startLine]);
+ tempInt = findChar(fileContents,oldString, linesInFile, startLine,&positionInOldString, startChar,0);
+ if (tempInt == -1)
+ return ERROR_NO_LINE_AFTER_VAR_F;
+ else startChar = tempInt;
+ }
+ positionInOldString += 2; // add 2 for the )) for start(line())
+ }
+ if (!strncmp(&oldString[positionInOldString], Translate("end("), strlen(Translate("end("))))
+ {
+ positionInOldString += strlen(Translate("end(line("));
+ tempInt = findLine(fileContents,oldString, linesInFile, startLine,&positionInOldString);
+ if (tempInt == -1 || !fileContents[tempInt])
+ return ERROR_NO_LINE_AFTER_VAR_F;
+ else
+ {
+ positionInOldString+=2;
+ endLine = tempInt;
+ tempInt = findChar(fileContents,oldString, linesInFile, startLine,&positionInOldString, startChar,1);
+ if (tempInt == -1)
+ return ERROR_NO_LINE_AFTER_VAR_F;
+ else endChar = tempInt;
+ }
+ positionInOldString += 2; // add 2 for the )) for end(line())
+ }
+ // check for both start() and end() otherwise, only copying 1 line
+ if (!strstr(oldString, Translate("start("))) startLine = endLine;
+ if (!strstr(oldString, Translate("end("))) endLine = startLine;
+ // after all the options copy the line across and add 2 to positionInOldString for the file(print(....))
+ if (wholeLine >= 0) strcat(newString, fileContents[wholeLine]);
+ else
+ {
+ // only copying from 1 line
+ if (startLine == endLine)
+ strncat(newString, &fileContents[startLine][startChar], endChar - startChar);
+ else
+ {
+ int i;
+ // copy the whole first line from startChar
+ strcat(newString, &fileContents[startLine][startChar]);
+ // copy the middle lines across
+ for (i=(startLine+1);i<endLine;i++)
+ {
+ strcat(newString, fileContents[i]);
+ }
+ // copy the last line untill endChar
+ strncat(newString, fileContents[endLine], endChar);
+ }
+ }
+ }
+ // filename()
+ else if (!strncmp(&oldString[positionInOldString], Translate("filename("), strlen(Translate("filename("))))
+ {
+ positionInOldString += strlen(Translate("filename("));
+ tempInt = getNumber(&oldString[positionInOldString]);
+ if (tempInt == -1)
+ {
+ return ERROR_NO_FILE;
+ }
+ else
+ {
+ wsprintfA(tempString, "fn%d", tempInt);
+ if (db_get_static(NULL, MODNAME,tempString, tempString))
+ strcat(newString, tempString);
+ else return ERROR_NO_FILE;
+ positionInOldString += strlen(_itoa(tempInt, tempString, 10))+1;
+ }
+ }
+ // lastchecked(file(X))
+ else if (!strncmp(&oldString[positionInOldString], Translate("lastchecked(file("), strlen(Translate("lastchecked(file("))))
+ {
+ positionInOldString += lastChecked(newString, &oldString[positionInOldString]);
+ }
+ else
+ {
+ strncat(newString, &oldString[positionInOldString], 1);
+ positionInOldString++;
+ }
+ }
+ // free the file strings
+ for (tempInt=0; (fileContents[tempInt] != NULL) && (tempInt<MAXLINES); tempInt++)
+ free(fileContents[tempInt]);
+
+
+
+ // check for load("A","B")
+ checkStringForLoad(hContact, newString);
+ // and loadN(...)
+ checkStringForLoadN(newString);
+ // check for compare("A","B","X","Y")
+ checkStringForcompare(newString);
+ // check for save("A","B")
+ checkStringForSave(hContact, newString);
+ // and saveN(...)
+ checkStringForSaveN(newString);
+ return 1;
+}
+
+void stripWhiteSpace(char* string)
+{
+ int i=0;
+ while (string[i] != '\0')
+ {
+ if ( (string[i] == '\t') || (string[i] == '\r') || (string[i] == '\n') )
+ string[i] = ' ';
+ i++;
+ }
+}
+void WriteSetting(HANDLE hContact, char* module1, char* setting1 , char* module2, char* setting2)
+{
+ char text[MAX_STRING_LENGTH], newString[MAX_STRING_LENGTH];
+ int error = 0, status = GetLCStatus(0,0);
+ if (db_get_static(hContact, module1, setting1, text)) {
+ switch (stringReplacer(text, newString, hContact)) {
+ case ERROR_NO_LINE_AFTER_VAR_F:
+ wsprintfA(newString, Translate("%s - ERROR: no line specified or line not found (in %s)"),text, setting1);
+ error = 1;
+ break;
+ case ERROR_LINE_NOT_READ:
+ wsprintfA(newString, Translate("%s - ERROR: file couldnt be opened (in %s)"), text, setting1);
+ error = 1;
+ break;
+ case ERROR_NO_FILE:
+ wsprintfA(newString, Translate("%s - ERROR: no file specified in settings (in %s)"), text, setting1);
+ error = 1;
+ break;
+ default:
+ error = 0;
+ break;
+ }
+ // strip the tab and new lines from all except the tooltip
+ if (!error && strcmp(setting1, "ToolTip")) stripWhiteSpace(newString);
+ db_set_s(hContact, module2, setting2, newString);
+ }
+ else db_set_s(hContact, module2, setting2, "");
+ if (!error)
+ {
+ if ( (status == ID_STATUS_ONLINE) || (status == ID_STATUS_AWAY) ||
+ (status == db_get_w(hContact, MODNAME, "Icon", ID_STATUS_ONLINE) ) ||
+ db_get_b(hContact, MODNAME ,"AlwaysVisible", 0)
+ )
+ db_set_w(hContact, MODNAME, "Status", (WORD)db_get_w(hContact, MODNAME, "Icon", ID_STATUS_ONLINE));
+ else db_set_w(hContact, MODNAME, "Status", ID_STATUS_OFFLINE);
+ }
+ else db_set_w(hContact, MODNAME, "Status", ID_STATUS_OFFLINE);
+}
+
+void replaceAllStrings(HANDLE hContact)
+{
+ char tmp1[256], tmp2[256], tmp3[256];
+ WriteSetting(hContact, MODNAME, "Name", MODNAME, "Nick");
+ WriteSetting(hContact, MODNAME, "ProgramString", MODNAME, "Program");
+ WriteSetting(hContact, MODNAME, "ProgramParamsString", MODNAME, "ProgramParams");
+ /* tooltips*/
+ WriteSetting(hContact, MODNAME, "ToolTip", "UserInfo", "MyNotes");
+ if (db_get_static(hContact, MODNAME, "Program", tmp1) && db_get_static(hContact, MODNAME, "ProgramParams", tmp2)) {
+ wsprintfA(tmp3, "%s %s", tmp1, tmp2);
+ db_set_s(hContact, "UserInfo", "FirstName", tmp3);
+ }
+ else if (db_get_static(hContact, MODNAME, "Program", tmp1))
+ {
+ db_set_s(hContact, "UserInfo", "FirstName", tmp1);
+ }
+ else db_set_s(hContact, "UserInfo", "FirstName", "");
+}
+
diff --git a/plugins/Non-IM Contact/src/resource.h b/plugins/Non-IM Contact/src/resource.h
new file mode 100644
index 0000000000..928cde8564
--- /dev/null
+++ b/plugins/Non-IM Contact/src/resource.h
@@ -0,0 +1,77 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by resource.rc
+//
+#define IDD_ADD_FILE 101
+#define IDI_MAIN 103
+#define IDD_CONTACT_INFO 104
+#define IDD_OTHER_STUFF 105
+#define IDI_ICON1 106
+#define IDD_CONTACT_COPYEXPORT 108
+#define IDD_OPTIONS 109
+#define IDD_TEST_LINE 110
+#define IDD_HELP 111
+#define IDC_FN 1000
+#define IDC_FILE_LIST 1001
+#define IDC_ADD_FILE 1002
+#define IDC_ADD_FILE2 1003
+#define IDC_DEL_FILE 1004
+#define IDC_FILE_CONTENTS 1005
+#define IDC_URL 1006
+#define IDC_ADD_URL 1007
+#define IDC_DISPLAY_NAME 1007
+#define IDC_TOOLTIP 1008
+#define IDC_GROUP 1008
+#define IDC_HELPMSG 1009
+#define IDC_LINK 1010
+#define IDC_PARAMS 1011
+#define IDC_OPEN_FILE 1012
+#define IDC_OPEN_FOLDER 1013
+#define CHK_USE_TIMER 1016
+#define IDC_TIMER 1017
+#define IDC_MINUTES 1018
+#define IDC_SECONDS 1019
+#define CHK_CTRL 1020
+#define IDC_WWW_TIMER 1022
+#define IDC_STRING_REPLACE 1025
+#define IDC_DOIT 1026
+#define IDC_EXPORT 1027
+#define IDC_ALWAYS_VISIBLE 1028
+#define IDC_VISIBLE_UNLESS_OFFLINE 1029
+#define IDC_IGNORE_GLOBALSTATUS 1030
+#define IDC_DISABLETIMER 1031
+#define IDC_TIMER_INT 1036
+#define IDC_AWAYISNOTONLINE 1037
+#define IDC_TIMER_TEXT 1039
+#define IDC_TIMER_MSG 1040
+#define IDC_STRING 1041
+#define IDC_ANSWER 1042
+#define IDC_LINE 1043
+#define IDC_START 1045
+#define IDC_END 1046
+#define IDC_WHOLELINE 1047
+#define IDC_CSV 1048
+#define IDC_FILE 1049
+#define IDC_FILENAME 1050
+#define IDC_TIMER_INTERVAL_MSG 1053
+#define IDC_HELPTEXT 1055
+#define CHK_ONLINE 40072
+#define CHK_AWAY 40073
+#define CHK_DND 40074
+#define CHK_NA 40075
+#define CHK_OCC 40076
+#define CHK_FFC 40077
+#define CHK_INVISIBLE 40078
+#define CHK_PHONE 40079
+#define CHK_LUNCH 40080
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 112
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1057
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/plugins/Non-IM Contact/src/services.cpp b/plugins/Non-IM Contact/src/services.cpp
new file mode 100644
index 0000000000..1e547fb80c
--- /dev/null
+++ b/plugins/Non-IM Contact/src/services.cpp
@@ -0,0 +1,127 @@
+#include "commonheaders.h"
+
+//=======================================================
+//db_get_static
+//=======================================================
+int db_get_static(HANDLE hContact, const char *szModule, const char *szSetting, char *value)
+{
+ DBVARIANT dbv;
+ if (!DBGetContactSetting(hContact, szModule, szSetting, &dbv))
+ {
+ strcpy(value, dbv.pszVal);
+ db_free(&dbv);
+ return 1;
+ }
+ else
+ {
+ db_free(&dbv);
+ return 0;
+ }
+
+ return 0;
+}
+
+//=======================================================
+//GetCaps
+//=======================================================
+
+INT_PTR GetLCCaps(WPARAM wParam,LPARAM lParam)
+{
+ if (wParam==PFLAGNUM_1)
+ return 0;
+ if (wParam==PFLAGNUM_2)
+ return PF2_ONLINE|PF2_LONGAWAY|PF2_SHORTAWAY|PF2_LIGHTDND|PF2_HEAVYDND|PF2_FREECHAT|PF2_INVISIBLE|PF2_OUTTOLUNCH|PF2_ONTHEPHONE; // add the possible statuses here.
+ if (wParam==PFLAGNUM_3)
+ return 0;
+ return 0;
+}
+
+//=======================================================
+//GetName
+//=======================================================
+INT_PTR GetLCName(WPARAM wParam,LPARAM lParam)
+{
+ lstrcpynA((char*)lParam, MODNAME, wParam);
+ return 0;
+}
+
+//=======================================================
+//BPLoadIcon
+//=======================================================
+INT_PTR LoadLCIcon(WPARAM wParam,LPARAM lParam)
+{
+ UINT id;
+
+ switch(wParam & 0xFFFF) {
+ case PLI_PROTOCOL: id=IDI_MAIN; break; // IDI_MAIN is the main icon for the protocol
+ default: return (int)(HICON)NULL;
+ }
+ return (int)LoadImage(hInst,MAKEINTRESOURCE(id),IMAGE_ICON,GetSystemMetrics(wParam&PLIF_SMALL?SM_CXSMICON:SM_CXICON),GetSystemMetrics(wParam&PLIF_SMALL?SM_CYSMICON:SM_CYICON),0);
+}
+
+//=======================================================
+//SetFStatus
+//=======================================================
+int SetLCStatus(WPARAM wParam,LPARAM lParam)
+{
+ int oldStatus;
+ HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ const char* szProto = (const char*)lParam;
+ if (szProto && strcmp(szProto, MODNAME)) return 0; // not nimc so ignore anyway...
+ else if (!szProto && db_get_b(NULL, MODNAME, "IgnoreGlobalStatusChange",0)) return 0; // global change and being ignored
+ else {
+ oldStatus = LCStatus;
+ LCStatus = wParam;
+ db_set_w(NULL, MODNAME, "Status", (WORD)wParam);
+ db_set_w(NULL, MODNAME, "timerCount",0);
+ if (LCStatus == ID_STATUS_OFFLINE || (LCStatus == ID_STATUS_AWAY && !db_get_b(NULL, MODNAME, "AwayAsStatus", 0)) || !db_get_w(NULL, MODNAME, "Timer",1)) killTimer();
+ else if (db_get_w(NULL, MODNAME, "Timer",1))
+ startTimer(TIMER);
+ while (hContact) {
+ char* proto = GetContactProto(hContact);
+ if (proto && !strcmp(proto, MODNAME)) {
+ if (LCStatus != ID_STATUS_OFFLINE) replaceAllStrings(hContact);
+ switch (LCStatus) {
+ case ID_STATUS_OFFLINE:
+ if (db_get_b(hContact, MODNAME, "AlwaysVisible",0) && !db_get_b(hContact, MODNAME, "VisibleUnlessOffline",1))
+ db_set_w(hContact,MODNAME, "Status",(WORD)db_get_w(hContact,MODNAME, "Icon",ID_STATUS_ONLINE));
+ else
+ db_set_w(hContact,MODNAME, "Status", ID_STATUS_OFFLINE);
+ break;
+ case ID_STATUS_ONLINE:
+ db_set_w(hContact,MODNAME, "Status",(WORD)db_get_w(hContact,MODNAME, "Icon",ID_STATUS_ONLINE));
+ break;
+ case ID_STATUS_AWAY:
+ if (db_get_b(NULL, MODNAME, "AwayAsStatus", 0) && (db_get_b(hContact, MODNAME, "AlwaysVisible",0) || (db_get_w(hContact,MODNAME, "Icon",ID_STATUS_ONLINE)==ID_STATUS_AWAY)) )
+ db_set_w(hContact,MODNAME, "Status",(WORD)(WORD)db_get_w(hContact,MODNAME, "Icon",ID_STATUS_ONLINE));
+ else if (!db_get_b(NULL, MODNAME, "AwayAsStatus", 0))
+ db_set_w(hContact,MODNAME, "Status",(WORD)db_get_w(hContact,MODNAME, "Icon",ID_STATUS_ONLINE));
+ else
+ db_set_w(hContact,MODNAME, "Status", ID_STATUS_OFFLINE);
+ break;
+ default:
+ if (db_get_b(hContact, MODNAME, "AlwaysVisible",0) || LCStatus == db_get_w(hContact,MODNAME, "Icon",ID_STATUS_ONLINE))
+ db_set_w(hContact,MODNAME, "Status",(WORD)db_get_w(hContact,MODNAME, "Icon",ID_STATUS_ONLINE));
+ break;
+ }
+ }
+ hContact = db_find_next(hContact);
+ }
+ ProtoBroadcastAck(MODNAME,NULL,ACKTYPE_STATUS,ACKRESULT_SUCCESS,(HANDLE)oldStatus,wParam);
+ }
+ return 0;
+}
+
+
+
+//=======================================================
+//GetStatus
+//=======================================================
+INT_PTR GetLCStatus(WPARAM wParam,LPARAM lParam)
+{
+ if ((LCStatus >= ID_STATUS_ONLINE) && (LCStatus <= ID_STATUS_OUTTOLUNCH))
+ return LCStatus;
+ else
+ return ID_STATUS_OFFLINE;
+}
+
diff --git a/plugins/Non-IM Contact/src/stdafx.cpp b/plugins/Non-IM Contact/src/stdafx.cpp
new file mode 100644
index 0000000000..e7e41dae3c
--- /dev/null
+++ b/plugins/Non-IM Contact/src/stdafx.cpp
@@ -0,0 +1,18 @@
+/*
+Copyright (C) 2012-13 Miranda NG Project (http://miranda-ng.org)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation version 2
+of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "commonheaders.h" \ No newline at end of file
diff --git a/plugins/Non-IM Contact/src/timer.cpp b/plugins/Non-IM Contact/src/timer.cpp
new file mode 100644
index 0000000000..42e2b47df1
--- /dev/null
+++ b/plugins/Non-IM Contact/src/timer.cpp
@@ -0,0 +1,84 @@
+#include "commonheaders.h"
+
+UINT_PTR timerId;
+
+//=====================================================
+// Name : timerProc
+// Parameters: none
+// Returns : void
+// Description : called when the timer interval occurs
+//=====================================================
+
+void timerFunc(LPVOID di)
+{
+ char text[512], fn[16], szFileName[MAX_PATH], temp[MAX_PATH];
+
+ int timerCount = db_get_w(NULL, MODNAME, "timerCount",1)+1;
+
+ if (LCStatus == ID_STATUS_OFFLINE) {
+ killTimer();
+ return;
+ }
+ db_set_w(NULL, MODNAME, "timerCount", (WORD)timerCount);
+
+ /* update the web pages*/
+ for (int i=0; ;i++) {
+ sprintf(fn, "fn%d", i);
+ if (!db_get_static(NULL, MODNAME, fn, text))
+ break;
+
+ if (!strncmp("http://", text, strlen("http://"))) {
+ strcat(fn, "_timer");
+ int timer = db_get_w(NULL, MODNAME, fn, 60);
+ if (timer && !(timerCount % timer)) {
+ if (!InternetDownloadFile(text)) {
+ mir_snprintf(szFileName, SIZEOF(szFileName), "%s\\plugins\\fn%d.html", getMimDir(temp), i);
+ savehtml(szFileName);
+ }
+ }
+ }
+ }
+
+ /* update all the contacts */
+ for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ if (!strcmp(MODNAME, GetContactProto(hContact))) {
+ int timer = db_get_w(hContact, MODNAME, "Timer", 15);
+ if (timer && !(timerCount % timer))
+ if (db_get_static(hContact, MODNAME, "Name", text))
+ replaceAllStrings(hContact);
+ }
+ }
+}
+
+void CALLBACK timerProc(HWND, UINT, UINT_PTR, DWORD)
+{
+ // new thread for the timer...
+ forkthread(timerFunc, 0, 0);
+}
+
+//=====================================================
+// Name : startTimer
+// Parameters: int interval
+// Returns : int
+// Description : starts the timer
+//=====================================================
+
+int startTimer(int interval)
+{
+ timerId = SetTimer(NULL, 0, interval, timerProc);
+ return 0;
+}
+
+//=====================================================
+// Name : killTimer
+// Parameters: none
+// Returns : int
+// Description : stops the timer
+//=====================================================
+
+int killTimer()
+{
+ db_set_w(NULL, MODNAME, "timerCount",0);
+ KillTimer(NULL,timerId);
+ return 0;
+}