summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/FacebookRM')
-rw-r--r--protocols/FacebookRM/src/proto.cpp28
-rw-r--r--protocols/FacebookRM/src/proto.h6
-rw-r--r--protocols/FacebookRM/src/theme.cpp34
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 );
}