diff options
author | Robert Pösel <robyer@seznam.cz> | 2012-11-03 15:28:05 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2012-11-03 15:28:05 +0000 |
commit | 6c6549fe3bd2e4103b917a7a9d4c7baf01f1726e (patch) | |
tree | a8998cffdd284e5c3390f2b3639e2d6a3477c1dd /protocols/FacebookRM/src | |
parent | d563df9cb0e5836f9bcc60cf60babab944ca033f (diff) |
Facebook: Few services in status menu
git-svn-id: http://svn.miranda-ng.org/main/trunk@2164 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r-- | protocols/FacebookRM/src/proto.cpp | 28 | ||||
-rw-r--r-- | protocols/FacebookRM/src/proto.h | 6 | ||||
-rw-r--r-- | protocols/FacebookRM/src/theme.cpp | 34 |
3 files changed, 67 insertions, 1 deletions
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index f0b9b7af90..18ada5d913 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -451,6 +451,34 @@ int FacebookProto::OnMind(WPARAM,LPARAM) return FALSE;
}
+int FacebookProto::CheckNewsfeeds(WPARAM, LPARAM)
+{
+ if (!isOffline()) {
+ facy.client_notify( TranslateT("Loading newsfeeds..."));
+ facy.feeds();
+ }
+ return 0;
+}
+
+int FacebookProto::CheckFriendRequests(WPARAM, LPARAM)
+{
+ if (!isOffline()) {
+ facy.client_notify( TranslateT("Checking friend requests..."));
+ ProcessFriendRequests(NULL);
+ }
+ return 0;
+}
+
+int FacebookProto::RefreshBuddyList(WPARAM, LPARAM)
+{
+ if (!isOffline()) {
+ facy.client_notify( TranslateT("Refreshing buddy list..."));
+ facy.buddy_list();
+ }
+ return 0;
+}
+
+
int FacebookProto::VisitProfile(WPARAM wParam,LPARAM lParam)
{
HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h index cdeeaf03f6..0d58e3ae1e 100644 --- a/protocols/FacebookRM/src/proto.h +++ b/protocols/FacebookRM/src/proto.h @@ -111,6 +111,9 @@ public: int __cdecl RequestFriendship(WPARAM, LPARAM );
int __cdecl ApproveFriendship(WPARAM, LPARAM );
int __cdecl OnCancelFriendshipRequest(WPARAM, LPARAM );
+ int __cdecl CheckNewsfeeds(WPARAM, LPARAM );
+ int __cdecl CheckFriendRequests(WPARAM, LPARAM );
+ int __cdecl RefreshBuddyList(WPARAM, LPARAM );
// Events
int __cdecl OnModulesLoaded(WPARAM, LPARAM);
@@ -183,7 +186,8 @@ public: void ToggleStatusMenuItems( BOOL bEnable );
// Handles, Locks
- HGENMENU m_hMenuRoot;
+ HGENMENU m_hMenuRoot;
+ HGENMENU m_hMenuServicesRoot;
HANDLE m_hStatusMind;
HANDLE signon_lock_;
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp index 128eb72759..a223351533 100644 --- a/protocols/FacebookRM/src/theme.cpp +++ b/protocols/FacebookRM/src/theme.cpp @@ -274,6 +274,39 @@ int FacebookProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam) // TODO RM: remember and properly free in destructor?
/*m_hStatusMind = */Menu_AddProtoMenuItem(&mi);
+ // Services...
+ mi.pszName = LPGEN("Services...");
+ strcpy( tDest, "/Services" );
+ mi.flags = CMIF_ICONFROMICOLIB | CMIF_CHILDPOPUP | ( this->isOnline() ? 0 : CMIF_GRAYED );
+ mi.icolibItem = NULL;
+ m_hMenuServicesRoot = Menu_AddProtoMenuItem(&mi);
+
+ CreateProtoService(m_szModuleName,"/CheckFriendRequests",&FacebookProto::CheckFriendRequests,this);
+ strcpy(tDest,"/CheckFriendRequests");
+ mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTHANDLE;
+ mi.pszName = LPGEN("Check Friends Requests");
+ mi.icolibItem = NULL;
+ mi.hParentMenu = m_hMenuServicesRoot;
+ Menu_AddProtoMenuItem(&mi);
+
+ CreateProtoService(m_szModuleName,"/CheckNewsfeeds",&FacebookProto::CheckNewsfeeds,this);
+ strcpy(tDest,"/CheckNewsfeeds");
+ mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTHANDLE;
+ mi.pszName = LPGEN("Check Newsfeeds");
+ mi.pszPopupName = LPGEN("Services");
+ mi.icolibItem = NULL;
+ mi.hParentMenu = m_hMenuServicesRoot;
+ Menu_AddProtoMenuItem(&mi);
+
+ CreateProtoService(m_szModuleName,"/RefreshBuddyList",&FacebookProto::RefreshBuddyList,this);
+ strcpy(tDest,"/RefreshBuddyList");
+ mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTHANDLE;
+ mi.pszName = LPGEN("Refresh buddy list");
+ mi.pszPopupName = LPGEN("Services");
+ mi.icolibItem = NULL;
+ mi.hParentMenu = m_hMenuServicesRoot;
+ Menu_AddProtoMenuItem(&mi);
+
return 0;
}
@@ -285,4 +318,5 @@ void FacebookProto::ToggleStatusMenuItems( BOOL bEnable ) CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )m_hMenuRoot, ( LPARAM )&clmi );
CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )m_hStatusMind, ( LPARAM )&clmi );
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )m_hMenuServicesRoot, ( LPARAM )&clmi );
}
|