diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-01-12 20:15:30 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-01-12 20:15:30 +0000 |
commit | eec8d5bd49a4f862ea926ad24ee07f19cdc10933 (patch) | |
tree | 074ce6b42c40ec84c48926dbe98679f05138b2f7 /plugins/NewsAggregator/Src/Services.cpp | |
parent | 69bacf13e2c85a5f57df9215288c9b2dcf205db7 (diff) |
added options for not receiving news at startup
git-svn-id: http://svn.miranda-ng.org/main/trunk@3080 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewsAggregator/Src/Services.cpp')
-rw-r--r-- | plugins/NewsAggregator/Src/Services.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index 33a9e8febf..266d386b32 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -32,11 +32,10 @@ void SetContactStatus(HANDLE hContact, int nNewStatus) static void __cdecl WorkingThread(void* param)
{
int nStatus = (int)param;
-// UpdateAll(FALSE, FALSE);
HANDLE hContact= db_find_first();
- while (hContact != NULL)
+ while (hContact != NULL)
{
- if(IsMyContact(hContact))
+ if(IsMyContact(hContact))
{
SetContactStatus(hContact, nStatus);
}
@@ -47,10 +46,12 @@ static void __cdecl WorkingThread(void* param) int NewsAggrInit(WPARAM wParam, LPARAM lParam)
{
HANDLE hContact = db_find_first();
- while (hContact != NULL)
+ while (hContact != NULL)
{
- if(IsMyContact(hContact))
+ if(IsMyContact(hContact))
{
+ if (!db_get_b(NULL, MODULE, "StartupRetrieve", 1))
+ db_set_dw(hContact, MODULE, "LastCheck", time(NULL));
SetContactStatus(hContact, ID_STATUS_ONLINE);
}
hContact = db_find_next(hContact);
@@ -62,7 +63,7 @@ int NewsAggrInit(WPARAM wParam, LPARAM lParam) HookEvent(ME_TTB_MODULELOADED, OnToolbarLoaded);
// timer for the first update
- timerId = SetTimer(NULL, 0, 5000, timerProc2); // first update is 5 sec after load
+ timerId = SetTimer(NULL, 0, 10000, timerProc2); // first update is 5 sec after load
return 0;
}
@@ -92,12 +93,12 @@ INT_PTR NewsAggrGetName(WPARAM wParam, LPARAM lParam) {
return 1;
}
-}
+}
INT_PTR NewsAggrGetCaps(WPARAM wp,LPARAM lp)
{
switch(wp)
- {
+ {
case PFLAGNUM_1:
return PF1_IM | PF1_PEER2PEER;
case PFLAGNUM_3:
@@ -142,7 +143,7 @@ INT_PTR NewsAggrLoadIcon(WPARAM wParam,LPARAM lParam) return (LOWORD(wParam) == PLI_PROTOCOL) ? (INT_PTR)CopyIcon(LoadIconEx("main", FALSE)) : 0;
}
-static void __cdecl AckThreadProc(HANDLE param)
+static void __cdecl AckThreadProc(HANDLE param)
{
Sleep(100);
ProtoBroadcastAck(MODULE, param, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
@@ -158,17 +159,16 @@ INT_PTR NewsAggrGetInfo(WPARAM wParam,LPARAM lParam) INT_PTR CheckAllFeeds(WPARAM wParam,LPARAM lParam)
{
HANDLE hContact = db_find_first();
- while (hContact != NULL)
+ while (hContact != NULL)
{
- if (IsMyContact(hContact) && lParam && DBGetContactSettingDword(hContact, MODULE, "UpdateTime", 60))
+ if (IsMyContact(hContact) && lParam && DBGetContactSettingDword(hContact, MODULE, "UpdateTime", 60))
UpdateListAdd(hContact);
else if (IsMyContact(hContact) && !lParam)
UpdateListAdd(hContact);
hContact = db_find_next(hContact);
}
if (!ThreadRunning)
- mir_forkthread(UpdateThreadProc, NULL);
-
+ mir_forkthread(UpdateThreadProc, (LPVOID)FALSE);
return 0;
}
@@ -213,7 +213,7 @@ INT_PTR CheckFeed(WPARAM wParam, LPARAM lParam) if(IsMyContact(hContact))
UpdateListAdd(hContact);
if (!ThreadRunning)
- mir_forkthread(UpdateThreadProc, NULL);
+ mir_forkthread(UpdateThreadProc, (LPVOID)FALSE);
return 0;
}
@@ -229,7 +229,7 @@ INT_PTR NewsAggrGetAvatarInfo(WPARAM wParam, LPARAM lParam) if (wParam & GAIF_FORCE && DBGetContactSettingDword(pai->hContact, MODULE, "UpdateTime", 60))
UpdateListAdd(pai->hContact);
if (db_get_b(NULL, MODULE, "AutoUpdate", 1) != 0 && !ThreadRunning)
- mir_forkthread(UpdateThreadProc, NULL);
+ mir_forkthread(UpdateThreadProc, (LPVOID)TRUE);
DBVARIANT dbv = {0};
if(DBGetContactSettingTString(pai->hContact, MODULE, "ImageURL", &dbv))
|