diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-14 21:12:01 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-14 21:12:01 +0000 |
commit | 017bb0233c3495eb6b441f5adbfb864f8ac93dce (patch) | |
tree | 62fbd2e6fbb5a4a63772248581001c08f76491a1 /protocols/NewsAggregator/Src/Services.cpp | |
parent | 37f6d368b6214799b74dbc6050db106cb9df68af (diff) |
NewsAggregator:
working without boost libs (maybe have bugs)
Check News Feed when message dialog is opened
git-svn-id: http://svn.miranda-ng.org/main/trunk@418 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/NewsAggregator/Src/Services.cpp')
-rw-r--r-- | protocols/NewsAggregator/Src/Services.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/protocols/NewsAggregator/Src/Services.cpp b/protocols/NewsAggregator/Src/Services.cpp index 0c23983c79..38213c0ce6 100644 --- a/protocols/NewsAggregator/Src/Services.cpp +++ b/protocols/NewsAggregator/Src/Services.cpp @@ -22,6 +22,16 @@ Boston, MA 02111-1307, USA. int g_nStatus = ID_STATUS_OFFLINE;
UINT_PTR timerId = 0;
+HANDLE hOpenMessageWindow = NULL;
+
+int OnMessageWindowOpen(WPARAM,LPARAM lParam)
+{
+ MessageWindowEventData *hWindowEvent = (MessageWindowEventData*) lParam;
+ if (hWindowEvent->uType == MSG_WINDOW_EVT_OPENING && IsMyContact(hWindowEvent->hContact))
+ CheckCurrentFeed(hWindowEvent->hContact);
+ return 0;
+}
+
void SetContactStatus(HANDLE hContact,int nNewStatus)
{
if(DBGetContactSettingWord(hContact,MODULE,"Status",ID_STATUS_OFFLINE) != nNewStatus)
@@ -58,6 +68,8 @@ int NewsAggrInit(WPARAM wParam,LPARAM lParam) InitIcons();
InitMenu();
+ hOpenMessageWindow = HookEvent(ME_MSG_WINDOWEVENT,OnMessageWindowOpen);
+
// timer for the first update
timerId = SetTimer(NULL, 0, 5000, timerProc2); // first update is 5 sec after load
@@ -76,6 +88,8 @@ int NewsAggrPreShutdown(WPARAM wParam,LPARAM lParam) KillTimer(NULL, timerId);
NetlibUnInit();
+ if(hOpenMessageWindow) UnhookEvent(hOpenMessageWindow);
+
return 0;
}
|