diff options
author | Robert Pösel <robyer@seznam.cz> | 2013-02-13 10:46:57 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2013-02-13 10:46:57 +0000 |
commit | a249b34c4be0de060a44c342e43a43f95dcf1874 (patch) | |
tree | 95b43dac9bf64aa0d4dd6626976db545abbfc3e4 /plugins | |
parent | bddc30f7d1f00d51bf348517bd429bd28f3f749c (diff) |
Added rps and statuschange plugins sources (not adopted)
git-svn-id: http://svn.miranda-ng.org/main/trunk@3587 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/!NotAdopted/rps/Docs/rps_changelog.txt | 22 | ||||
-rw-r--r-- | plugins/!NotAdopted/rps/Docs/rps_readme.txt | 22 | ||||
-rw-r--r-- | plugins/!NotAdopted/rps/Docs/rps_version.txt | 1 | ||||
-rw-r--r-- | plugins/!NotAdopted/rps/RemovePersonalSettings.ini | 247 | ||||
-rw-r--r-- | plugins/!NotAdopted/rps/ZIP/doit.bat | 58 | ||||
-rw-r--r-- | plugins/!NotAdopted/rps/rps.c | 833 | ||||
-rw-r--r-- | plugins/!NotAdopted/rps/rps.dsp | 127 | ||||
-rw-r--r-- | plugins/!NotAdopted/rps/rps.dsw | 33 | ||||
-rw-r--r-- | plugins/!NotAdopted/statuschange/StatusChange.dsp | 131 | ||||
-rw-r--r-- | plugins/!NotAdopted/statuschange/main.c | 402 | ||||
-rw-r--r-- | plugins/!NotAdopted/statuschange/resource.h | 28 | ||||
-rw-r--r-- | plugins/!NotAdopted/statuschange/resource.rc | 145 | ||||
-rw-r--r-- | plugins/!NotAdopted/statuschange/resrc1.h | 21 |
13 files changed, 2070 insertions, 0 deletions
diff --git a/plugins/!NotAdopted/rps/Docs/rps_changelog.txt b/plugins/!NotAdopted/rps/Docs/rps_changelog.txt new file mode 100644 index 0000000000..1b1091452b --- /dev/null +++ b/plugins/!NotAdopted/rps/Docs/rps_changelog.txt @@ -0,0 +1,22 @@ +Remove Personal Settings
+
+Changelog:
+
+. 0.1.0.4
+ + Added * to delete module names
+ + Added miranda 0.8 support
+ + Updated ini file
+
+. 0.1.0.3
+ + Added option to delete modules based on a sufix of the protocol name
+ + Added * to delete settings names
+ + Added config to delete alarms and sent files
+
+. 0.1.0.2
+ + Added SetProtocolsOffline
+ * Bugfixes
+
+. 0.1.0.1
+ + Added RemoveWholeProtocolModule
+ + Added DisabledProtocols to delete settings from these
+ + Added deletion of events from DB
\ No newline at end of file diff --git a/plugins/!NotAdopted/rps/Docs/rps_readme.txt b/plugins/!NotAdopted/rps/Docs/rps_readme.txt new file mode 100644 index 0000000000..f6aed13a06 --- /dev/null +++ b/plugins/!NotAdopted/rps/Docs/rps_readme.txt @@ -0,0 +1,22 @@ +Remove Personal Settings plugin
+-------------------------------
+
+WARNING: THIS PLUGIN DELETE SETTINGS FROM MIRANDA DB AND FROM THE HD. THIS CAN'T BE UNDONE. IT CAN DELETE ALL FILES IN YOUR COMPUTER (ALTOUGHT IT NEVER HAPPENED TO ME :P ). USE IT AT YOUR OWN RISK.
+
+This is a plugin that removes personal settings from database.
+
+It can remove all users, remove some files and directories from miranda dir (but only if these aren't beeing used), call services and disable plugins. To do that it is based in a configuration .ini file. If you need some especial configuration (and probabily you will need, because I just put some settings there, but I bet I forgot some), just edit the file RemovePersonalSettings.ini
+
+The idea for using this plugin is to allow sending a copy of you miranda with your actual configuration, but without your personal settings. To use it, you should:
+1) Copy the hole miranda dir to other location
+2) Enable the plugin (if it isn't enabled)
+4) Set global status to offline
+3) Run the menu option "Remove personal settings..."
+4) Exit miranda
+4) Run DBTOOL.EXE to compact sweeped database file
+5) Pack and send to your friend
+
+I made this based on the discussion in the thread:
+http://forums.miranda-im.org/showthread.php?t=5224. I asked the source from nullbie and made my version of the plugin.
+
+To report bugs/make suggestions, go to the forum thread: http://forums.miranda-im.org/showthread.php?t=5451
diff --git a/plugins/!NotAdopted/rps/Docs/rps_version.txt b/plugins/!NotAdopted/rps/Docs/rps_version.txt new file mode 100644 index 0000000000..affe4aa1c3 --- /dev/null +++ b/plugins/!NotAdopted/rps/Docs/rps_version.txt @@ -0,0 +1 @@ +Remove Personal Settings 0.1.0.4
\ No newline at end of file diff --git a/plugins/!NotAdopted/rps/RemovePersonalSettings.ini b/plugins/!NotAdopted/rps/RemovePersonalSettings.ini new file mode 100644 index 0000000000..789803de56 --- /dev/null +++ b/plugins/!NotAdopted/rps/RemovePersonalSettings.ini @@ -0,0 +1,247 @@ +[GlobalSettings]
+; Set protocol status to offline before any other action
+; true or false
+; default=true
+SetProtocolsOffline=true
+
+; Remove all folders that have protocol names inside miranda folder
+; true or false
+; default=true
+RemoveProtocolFolders=true
+
+; Remove all miranda users
+; true or false
+; default=true
+RemoveAllUsers=true
+
+; Remove some default settings for all enabled protocols
+; The name of the module has to be the same name as the name of the protocol
+; These are the ones under ProtocolSettings
+; true or false
+; default=true
+RemoveProtocolSettings=true
+
+; Remove all settings inside the protocol module
+; (and not only the ones at ProtocolSettings)
+; true or false
+; default=false
+RemoveWholeProtocolModule=false
+
+[DisabledProtocols]
+; Names of protocols that are disabled, but have to has its settings deleted
+; The case must be correct!
+YAHOO
+YAHOO1
+YAHOO2
+YAHOO3
+YAHOO4
+MSN
+MSN1
+MSN2
+MSN3
+MSN4
+ICQ
+ICQ1
+ICQ2
+ICQ3
+ICQ4
+GG
+GG1
+GG2
+GG3
+GG4
+JABBER
+JABBER1
+JABBER2
+JABBER3
+JABBER4
+JGMAIL
+JGMAIL1
+JGMAIL2
+JGMAIL3
+JGMAIL4
+MEEBO
+MEEBO1
+MEEBO2
+MEEBO3
+MEEBO4
+AIM
+AIM1
+AIM2
+AIM3
+AIM4
+SKYPE
+MYSPACE
+
+[ProtocolSettings]
+; Settings that will be erased for all enabled protocols if RemoveProtocolSettings == true
+; Names with spaces or strange chars must be surrounded by "
+Password
+"Nick"
+LoginName
+DisplayName
+PNick
+SN
+Name
+FirstName
+LastName
+Username
+UserName
+User
+UID
+Timezone
+e-mail
+Email
+email
+UIN
+IdleTS
+InfoTS
+LogonTS
+MemberTS
+LastSyncTime
+PictObject
+YourHost
+AvatarFile
+AvatarFilename
+AvatarHash
+AvatarSaved
+ImageURL
+BirthDay
+BirthMonth
+BirthYear
+MaritalStatus
+Gender
+Age
+CompanyOccupation
+Country
+OriginCountry
+Location
+InfoCP
+PublishPrimaryEmail
+SrvAvatarID
+SrvDefGroupId
+SrvLastUpdate
+SrvRecordCount
+SrvVisibility
+SrvVisibilityID
+XStatusMsg
+XStatusMessage
+AlernativeNick
+Status
+ServerComboSelection
+UserID
+Resource
+FirstRun
+WebAvare
+FullName
+LoginName
+"First Name"
+"Last Name"
+jid
+Profile
+NLProxyPort
+NLProxyServer
+City
+Language1
+Language2
+Language3
+Past0
+IP
+RealIP
+State
+QuitMessage
+UserInfo
+GenderString
+GoogleToken
+Override
+yahoo_id
+AvatarURL
+AvatarInv
+
+[ProtocolModuleSufixes]
+; Strings here will be appended to each protocol name and the module with this name
+; will be deleted (the whole module)
+; Names with spaces or strange chars must be surrounded by "
+Groups
+SrvGroups
+P2P
+:HotmailNotify
+
+[RemoveSettings]
+; Settings that should be removed
+; Only from hContact == NULL
+; To remove a module, use ModuleName
+; To remove a setting, use ModuleName/SettingName
+; To remove all settings that start with a name, use * as last char
+; Ex: Test/Test*
+; To remove all settings that end with a name, use * as first key char
+; Ex: Test/*Test
+; Settings are case sensitive
+; Names with spaces or strange chars must be surrounded by "
+"Gmail Notifier/name"
+"Gmail Notifier/pass"
+POP3
+pattern
+Options
+ContactPhoto/File
+MIMImport
+*/Password
+*/password
+FTPFile/password
+FTPFile/user
+FTPFile/url
+FTPFile/server
+SMSPlugin
+SRFile/MruDir*
+SRFile/RecvFilesDirAdv
+UserOnline
+WebSMS-Plugin/LastNumber*
+WebSMS-Plugin/LastPrefix*
+"WinPopup Protocol/Nick"
+"WinPopup Protocol/User"
+"WinPopup Protocol/Workgroup"
+NET_SEND/loging_name
+Alarm/ActionFlags*
+Alarm/Desc*
+Alarm/Hidden*
+Alarm/Occ*
+Alarm/NoStartup*
+Alarm/Snoozer*
+Alarm/SoundNum*
+Alarm/STDay*
+Alarm/STHour*
+Alarm/STMinute*
+Alarm/STMonth*
+Alarm/STSecond*
+Alarm/STYear*
+Alarm/Suspended*
+Alarm/Title*
+*/NLProxyPort
+*/NLProxyServer
+QuickContacts/LastSentTo
+VersionInfo/UploadPassword
+VersionInfo/UploadUser
+
+[ExecuteServices]
+; Always calls passing 0 as wParam and lParam
+; Names with spaces or strange chars must be surrounded by "
+DB3XS/RemovePassword
+
+[RemoveFilesOrFolders]
+; This should be names inside miranda folder
+; Names with spaces or strange chars must be surrounded by "
+; * and ? can be used
+Avatars
+"Avatars History"
+Logs
+"Received Files"
+tabSRMM
+Updates
+UpdateData
+UpdateBackups
+yamn-accounts.pop3.*.book
+
+[DisablePlugins]
+; Plugins dlls to be disabled
+; Names with spaces or strange chars must be surrounded by "
+RemovePersonalSettings.dll
diff --git a/plugins/!NotAdopted/rps/ZIP/doit.bat b/plugins/!NotAdopted/rps/ZIP/doit.bat new file mode 100644 index 0000000000..47911225d3 --- /dev/null +++ b/plugins/!NotAdopted/rps/ZIP/doit.bat @@ -0,0 +1,58 @@ +@echo off
+
+rem Batch file to build and upload files
+rem
+rem TODO: Integration with FL
+
+set name=rps
+
+rem To upload, this var must be set here or in other batch
+rem set ftp=ftp://<user>:<password>@<ftp>/<path>
+
+echo Building %name% ...
+
+msdev ..\%name%.dsp /MAKE "%name% - Win32 Release" /REBUILD
+
+echo Generating files for %name% ...
+
+del *.zip
+del *.dll
+copy ..\Docs\%name%_changelog.txt
+copy ..\Docs\%name%_version.txt
+copy ..\Docs\%name%_readme.txt
+mkdir Docs
+cd Docs
+del /Q *.*
+copy ..\..\Docs\%name%_readme.txt
+cd ..
+mkdir Plugins
+cd Plugins
+del /Q *.*
+copy ..\..\..\..\bin\release\Plugins\RemovePersonalSettings.dll
+copy ..\..\RemovePersonalSettings.ini
+cd ..
+
+"C:\Program Files\Filzip\Filzip.exe" -a -rp %name%.zip Docs Plugins
+
+cd Docs
+del /Q *.*
+cd ..
+rmdir Docs
+cd Plugins
+del /Q *.*
+cd ..
+rmdir Plugins
+
+if "%ftp%"=="" GOTO END
+
+echo Going to upload files...
+pause
+
+"C:\Program Files\FileZilla\FileZilla.exe" -u .\%name%.zip %ftp% -overwrite -close
+"C:\Program Files\FileZilla\FileZilla.exe" -u .\%name%_changelog.txt %ftp% -overwrite -close
+"C:\Program Files\FileZilla\FileZilla.exe" -u .\%name%_version.txt %ftp% -overwrite -close
+"C:\Program Files\FileZilla\FileZilla.exe" -u .\%name%_readme.txt %ftp% -overwrite -close
+
+:END
+
+echo Done.
diff --git a/plugins/!NotAdopted/rps/rps.c b/plugins/!NotAdopted/rps/rps.c new file mode 100644 index 0000000000..d358f12ae0 --- /dev/null +++ b/plugins/!NotAdopted/rps/rps.c @@ -0,0 +1,833 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2005 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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.
+
+Created by Pescuma
+Based on work by nullbie
+
+*/
+#include <windows.h>
+#include <io.h>
+#include <stdio.h>
+#include <newpluginapi.h>
+#include <m_clist.h>
+#include <m_skin.h>
+#include <m_langpack.h>
+#include <m_protocols.h>
+#include <m_protosvc.h>
+#include <m_utils.h>
+#include <m_database.h>
+
+#define MIID_REMOVEPERSONALSETTINGS { 0x5eaec989, 0x8ff, 0x4820, { 0xb8, 0x6c, 0x2b, 0x6e, 0xf0, 0x8e, 0x33, 0x73 } }
+
+#define INI_FILE_NAME "RemovePersonalSettings.ini"
+
+#define PLUGINDISABLELIST "PluginDisable"
+
+#define METACONTACTS_PROTOCOL_NAME "MetaContacts"
+
+
+HINSTANCE hInst;
+PLUGINLINK *pluginLink;
+char gIniFile[MAX_PATH];
+char gMirandaDir[MAX_PATH];
+
+
+PLUGININFOEX pluginInfo={
+ sizeof(PLUGININFO),
+ "Remove Personal Settings",
+ PLUGIN_MAKE_VERSION(0,1,0,4),
+ "Remove personal settings to allow to send a profile to other user(s) without sending personal data.",
+ "Ricardo Pescuma Domenecci",
+ "",
+ "© 2007-2009 Ricardo Pescuma Domenecci",
+ "http://pescuma.org/miranda/rps",
+ 0, //not transient
+ 0, //doesn't replace anything built-in
+ { 0x60e94b84, 0xa799, 0x4021, { 0x94, 0x49, 0x5b, 0x83, 0x8f, 0xc0, 0x6a, 0x7c } } // {60E94B84-A799-4021-9449-5B838FC06A7C}
+};
+
+
+int RemoveAllService(WPARAM wParam,LPARAM lParam);
+void SetProtocolsOffline();
+void RemoveUsers();
+void RemoveSettings();
+void ExecuteServices();
+void RemoveDirectories();
+void DisablePlugins();
+
+// Ini access functions
+BOOL GetSettingBool(const char *section, const char *key, BOOL defaultValue);
+BOOL GetSettings(const char *section, char *buffer, size_t bufferSize);
+
+
+// Utils
+void DeleteFileOrFolder(const char *name);
+void DeleteSetting(const char *setting);
+void DeleteSettingEx(const char *szModule, const char *szSetting);
+BOOL isMetaContact(HANDLE hContact);
+
+
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+{
+ hInst=hinstDLL;
+ return TRUE;
+}
+
+
+__declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion)
+{
+ // Are we running under Unicode Windows version ?
+ if ((GetVersion() & 0x80000000) == 0)
+ pluginInfo.flags = 1; // UNICODE_AWARE
+
+ pluginInfo.cbSize = sizeof(PLUGININFO);
+ return (PLUGININFO*) &pluginInfo;
+}
+
+
+__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+{
+ // Are we running under Unicode Windows version ?
+ if ((GetVersion() & 0x80000000) == 0)
+ pluginInfo.flags = 1; // UNICODE_AWARE
+
+ pluginInfo.cbSize = sizeof(PLUGININFOEX);
+ return &pluginInfo;
+}
+
+
+static const MUUID interfaces[] = { MIID_REMOVEPERSONALSETTINGS, MIID_LAST };
+__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
+{
+ return interfaces;
+}
+
+
+int __declspec(dllexport) Load(PLUGINLINK *link)
+{
+ CLISTMENUITEM mi;
+ char *strTmp;
+
+ pluginLink=link;
+ CreateServiceFunction("RemovePersonalSettings/RemoveAll",RemoveAllService);
+ ZeroMemory(&mi,sizeof(mi));
+ mi.cbSize=sizeof(mi);
+ mi.position=-0x7FFFFFFF;
+ mi.flags=0;
+ mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ mi.pszName="Remove Personal Settings...";
+ mi.pszService="RemovePersonalSettings/RemoveAll";
+ CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+
+ // Get ini file name
+ gMirandaDir[0] = '\0';
+ GetModuleFileName(GetModuleHandle(NULL),gMirandaDir,sizeof(gMirandaDir));
+
+ // Remove last name
+ strTmp = strrchr(gMirandaDir,'\\');
+ if(strTmp != NULL)
+ *strTmp = '\0';
+
+ // Set vars
+ strcat(gMirandaDir, "\\");
+ strcpy(gIniFile, gMirandaDir);
+
+ // Store last pos
+ strTmp = &gIniFile[strlen(gIniFile)];
+
+ // Lets try fist name
+ strcpy(strTmp, INI_FILE_NAME);
+
+ if (_access(gIniFile, 4) != 0)
+ {
+ // Not found, lets try the other aproach
+ strcpy(strTmp, "plugins\\" INI_FILE_NAME);
+
+ if (_access(gIniFile, 4) != 0)
+ {
+ // Not found :(
+ gIniFile[0] = '\0';
+ }
+ }
+
+ return 0;
+}
+
+
+int __declspec(dllexport) Unload(void)
+{
+ return 0;
+}
+
+
+int RemoveAllService(WPARAM wParam,LPARAM lParam)
+{
+ if (gIniFile[0] == '\0')
+ {
+ MessageBox(NULL, Translate("Configuration file could not be found!"), Translate("Remove Personal Settings"), MB_OK | MB_ICONERROR);
+ return -1;
+ }
+
+ if (MessageBox(NULL,Translate("All your personal settings will be erased!\n"
+ "Make sure you are running this from a copy of your profile (and not over the original one).\n"
+ "Running this will erase files/folders under Miranda main folder.\n"
+ "\n"
+ "Are you sure you want to remove all your personal settings?\n"
+ "\n"
+ "(You cannot say that I don't told you about the risks :P )"), Translate("Remove Personal Settings"),MB_YESNO)
+ == IDYES)
+ {
+ SetProtocolsOffline();
+ RemoveUsers();
+ RemoveSettings();
+ ExecuteServices();
+ RemoveDirectories();
+ DisablePlugins();
+
+ MessageBox(NULL,Translate("Settings are deleted now."), Translate("Remove Personal Settings"),MB_OK | MB_ICONINFORMATION);
+ }
+
+ return 0;
+}
+
+void SetProtocolsOffline()
+{
+ if ( GetSettingBool("GlobalSettings", "SetProtocolsOffline", TRUE) )
+ {
+ PROTOCOLDESCRIPTOR **protos;
+ int i,count;
+
+ CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&count, (LPARAM)&protos);
+
+ for (i = 0; i < count; i++)
+ {
+ if (protos[i]->type != PROTOTYPE_PROTOCOL)
+ continue;
+
+ if (protos[i]->szName == NULL || protos[i]->szName[0] == '\0')
+ continue;
+
+ CallProtoService(protos[i]->szName, PS_SETSTATUS, ID_STATUS_OFFLINE, 0);
+ }
+
+ // Give some time to make it really offline
+ Sleep(2000);
+ }
+}
+
+void RemoveUsers()
+{
+ if ( GetSettingBool("GlobalSettings", "RemoveAllUsers", TRUE) )
+ {
+ HANDLE hContact;
+ HANDLE hDbEvent;
+ HANDLE hContactOld;
+
+ // To be faster, remove first all metacontacts (because it syncs histories)
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ while(hContact != NULL)
+ {
+ hContactOld = hContact;
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+
+ if ( isMetaContact(hContactOld) )
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContactOld, 0);
+ }
+
+ // Now delete all left-overs
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+
+ while(hContact != NULL)
+ {
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0);
+
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ }
+
+ // Delete events for contacts not in list
+ hDbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDFIRST, 0, 0);
+
+ while(hDbEvent != NULL)
+ {
+ int ret = CallService(MS_DB_EVENT_DELETE, 0, (WPARAM) hDbEvent);
+
+ hDbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDFIRST, 0, 0);
+ }
+
+ // Now delete groups
+ DeleteSettingEx("CListGroups", NULL);
+ }
+}
+
+void RemoveProtocolSettings(const char * protocolName)
+{
+ char buffer[10000];
+
+ // Remove protocol module settings
+ if ( GetSettingBool("GlobalSettings", "RemoveWholeProtocolModule", FALSE) )
+ {
+ DeleteSettingEx(protocolName, NULL);
+ }
+ else if ( GetSettings("ProtocolSettings", buffer, sizeof(buffer)) )
+ {
+ char *name;
+ char *value;
+
+ name = buffer;
+ while(name[0] != '\0')
+ {
+ value = strchr(name, '=');
+ if (value == NULL)
+ value = &name[strlen(name)];
+
+ // Has " ?
+ if (*name == '"' && *(value-1) == '"')
+ {
+ name++;
+ *(value-1) = '\0';
+ }
+
+ // Disable it
+ if (name[0] != '\0')
+ DeleteSettingEx(protocolName, name);
+
+ // Get next one
+ name = value + strlen(value) + 1;
+ }
+ }
+
+ // Remove modules by protocol sufixes
+ if ( GetSettings("ProtocolModuleSufixes", buffer, sizeof(buffer)) )
+ {
+ char *name;
+ char *value;
+ char moduleName[256];
+
+ name = buffer;
+ while(name[0] != '\0')
+ {
+ value = strchr(name, '=');
+ if (value == NULL)
+ value = &name[strlen(name)];
+
+ // Has " ?
+ if (*name == '"' && *(value-1) == '"')
+ {
+ name++;
+ *(value-1) = '\0';
+ }
+
+ // Delete it
+ if (name[0] != '\0')
+ {
+ mir_snprintf(moduleName, sizeof(moduleName), "%s%s", protocolName, name);
+ DeleteSettingEx(moduleName, NULL);
+ }
+
+ // Get next one
+ name = value + strlen(value) + 1;
+ }
+ }
+}
+
+void RemoveSettings()
+{
+ char buffer[10000];
+
+ // Delete protocol settings
+ if ( GetSettingBool("GlobalSettings", "RemoveProtocolSettings", TRUE) )
+ {
+ PROTOCOLDESCRIPTOR **protos;
+ int i,count;
+
+ // TODO MS_PROTO_ENUMACCOUNTS
+ CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&count, (LPARAM)&protos);
+
+ for (i = 0; i < count; i++)
+ {
+ if (protos[i]->type != PROTOTYPE_PROTOCOL)
+ continue;
+
+ if (protos[i]->szName == NULL || protos[i]->szName[0] == '\0')
+ continue;
+
+ RemoveProtocolSettings(protos[i]->szName);
+ }
+
+ // Get disabled protocols
+ if ( GetSettings("DisabledProtocols", buffer, sizeof(buffer)) )
+ {
+ char *name;
+ char *value;
+
+ name = buffer;
+ while(name[0] != '\0')
+ {
+ value = strchr(name, '=');
+ if (value == NULL)
+ value = &name[strlen(name)];
+
+ // Has " ?
+ if (*name == '"' && *(value-1) == '"')
+ {
+ name++;
+ *(value-1) = '\0';
+ }
+
+ // Disable it
+ if (name[0] != '\0')
+ RemoveProtocolSettings(name);
+
+ // Get next one
+ name = value + strlen(value) + 1;
+ }
+ }
+ }
+
+
+ // Delete other settings
+ if ( GetSettings("RemoveSettings", buffer, sizeof(buffer)) )
+ {
+ char *name;
+ char *value;
+
+ name = buffer;
+ while(name[0] != '\0')
+ {
+ value = strchr(name, '=');
+ if (value == NULL)
+ value = &name[strlen(name)];
+
+ // Has " ?
+ if (*name == '"' && *(value-1) == '"')
+ {
+ name++;
+ *(value-1) = '\0';
+ }
+
+ // Delete it
+ if (name[0] != '\0')
+ DeleteSetting(name);
+
+ // Get next one
+ name = value + strlen(value) + 1;
+ }
+ }
+}
+
+void ExecuteServices()
+{
+ char buffer[10000];
+
+ if ( GetSettings("ExecuteServices", buffer, sizeof(buffer)) )
+ {
+ char *name;
+ char *value;
+
+ name = buffer;
+ while(name[0] != '\0')
+ {
+ value = strchr(name, '=');
+ if (value == NULL)
+ value = &name[strlen(name)];
+
+ // Has " ?
+ if (*name == '"' && *(value-1) == '"')
+ {
+ name++;
+ *(value-1) = '\0';
+ }
+
+ // Disable it
+ if (name[0] != '\0')
+ if (ServiceExists(name))
+ CallService(name,0,0);
+
+ // Get next one
+ name = value + strlen(value) + 1;
+ }
+ }
+}
+
+void RemoveDirectories()
+{
+ char buffer[10000];
+ char dir[MAX_PATH];
+
+ // Remove protocol folders
+ if (GetSettingBool("GlobalSettings", "RemoveProtocolFolders", TRUE))
+ {
+ PROTOCOLDESCRIPTOR **protos;
+ int i,count;
+
+ CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&count, (LPARAM)&protos);
+
+ for (i = 0; i < count; i++)
+ {
+ if (protos[i]->type != PROTOTYPE_PROTOCOL)
+ continue;
+
+ if (protos[i]->szName == NULL || protos[i]->szName[0] == '\0')
+ continue;
+
+ mir_snprintf(dir, sizeof(dir), "%s%s", gMirandaDir, protos[i]->szName);
+ DeleteFileOrFolder(dir);
+ }
+ }
+
+ // Remove other folders
+ if ( GetSettings("RemoveFilesOrFolders", buffer, sizeof(buffer)) )
+ {
+ char *name;
+ char *value;
+
+ name = buffer;
+ while(name[0] != '\0')
+ {
+ value = strchr(name, '=');
+ if (value == NULL)
+ value = &name[strlen(name)];
+
+ // Has " ?
+ if (*name == '"' && *(value-1) == '"')
+ {
+ name++;
+ *(value-1) = '\0';
+ }
+
+ // Delete it
+ if (name[0] != '\0')
+ {
+ mir_snprintf(dir, sizeof(dir), "%s%s", gMirandaDir, name);
+ DeleteFileOrFolder(dir);
+ }
+
+ // Get next one
+ name = value + strlen(value) + 1;
+ }
+ }
+}
+
+void DisablePlugins()
+{
+ char buffer[10000];
+
+ if ( GetSettings("DisablePlugins", buffer, sizeof(buffer)) )
+ {
+ char *name;
+ char *value;
+
+ name = buffer;
+ while(name[0] != '\0')
+ {
+ value = strchr(name, '=');
+ if (value == NULL)
+ value = &name[strlen(name)];
+
+ // Has " ?
+ if (*name == '"' && *(value-1) == '"')
+ {
+ name++;
+ *(value-1) = '\0';
+ }
+
+ // Disable it
+ if (name[0] != '\0')
+ {
+ CharLower(name);
+ if (DBGetContactSettingByte(NULL, PLUGINDISABLELIST, name, 0) != 1)
+ {
+ DBWriteContactSettingByte(NULL, PLUGINDISABLELIST, name, 1);
+ }
+ }
+
+ // Get next one
+ name = value + strlen(value) + 1;
+ }
+ }
+}
+
+
+
+// Ini access functions
+
+BOOL GetSettingBool(const char *section, const char *key, BOOL defaultValue)
+{
+ char tmp[16];
+
+ if ( GetPrivateProfileString(section, key, defaultValue ? "true" : "false", tmp, sizeof(tmp), gIniFile) == 0 )
+ {
+ return defaultValue;
+ }
+ else
+ {
+ return stricmp(tmp, "true") == 0;
+ }
+}
+
+
+BOOL GetSettings(const char *section, char *buffer, size_t bufferSize)
+{
+ buffer[0] = '\0\0';
+
+ return GetPrivateProfileSection(section, buffer, bufferSize, gIniFile) != 0;
+}
+
+
+
+// Utils
+
+void DeleteFileOrFolder(const char *name)
+{
+ int attibs = GetFileAttributes(name);
+
+ if (attibs == 0xFFFFFFFF) // Not exists
+ {
+ // Try to find it
+ WIN32_FIND_DATA findData;
+ HANDLE hwnd;
+ char tmp[MAX_PATH];
+ char *strTmp;
+
+ // Delete files
+ hwnd = FindFirstFile(name, &findData);
+ if (hwnd != INVALID_HANDLE_VALUE)
+ {
+ strcpy(tmp, name);
+ strTmp = strrchr(tmp,'\\');
+ if(strTmp != NULL)
+ {
+ strTmp++;
+ *strTmp = '\0';
+ }
+ else
+ {
+ strcat(tmp, "\\");
+ strTmp = &tmp[strlen(tmp)];
+ }
+
+ do
+ {
+ if (strcmp(findData.cFileName, ".") && strcmp(findData.cFileName, ".."))
+ {
+ strcpy(strTmp, findData.cFileName);
+ DeleteFileOrFolder(tmp);
+ }
+ }
+ while(FindNextFile(hwnd, &findData) != 0);
+
+ FindClose(hwnd);
+ }
+ }
+ else if (attibs & FILE_ATTRIBUTE_DIRECTORY) // Is a directory
+ {
+ // Get all files and delete then
+ WIN32_FIND_DATA findData;
+ HANDLE hwnd;
+ char tmp[MAX_PATH];
+
+ mir_snprintf(tmp, sizeof(tmp), "%s\\*.*", name);
+
+ // Delete files
+ hwnd = FindFirstFile(tmp, &findData);
+ if (hwnd != INVALID_HANDLE_VALUE)
+ {
+ do
+ {
+ if (strcmp(findData.cFileName, ".") && strcmp(findData.cFileName, ".."))
+ {
+ mir_snprintf(tmp, sizeof(tmp), "%s\\%s", name, findData.cFileName);
+ DeleteFileOrFolder(tmp);
+ }
+ }
+ while(FindNextFile(hwnd, &findData) != 0);
+
+ FindClose(hwnd);
+ }
+
+ // Delete directory
+ RemoveDirectory(name);
+ }
+ else // Is a File
+ {
+ SetFileAttributes(name, FILE_ATTRIBUTE_ARCHIVE);
+ DeleteFile(name);
+ }
+}
+
+
+BOOL isMetaContact(HANDLE hContact)
+{
+ DBVARIANT dbv;
+ DBCONTACTGETSETTING dbcgs;
+ char name[32];
+
+ dbv.type=DBVT_ASCIIZ;
+ dbv.pszVal=name;
+ dbv.cchVal=sizeof(name);
+ dbcgs.pValue=&dbv;
+ dbcgs.szModule="Protocol";
+ dbcgs.szSetting="p";
+
+ if(CallService(MS_DB_CONTACT_GETSETTINGSTATIC,(WPARAM)hContact,(LPARAM)&dbcgs))
+ return FALSE;
+
+ return strcmp(dbcgs.pValue->pszVal, METACONTACTS_PROTOCOL_NAME) == 0;
+}
+
+
+
+typedef struct {
+ char buffer[10000];
+ int pos;
+ const char *filter;
+ size_t lenFilterMinusOne;
+} DeleteModuleStruct;
+
+
+int EnumProc(const char *szName, LPARAM lParam)
+{
+ DeleteModuleStruct *dms = (DeleteModuleStruct *) lParam;
+ size_t len = strlen(szName);
+
+ if (dms->filter != NULL && dms->lenFilterMinusOne > 0)
+ {
+ if (len >= dms->lenFilterMinusOne)
+ {
+ if (dms->filter[0] == '*')
+ {
+ if (strcmp(&dms->filter[1], &szName[len - dms->lenFilterMinusOne]) != 0)
+ return 0;
+ }
+ else // if (dms->filter[dms->lenFilterMinusOne] == '*')
+ {
+ if (strncmp(dms->filter, szName, dms->lenFilterMinusOne) != 0)
+ return 0;
+ }
+ }
+ }
+
+ // Add to the struct
+ if (len > 0 && len < sizeof(dms->buffer) - dms->pos - 2)
+ {
+ strcpy(&dms->buffer[dms->pos], szName);
+ dms->pos += len + 1;
+ }
+
+ return 0;
+}
+
+int ModuleEnumProc(const char *szName, DWORD ofsModuleName, LPARAM lParam)
+{
+ return EnumProc(szName, lParam);
+}
+
+void DeleteSettingEx(const char *szModule, const char *szSetting)
+{
+ size_t lenModule;
+
+ if (szModule == NULL)
+ return;
+
+ lenModule = strlen(szModule);
+ if (szModule[0] == '*' || szModule[lenModule-1] == '*')
+ {
+ DeleteModuleStruct dms;
+ ZeroMemory(&dms, sizeof(dms));
+
+ dms.filter = szModule;
+ dms.lenFilterMinusOne = lenModule-1;
+
+ CallService(MS_DB_MODULES_ENUM, (WPARAM) &dms, (LPARAM) &ModuleEnumProc);
+
+ // Delete then
+ szModule = dms.buffer;
+ while(szModule[0] != '\0')
+ {
+ DeleteSettingEx(szModule, szSetting);
+
+ // Get next one
+ szModule += strlen(szModule) + 1;
+ }
+ }
+ else
+ {
+ size_t lenSetting = szSetting == NULL ? 0 : strlen(szSetting);
+ if (szSetting == NULL || szSetting[0] == '*' || szSetting[lenSetting-1] == '*')
+ {
+ DeleteModuleStruct dms;
+ DBCONTACTENUMSETTINGS dbces;
+
+ ZeroMemory(&dms, sizeof(dms));
+
+ dms.filter = szSetting;
+ dms.lenFilterMinusOne = lenSetting-1;
+
+ dbces.pfnEnumProc = EnumProc;
+ dbces.lParam = (LPARAM) &dms;
+ dbces.szModule = szModule;
+ dbces.ofsSettings = 0;
+
+ CallService(MS_DB_CONTACT_ENUMSETTINGS, 0, (LPARAM) &dbces);
+
+ // Delete then
+ szSetting = dms.buffer;
+ while(szSetting[0] != '\0')
+ {
+ DBDeleteContactSetting(NULL, szModule, szSetting);
+
+ // Get next one
+ szSetting += strlen(szSetting) + 1;
+ }
+ }
+ else
+ {
+ DBDeleteContactSetting(NULL, szModule, szSetting);
+ }
+ }
+}
+
+void DeleteSetting(const char *setting)
+{
+ char *szModule;
+ char *szSetting;
+
+ if (setting == NULL || setting[0] == '\0')
+ {
+ return;
+ }
+
+ // Split setting
+ szModule = strdup(setting);
+ szSetting = strrchr(szModule, '/');
+ if (szSetting != NULL)
+ {
+ *szSetting = '\0';
+ szSetting ++;
+ }
+
+ DeleteSettingEx(szModule, szSetting);
+
+ free(szModule);
+}
+
diff --git a/plugins/!NotAdopted/rps/rps.dsp b/plugins/!NotAdopted/rps/rps.dsp new file mode 100644 index 0000000000..d529f541bc --- /dev/null +++ b/plugins/!NotAdopted/rps/rps.dsp @@ -0,0 +1,127 @@ +# Microsoft Developer Studio Project File - Name="rps" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=rps - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "rps.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "rps.mak" CFG="rps - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "rps - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "rps - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "rps"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "rps - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RPS_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RPS_EXPORTS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../../bin/release/plugins/RemovePersonalSettings.dll"
+
+!ELSEIF "$(CFG)" == "rps - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RPS_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RPS_EXPORTS" /FR /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"../../bin/debug/plugins/RemovePersonalSettings.dll" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "rps - Win32 Release"
+# Name "rps - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\rps.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# Begin Group "Docs"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\RemovePersonalSettings.ini
+# End Source File
+# Begin Source File
+
+SOURCE=.\Docs\rps_changelog.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\Docs\rps_readme.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\Docs\rps_version.txt
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/plugins/!NotAdopted/rps/rps.dsw b/plugins/!NotAdopted/rps/rps.dsw new file mode 100644 index 0000000000..67773bd23d --- /dev/null +++ b/plugins/!NotAdopted/rps/rps.dsw @@ -0,0 +1,33 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "rps"=".\rps.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+ begin source code control
+ rps
+ .
+ end source code control
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/plugins/!NotAdopted/statuschange/StatusChange.dsp b/plugins/!NotAdopted/statuschange/StatusChange.dsp new file mode 100644 index 0000000000..012151331c --- /dev/null +++ b/plugins/!NotAdopted/statuschange/StatusChange.dsp @@ -0,0 +1,131 @@ +# Microsoft Developer Studio Project File - Name="StatusChange" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=StatusChange - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "StatusChange.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "StatusChange.mak" CFG="StatusChange - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "StatusChange - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "StatusChange - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "StatusChange - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STATUSCHANGE_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /G5 /MD /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STATUSCHANGE_EXPORTS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 Libctiny.lib kernel32.lib user32.lib /nologo /base:"0x11050000" /dll /pdb:none /machine:I386
+# SUBTRACT LINK32 /nodefaultlib
+
+!ELSEIF "$(CFG)" == "StatusChange - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STATUSCHANGE_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STATUSCHANGE_EXPORTS" /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "StatusChange - Win32 Release"
+# Name "StatusChange - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\main.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\buffer.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\resource.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=..\..\miranda32\icos\message.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\resource.rc
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\readme_statuschange.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\translation_statuschange.txt
+# End Source File
+# End Target
+# End Project
diff --git a/plugins/!NotAdopted/statuschange/main.c b/plugins/!NotAdopted/statuschange/main.c new file mode 100644 index 0000000000..3793f68228 --- /dev/null +++ b/plugins/!NotAdopted/statuschange/main.c @@ -0,0 +1,402 @@ +#include <windows.h>
+#include <commctrl.h>
+#include "../../miranda32/random/plugins/newpluginapi.h"
+#include "../../miranda32/database/m_database.h"
+#include "../../miranda32/ui/contactlist/m_clist.h"
+#include "../../miranda32/ui/options/m_options.h"
+#include "../../miranda32/random/skin/m_skin.h"
+#include "../../miranda32/random/langpack/m_langpack.h"
+#include "../../miranda32/core/m_system.h"
+#include "../../miranda32/protocols/protocols/m_protosvc.h"
+#include "resource.h"
+#include "resrc1.h"
+
+#define PLUGINNAME "StatusChange"
+
+typedef struct
+{
+ BOOL MessageRead;
+ BOOL MessageSend;
+ BOOL UrlRead;
+ BOOL UrlSend;
+ BOOL FileRead;
+ BOOL FileSend;
+
+ int ChangeTo; // ID_STATUS_XXX
+
+ BOOL IfOffline;
+ BOOL IfOnline;
+ BOOL IfAway;
+ BOOL IfNA;
+ BOOL IfOccupied;
+ BOOL IfDND;
+ BOOL IfFreeforchat;
+ BOOL IfInvisible;
+ BOOL IfOnthephone;
+ BOOL IfOuttolunch;
+} TOPTIONS;
+
+HINSTANCE hInst;
+PLUGINLINK *pluginLink;
+HANDLE hNewMessage;
+HANDLE hOptInit;
+TOPTIONS Options;
+HICON hIconMsg;
+HICON hIconUrl;
+HICON hIconFile;
+static int StatusChangeGetMessage(WPARAM,LPARAM);
+static BOOL CALLBACK DlgProcStatusChangeOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
+PLUGININFO pluginInfo={
+ sizeof(PLUGININFO),
+ PLUGINNAME,
+ PLUGIN_MAKE_VERSION(1,3,0,0),
+ "Change status when you send/receive and event.",
+ "Angelo Luiz Tartari",
+ "corsario-br@users.sourceforge.net",
+ "© 2002 Angelo Luiz Tartari",
+ "http://miranda-icq.sourceforge.net/",
+ 0,
+ 0
+};
+
+void LoadOptions()
+{
+ ZeroMemory(&Options, sizeof(Options));
+ Options.MessageRead = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "MessageRead", FALSE);
+ Options.MessageSend = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "MessageSend", TRUE);
+ Options.UrlRead = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "UrlRead", FALSE);
+ Options.UrlSend = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "UrlSend", TRUE);
+ Options.FileRead = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "FileRead", FALSE);
+ Options.FileSend = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "FileSend", TRUE);
+ Options.ChangeTo = (INT)DBGetContactSettingDword(NULL, PLUGINNAME, "ChangeTo", ID_STATUS_ONLINE);
+ Options.IfOffline = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "IfOffline", FALSE);
+ Options.IfOnline = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "IfOnline", FALSE);
+ Options.IfAway = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "IfAway", TRUE);
+ Options.IfNA = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "IfNA", TRUE);
+ Options.IfOccupied = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "IfOccupied", FALSE);
+ Options.IfDND = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "IfDND", FALSE);
+ Options.IfFreeforchat = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "IfFreeforchat", FALSE);
+ Options.IfInvisible = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "IfInvisible", FALSE);
+ Options.IfOnthephone = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "IfOnthephone", FALSE);
+ Options.IfOuttolunch = (BOOL)DBGetContactSettingByte(NULL, PLUGINNAME, "IfOuttolunch", FALSE);
+}
+
+static int StatusChangeGetMessage(WPARAM wParam,LPARAM lParam)
+{
+ HANDLE hDbEvent = (HANDLE)lParam;
+ DBEVENTINFO dbe;
+ int status;
+ BOOL read, send, change_status;
+
+ dbe.cbSize = sizeof(dbe);
+ dbe.cbBlob = 0;
+ CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbe);
+
+ status = (int)CallProtoService(dbe.szModule, PS_GETSTATUS, 0, 0);
+ if(!status)
+ status = CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
+
+ if(status == Options.ChangeTo)
+ return 0;
+
+ switch (status) {
+ case ID_STATUS_OFFLINE : change_status = Options.IfOffline; break;
+ case ID_STATUS_ONLINE : change_status = Options.IfOnline; break;
+ case ID_STATUS_AWAY : change_status = Options.IfAway; break;
+ case ID_STATUS_NA : change_status = Options.IfNA; break;
+ case ID_STATUS_OCCUPIED : change_status = Options.IfOccupied; break;
+ case ID_STATUS_DND : change_status = Options.IfDND; break;
+ case ID_STATUS_FREECHAT : change_status = Options.IfFreeforchat; break;
+ case ID_STATUS_INVISIBLE : change_status = Options.IfInvisible; break;
+ case ID_STATUS_ONTHEPHONE : change_status = Options.IfOnthephone; break;
+ case ID_STATUS_OUTTOLUNCH : change_status = Options.IfOuttolunch; break;
+ default : change_status = FALSE; break;
+ }
+
+ if (!change_status)
+ return 0;
+
+ switch (dbe.eventType) {
+ case EVENTTYPE_MESSAGE :
+ read = Options.MessageRead;
+ send = Options.MessageSend;
+ break;
+ case EVENTTYPE_URL :
+ read = Options.UrlRead;
+ send = Options.UrlSend;
+ break;
+ case EVENTTYPE_FILE :
+ read = Options.FileRead;
+ send = Options.FileSend;
+ break;
+ break;
+ }
+
+ // If is a message sent...
+ if (((DWORD)(dbe.flags & ((DWORD)DBEF_SENT))) == ((DWORD)(DBEF_SENT))) {
+ if (send) {
+ // change status
+ CallProtoService(dbe.szModule, PS_SETSTATUS, (LPARAM)(Options.ChangeTo), 0);
+ }
+ }
+
+ // If is a message received...
+ else {
+ if (read) {
+ // change status
+ CallProtoService(dbe.szModule, PS_SETSTATUS, (LPARAM)(Options.ChangeTo), 0);
+ }
+ }
+
+ return 0;
+}
+
+int StatusChangeOptInit(WPARAM wParam,LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp;
+ ZeroMemory(&odp,sizeof(odp));
+ odp.cbSize = sizeof(odp);
+ odp.hInstance = hInst;
+ odp.pszTemplate = MAKEINTRESOURCE(IDD_OPTIONS);
+ odp.pszTitle = Translate(PLUGINNAME);
+ odp.pszGroup = Translate("Plugins");
+ odp.flags = ODPF_BOLDGROUPS;
+ odp.pfnDlgProc = DlgProcStatusChangeOpts;
+ CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
+ return 0;
+}
+
+static BOOL CALLBACK DlgProcStatusChangeOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+
+ hIconMsg = CopyImage(LoadSkinnedIcon(SKINICON_EVENT_MESSAGE), IMAGE_ICON, 16, 16, LR_COPYFROMRESOURCE);
+ SendDlgItemMessage(hwndDlg, IDC_MSGICON, STM_SETICON, (WPARAM)hIconMsg, 0);
+ hIconUrl = CopyImage(LoadSkinnedIcon(SKINICON_EVENT_URL), IMAGE_ICON, 16, 16, LR_COPYFROMRESOURCE);
+ SendDlgItemMessage(hwndDlg, IDC_URLICON, STM_SETICON, (WPARAM)hIconUrl, 0);
+ hIconFile = CopyImage(LoadSkinnedIcon(SKINICON_EVENT_FILE), IMAGE_ICON, 16, 16, LR_COPYFROMRESOURCE);
+ SendDlgItemMessage(hwndDlg, IDC_FILEICON, STM_SETICON, (WPARAM)hIconFile, 0);
+
+ CheckDlgButton(hwndDlg, IDC_CHK_MESSAGEREAD, Options.MessageRead?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHK_MESSAGESEND, Options.MessageSend?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHK_URLREAD, Options.UrlRead?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHK_URLSEND, Options.UrlSend?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHK_FILEREAD, Options.FileRead?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHK_FILESEND, Options.FileSend?BST_CHECKED:BST_UNCHECKED);
+
+ switch(Options.ChangeTo) {
+ case ID_STATUS_OFFLINE : CheckDlgButton(hwndDlg, IDC_RAD_OFFLINE, BST_CHECKED); break;
+ case ID_STATUS_ONLINE : CheckDlgButton(hwndDlg, IDC_RAD_ONLINE, BST_CHECKED); break;
+ case ID_STATUS_AWAY : CheckDlgButton(hwndDlg, IDC_RAD_AWAY, BST_CHECKED); break;
+ case ID_STATUS_DND : CheckDlgButton(hwndDlg, IDC_RAD_DND, BST_CHECKED); break;
+ case ID_STATUS_NA : CheckDlgButton(hwndDlg, IDC_RAD_NA, BST_CHECKED); break;
+ case ID_STATUS_OCCUPIED : CheckDlgButton(hwndDlg, IDC_RAD_OCCUPIED, BST_CHECKED); break;
+ case ID_STATUS_FREECHAT : CheckDlgButton(hwndDlg, IDC_RAD_FREECHAT, BST_CHECKED); break;
+ case ID_STATUS_INVISIBLE : CheckDlgButton(hwndDlg, IDC_RAD_INVISIBLE, BST_CHECKED); break;
+ case ID_STATUS_ONTHEPHONE : CheckDlgButton(hwndDlg, IDC_RAD_ONTHEPHONE, BST_CHECKED); break;
+ case ID_STATUS_OUTTOLUNCH : CheckDlgButton(hwndDlg, IDC_RAD_OUTTOLUNCH, BST_CHECKED); break;
+ break;
+ }
+
+ CheckDlgButton(hwndDlg, IDC_CHK_OFFLINE, Options.IfOffline?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHK_ONLINE, Options.IfOnline?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHK_AWAY, Options.IfAway?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHK_DND, Options.IfDND?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHK_NA, Options.IfNA?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHK_OCCUPIED, Options.IfOccupied?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHK_FREECHAT, Options.IfFreeforchat?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHK_INVISIBLE, Options.IfInvisible?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHK_ONTHEPHONE, Options.IfOnthephone?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHK_OUTTOLUNCH, Options.IfOuttolunch?BST_CHECKED:BST_UNCHECKED);
+ return TRUE;
+
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+ case IDC_CHK_MESSAGEREAD:
+ Options.MessageRead = !Options.MessageRead;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_CHK_MESSAGESEND:
+ Options.MessageSend = !Options.MessageSend;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_CHK_URLREAD:
+ Options.UrlRead = !Options.UrlRead;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_CHK_URLSEND:
+ Options.UrlSend = !Options.UrlSend;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_CHK_FILEREAD:
+ Options.FileRead = !Options.FileRead;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_CHK_FILESEND:
+ Options.FileSend = !Options.FileSend;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+
+ case IDC_RAD_OFFLINE:
+ Options.ChangeTo = ID_STATUS_OFFLINE;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_RAD_ONLINE:
+ Options.ChangeTo = ID_STATUS_ONLINE;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_RAD_AWAY:
+ Options.ChangeTo = ID_STATUS_AWAY;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_RAD_DND:
+ Options.ChangeTo = ID_STATUS_DND;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_RAD_NA:
+ Options.ChangeTo = ID_STATUS_NA;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_RAD_OCCUPIED:
+ Options.ChangeTo = ID_STATUS_OCCUPIED;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_RAD_FREECHAT:
+ Options.ChangeTo = ID_STATUS_FREECHAT;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_RAD_INVISIBLE:
+ Options.ChangeTo = ID_STATUS_INVISIBLE;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_RAD_ONTHEPHONE:
+ Options.ChangeTo = ID_STATUS_ONTHEPHONE;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_RAD_OUTTOLUNCH:
+ Options.ChangeTo = ID_STATUS_OUTTOLUNCH;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+
+ case IDC_CHK_OFFLINE:
+ Options.IfOffline = !Options.IfOffline;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_CHK_ONLINE:
+ Options.IfOnline = !Options.IfOnline;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_CHK_AWAY:
+ Options.IfAway = !Options.IfAway;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_CHK_DND:
+ Options.IfDND = !Options.IfDND;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_CHK_NA:
+ Options.IfNA = !Options.IfNA;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_CHK_OCCUPIED:
+ Options.IfOccupied = !Options.IfOccupied;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_CHK_FREECHAT:
+ Options.IfFreeforchat = !Options.IfFreeforchat;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_CHK_INVISIBLE:
+ Options.IfInvisible = !Options.IfInvisible;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_CHK_ONTHEPHONE:
+ Options.IfOnthephone = !Options.IfOnthephone;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_CHK_OUTTOLUNCH:
+ Options.IfOuttolunch = !Options.IfOuttolunch;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ }
+ break;
+
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_RESET:
+ LoadOptions();
+ return TRUE;
+ case PSN_APPLY:
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "MessageRead", (BYTE)Options.MessageRead);
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "MessageSend", (BYTE)Options.MessageSend);
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "UrlRead", (BYTE)Options.UrlRead);
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "UrlSend", (BYTE)Options.UrlSend);
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "FileRead", (BYTE)Options.FileRead);
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "FileSend", (BYTE)Options.FileSend);
+ DBWriteContactSettingDword(NULL, PLUGINNAME, "ChangeTo", (DWORD)Options.ChangeTo);
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "IfOffline", (BYTE)Options.IfOffline);
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "IfOnline", (BYTE)Options.IfOnline);
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "IfAway", (BYTE)Options.IfAway);
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "IfNA", (BYTE)Options.IfNA);
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "IfDND", (BYTE)Options.IfDND);
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "IfOccupied", (BYTE)Options.IfOccupied);
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "IfFreeforchat", (BYTE)Options.IfFreeforchat);
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "IfInvisible", (BYTE)Options.IfInvisible);
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "IfOnthephone", (BYTE)Options.IfOnthephone);
+ DBWriteContactSettingByte(NULL, PLUGINNAME, "IfOuttolunch", (BYTE)Options.IfOuttolunch);
+ return TRUE;
+ break;
+ }
+ break;
+ break;
+ }
+ break;
+
+ case WM_DESTROY:
+ DestroyIcon(hIconMsg);
+ DestroyIcon(hIconUrl);
+ DestroyIcon(hIconFile);
+ break;
+ }
+
+ return FALSE;
+}
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+{
+ hInst = hinstDLL;
+ DisableThreadLibraryCalls(hInst);
+ return TRUE;
+}
+
+__declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion)
+{
+ return &pluginInfo;
+}
+
+int __declspec(dllexport) Load(PLUGINLINK *link)
+{
+ pluginLink = link;
+
+ hOptInit = HookEvent(ME_OPT_INITIALISE,StatusChangeOptInit);
+ hNewMessage = HookEvent(ME_DB_EVENT_ADDED,StatusChangeGetMessage);
+
+ // Plugin Sweeper support
+ DBWriteContactSettingString(NULL, "Uninstall", Translate(PLUGINNAME), PLUGINNAME);
+
+ LoadOptions();
+
+ return 0;
+}
+
+int __declspec(dllexport) Unload(void)
+{
+ if(hOptInit) UnhookEvent(hOptInit);
+ if(hNewMessage) UnhookEvent(hNewMessage);
+ return 0;
+}
diff --git a/plugins/!NotAdopted/statuschange/resource.h b/plugins/!NotAdopted/statuschange/resource.h new file mode 100644 index 0000000000..03dc8e0fbd --- /dev/null +++ b/plugins/!NotAdopted/statuschange/resource.h @@ -0,0 +1,28 @@ +#define IDC_CHK_OFFLINE 1001
+#define IDC_CHK_ONLINE 1002
+#define IDC_CHK_AWAY 1003
+#define IDC_CHK_DND 1004
+#define IDC_CHK_NA 1005
+#define IDC_CHK_OCCUPIED 1006
+#define IDC_CHK_FREECHAT 1007
+#define IDC_CHK_INVISIBLE 1008
+
+#define IDC_RAD_OFFLINE 2001
+#define IDC_RAD_ONLINE 2002
+#define IDC_RAD_AWAY 2003
+#define IDC_RAD_DND 2004
+#define IDC_RAD_NA 2005
+#define IDC_RAD_OCCUPIED 2006
+#define IDC_RAD_FREECHAT 2007
+#define IDC_RAD_INVISIBLE 2008
+
+#define IDC_CHK_MESSAGEREAD 3001
+#define IDC_CHK_MESSAGESEND 3002
+#define IDC_CHK_URLREAD 3003
+#define IDC_CHK_URLSEND 3004
+#define IDC_CHK_FILEREAD 3005
+#define IDC_CHK_FILESEND 3006
+
+#define IDC_MSGICON 4001
+#define IDC_URLICON 4002
+#define IDC_FILEICON 4003
diff --git a/plugins/!NotAdopted/statuschange/resource.rc b/plugins/!NotAdopted/statuschange/resource.rc new file mode 100644 index 0000000000..b8f15a8cc4 --- /dev/null +++ b/plugins/!NotAdopted/statuschange/resource.rc @@ -0,0 +1,145 @@ +//Microsoft Developer Studio generated resource script.
+//
+#include "resrc1.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+#undef APSTUDIO_HIDDEN_SYMBOLS
+#include "resource.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Portuguese (Brazil) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_PTB)
+#ifdef _WIN32
+LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_OPTIONS DIALOGEX 0, 0, 316, 234
+STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CONTROL "",IDC_CHK_MESSAGESEND,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,165,27,10,8
+ CONTROL "",IDC_CHK_MESSAGEREAD,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,200,27,10,8
+ CONTROL "",IDC_CHK_URLSEND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+ 165,38,10,8
+ CONTROL "",IDC_CHK_URLREAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+ 200,38,10,8
+ CONTROL "",IDC_CHK_FILESEND,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,165,49,10,8
+ CONTROL "",IDC_CHK_FILEREAD,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,200,49,10,8
+ CONTROL "Offline",IDC_RAD_OFFLINE,"Button",BS_AUTORADIOBUTTON |
+ WS_GROUP | WS_TABSTOP,60,88,95,10
+ CONTROL "Online",IDC_RAD_ONLINE,"Button",BS_AUTORADIOBUTTON |
+ WS_TABSTOP,60,98,95,10
+ CONTROL "Away",IDC_RAD_AWAY,"Button",BS_AUTORADIOBUTTON |
+ WS_TABSTOP,60,108,95,10
+ CONTROL "NA",IDC_RAD_NA,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
+ 60,118,95,10
+ CONTROL "Occupied",IDC_RAD_OCCUPIED,"Button",BS_AUTORADIOBUTTON |
+ WS_TABSTOP,60,128,95,10
+ CONTROL "DND",IDC_RAD_DND,"Button",BS_AUTORADIOBUTTON |
+ WS_TABSTOP,165,88,95,10
+ CONTROL "Free for chat",IDC_RAD_FREECHAT,"Button",
+ BS_AUTORADIOBUTTON | WS_TABSTOP,165,98,95,10
+ CONTROL "Invisible",IDC_RAD_INVISIBLE,"Button",
+ BS_AUTORADIOBUTTON | WS_TABSTOP,165,108,95,10
+ CONTROL "On the phone",IDC_RAD_ONTHEPHONE,"Button",
+ BS_AUTORADIOBUTTON | WS_TABSTOP,165,118,95,10
+ CONTROL "Out to lunch",IDC_RAD_OUTTOLUNCH,"Button",
+ BS_AUTORADIOBUTTON | WS_TABSTOP,165,128,95,10
+ CONTROL "Offline",IDC_CHK_OFFLINE,"Button",BS_AUTOCHECKBOX |
+ WS_DISABLED | WS_TABSTOP,60,165,95,10
+ CONTROL "Online",IDC_CHK_ONLINE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,60,175,95,10
+ CONTROL "Away",IDC_CHK_AWAY,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,60,185,95,10
+ CONTROL "NA",IDC_CHK_NA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,60,
+ 195,95,10
+ CONTROL "Occupied",IDC_CHK_OCCUPIED,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,60,204,95,10
+ CONTROL "DND",IDC_CHK_DND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+ 165,165,95,10
+ CONTROL "Free for chat",IDC_CHK_FREECHAT,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,165,175,95,10
+ CONTROL "Invisible",IDC_CHK_INVISIBLE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,165,185,95,10
+ CONTROL "On the phone",IDC_CHK_ONTHEPHONE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,165,195,95,10
+ CONTROL "Out to lunch",IDC_CHK_OUTTOLUNCH,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,165,205,95,10
+ GROUPBOX "On events...",-1,45,10,220,55,WS_GROUP
+ LTEXT "Send",-1,160,17,27,9,NOT WS_GROUP
+ LTEXT "Receive",-1,190,17,42,9,NOT WS_GROUP
+ LTEXT "Message",-1,73,27,85,8,NOT WS_GROUP
+ LTEXT "URL",-1,73,38,85,8,NOT WS_GROUP
+ LTEXT "File transfer",-1,73,49,85,8,NOT WS_GROUP
+ GROUPBOX "...change status to...",-1,45,73,220,68,WS_GROUP
+ GROUPBOX "... if status is...",-1,45,150,220,68,WS_GROUP
+ ICON "",IDC_MSGICON,51,20,20,20,SS_CENTERIMAGE
+ ICON "",IDC_URLICON,51,32,20,20,SS_CENTERIMAGE
+ ICON "",IDC_FILEICON,51,44,20,20,SS_CENTERIMAGE
+END
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resrc1.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "#include ""windows.h""\r\n"
+ "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "#include ""resource.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // Portuguese (Brazil) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/!NotAdopted/statuschange/resrc1.h b/plugins/!NotAdopted/statuschange/resrc1.h new file mode 100644 index 0000000000..b2a317cd08 --- /dev/null +++ b/plugins/!NotAdopted/statuschange/resrc1.h @@ -0,0 +1,21 @@ +//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by resource.rc
+//
+#define IDD_OPTIONS 10
+#define IDC_RAD_ONTHEPHONE 1010
+#define IDC_RAD_OUTTOLUNCH 1011
+#define IDC_CHK_ONTHEPHONE 1012
+#define IDC_CHK_OUTTOLUNCH 1013
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NO_MFC 1
+#define _APS_NEXT_RESOURCE_VALUE 101
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1016
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
|