diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-03-21 10:19:45 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-03-21 10:19:45 +0000 |
commit | 32bc62f43a2c4c045bbdf6eb189d353113e36ebb (patch) | |
tree | e1279de7b36d177363fc64c3ed761c9aed6ee695 /plugins/BuddyPounce/src/main.cpp | |
parent | 0ec8d29f1dd1c40f355718d632ef6884318d0d9b (diff) |
minor cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@4139 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BuddyPounce/src/main.cpp')
-rw-r--r-- | plugins/BuddyPounce/src/main.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index f12bb526a0..111dbbc5d4 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -143,7 +143,7 @@ int statusCheck(int statusFlag, int status) return 0;
}
int CheckDate(HANDLE hContact)
-{
+{
time_t curtime = time (NULL);
if(!DBGetContactSettingByte(hContact,modname,"GiveUpDays",0))
return 1;
@@ -182,12 +182,12 @@ int UserOnlineSettingChanged(WPARAM wParam,LPARAM lParam) && statusCheck(DBGetContactSettingWord(hContact, modname, "SendIfTheirStatusIsFLAG", 0), newStatus) )
{
// check if we r giving up after x days
- if (CheckDate(hContact))
+ if (CheckDate(hContact))
{
-
+
if (DBGetContactSettingByte(hContact, modname, "ConfirmTimeout", 0))
{
- struct SendPounceDlgProcStruct *spdps = (struct SendPounceDlgProcStruct *)malloc(sizeof(struct SendPounceDlgProcStruct));
+ struct SendPounceDlgProcStruct *spdps = (struct SendPounceDlgProcStruct *)mir_alloc(sizeof(struct SendPounceDlgProcStruct));
TCHAR *message = mir_tstrdup(dbv.ptszVal); // will get free()ed in the send confirm window proc
spdps->hContact = hContact;
spdps->message = message;
@@ -235,12 +235,12 @@ INT_PTR AddToPounce(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
if (!DBGetContactSettingTString(hContact, modname, "PounceMsg",&dbv))
{
- TCHAR* newPounce = (TCHAR*)malloc(lstrlen(dbv.ptszVal) + lstrlen(message) + 1);
+ TCHAR* newPounce = (TCHAR*)mir_alloc(lstrlen(dbv.ptszVal) + lstrlen(message) + 1);
if (!newPounce) return 1;
_tcscpy(newPounce, dbv.ptszVal);
_tcscat(newPounce, message);
DBWriteContactSettingTString(hContact, modname, "PounceMsg", newPounce);
- free(newPounce);
+ mir_free(newPounce);
DBFreeVariant(&dbv);
}
else AddSimpleMessage((WPARAM)hContact, (LPARAM)message);
@@ -251,7 +251,7 @@ INT_PTR AddToPounce(WPARAM wParam, LPARAM lParam) // Load (hook ModulesLoaded)
//===========================
extern "C" __declspec(dllexport) int Load(void)
-{
+{
mir_getLP(&pluginInfo);
HookEvent(ME_SYSTEM_MODULESLOADED, MainInit);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, UserOnlineSettingChanged);
@@ -269,7 +269,7 @@ extern "C" __declspec(dllexport) int Load(void) }
-extern "C" __declspec(dllexport) int Unload(void)
-{
+extern "C" __declspec(dllexport) int Unload(void)
+{
return 0;
-}
+}
|