diff options
Diffstat (limited to 'plugins/NewsAggregator')
-rw-r--r-- | plugins/NewsAggregator/Src/CheckFeed.cpp | 26 | ||||
-rw-r--r-- | plugins/NewsAggregator/Src/Version.h | 16 |
2 files changed, 23 insertions, 19 deletions
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index d357599a1b..6518acb559 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -355,22 +355,26 @@ void CheckCurrentFeed(MCONTACT hContact) mir_free(category);
}
- bool MesExist = false;
- ptrA pszTemp(mir_utf8encodeT(message));
- for (HANDLE hDbEvent = db_event_first(hContact);hDbEvent;hDbEvent = db_event_next(hContact, hDbEvent)) {
- DBEVENTINFO olddbei = { sizeof(olddbei) };
+ DBEVENTINFO olddbei = { 0 };
+ olddbei.cbSize = sizeof(olddbei);
+
+ bool MesExist = false;
+ ptrA pszTemp(mir_utf8encodeT(message));
+ DWORD cbMemoLen = 10000, cbOrigLen = lstrlenA(pszTemp);
+ BYTE *pbBuffer = (BYTE*)mir_alloc(cbMemoLen);
+ for (HANDLE hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) {
olddbei.cbBlob = db_event_getBlobSize(hDbEvent);
- olddbei.pBlob = (PBYTE)mir_alloc(olddbei.cbBlob);
+ if (olddbei.cbBlob > cbMemoLen)
+ pbBuffer = (PBYTE)mir_realloc(pbBuffer, cbMemoLen = olddbei.cbBlob);
+ olddbei.pBlob = pbBuffer;
db_event_get(hDbEvent, &olddbei);
- char *pszTemp = mir_utf8encodeT(message);
- if (olddbei.cbBlob == lstrlenA(pszTemp) + 1 && !lstrcmpA((char *)olddbei.pBlob, pszTemp)) {
+
+ if (olddbei.cbBlob == cbOrigLen+1 && !lstrcmpA((char*)olddbei.pBlob, pszTemp)) {
MesExist = true;
- }
-
- mir_free(olddbei.pBlob);
- if (MesExist)
break;
+ }
}
+ mir_free(pbBuffer);
if (!MesExist) {
if (stamp == 0)
diff --git a/plugins/NewsAggregator/Src/Version.h b/plugins/NewsAggregator/Src/Version.h index 5424fdb344..52b0b9799e 100644 --- a/plugins/NewsAggregator/Src/Version.h +++ b/plugins/NewsAggregator/Src/Version.h @@ -1,14 +1,14 @@ -#define __MAJOR_VERSION 0
-#define __MINOR_VERSION 0
-#define __RELEASE_NUM 0
-#define __BUILD_NUM 1
+#define __MAJOR_VERSION 0
+#define __MINOR_VERSION 1
+#define __RELEASE_NUM 0
+#define __BUILD_NUM 2
#include <stdver.h>
#define __PLUGIN_NAME "News aggregator"
#define __FILENAME "NewsAggregator.dll"
-#define __DESCRIPTION "RSS/Atom news aggregator."
-#define __AUTHOR "Mataes, FREAK_THEMIGHTY"
+#define __DESCRIPTION "RSS/Atom news aggregator."
+#define __AUTHOR "Mataes, FREAK_THEMIGHTY"
#define __AUTHOREMAIL "mataes2007@gmail.com"
-#define __AUTHORWEB "http://miranda-ng.org/p/NewsAggregator/"
-#define __COPYRIGHT "© 2012 Mataes, FREAK_THEMIGHTY"
+#define __AUTHORWEB "http://miranda-ng.org/p/NewsAggregator/"
+#define __COPYRIGHT "© 2012 Mataes, FREAK_THEMIGHTY"
|