diff options
author | Robert Pösel <robyer@seznam.cz> | 2016-07-05 17:58:49 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2016-07-05 17:58:49 +0000 |
commit | b17412619a1706782330e116c6c9e5dd00e39dde (patch) | |
tree | 88470882921bb31b61c070937de7b72346e252ac /protocols/FacebookRM/src | |
parent | ec473b50196a5d04bd0fbcf67f465b5703b5138a (diff) |
Facebook: Provide "Check notifications" and "Check on this day" status menu items
But checking notifications is practically useless, because we're receiving new notifications automatically...
git-svn-id: http://svn.miranda-ng.org/main/trunk@17062 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r-- | protocols/FacebookRM/src/proto.cpp | 30 | ||||
-rw-r--r-- | protocols/FacebookRM/src/proto.h | 2 | ||||
-rw-r--r-- | protocols/FacebookRM/src/theme.cpp | 12 |
3 files changed, 38 insertions, 6 deletions
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 79d2f30893..4194e2a013 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -176,6 +176,11 @@ int FacebookProto::SetStatus(int new_status) { debugLogA("=== Beginning SetStatus process"); + if (new_status != ID_STATUS_OFFLINE && m_iStatus == ID_STATUS_CONNECTING) { + debugLogA("=== Status is already connecting, no change"); + return 0; + } + // Routing statuses not supported by Facebook switch (new_status) { @@ -196,11 +201,6 @@ int FacebookProto::SetStatus(int new_status) break; } - if (new_status != ID_STATUS_OFFLINE && m_iStatus == ID_STATUS_CONNECTING) { - debugLogA("=== Status is already connecting, no change"); - return 0; - } - if (m_iStatus == m_iDesiredStatus) { debugLogA("=== Statuses are same, no change"); return 0; @@ -638,7 +638,25 @@ INT_PTR FacebookProto::CheckFriendRequests(WPARAM, LPARAM) { if (!isOffline()) { facy.client_notify(TranslateT("Checking friend requests...")); - ProcessFriendRequests(NULL); + ForkThread(&FacebookProto::ProcessFriendRequests, NULL); + } + return 0; +} + +INT_PTR FacebookProto::CheckNotifications(WPARAM, LPARAM) +{ + if (!isOffline()) { + facy.client_notify(TranslateT("Checking notifications...")); + ForkThread(&FacebookProto::ProcessNotifications, NULL); + } + return 0; +} + +INT_PTR FacebookProto::CheckOnThisDay(WPARAM, LPARAM) +{ + if (!isOffline()) { + facy.client_notify(TranslateT("Checking what happened on this day...")); + ForkThread(&FacebookProto::ProcessOnThisDay, NULL); } return 0; } diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h index 06e0dae590..f243c00d24 100644 --- a/protocols/FacebookRM/src/proto.h +++ b/protocols/FacebookRM/src/proto.h @@ -125,6 +125,8 @@ public: INT_PTR __cdecl OnCancelFriendshipRequest(WPARAM, LPARAM); INT_PTR __cdecl CheckNewsfeeds(WPARAM, LPARAM); INT_PTR __cdecl CheckFriendRequests(WPARAM, LPARAM); + INT_PTR __cdecl CheckNotifications(WPARAM, LPARAM); + INT_PTR __cdecl CheckOnThisDay(WPARAM, LPARAM); INT_PTR __cdecl GetNotificationsCount(WPARAM, LPARAM); INT_PTR __cdecl OnJoinChat(WPARAM,LPARAM); diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp index 8eaf1858cd..ac44acd1b8 100644 --- a/protocols/FacebookRM/src/theme.cpp +++ b/protocols/FacebookRM/src/theme.cpp @@ -263,6 +263,18 @@ void FacebookProto::InitMenu() mi.name.a = LPGEN("Check Newsfeeds");
mi.hIcolibItem = GetIconHandle("newsfeed");
Menu_AddProtoMenuItem(&mi, m_szModuleName);
+
+ mi.pszService = "/CheckNotifications";
+ CreateProtoService(mi.pszService, &FacebookProto::CheckNotifications);
+ mi.name.a = LPGEN("Check Notifications");
+ mi.hIcolibItem = GetIconHandle("notification");
+ Menu_AddProtoMenuItem(&mi, m_szModuleName);
+
+ mi.pszService = "/CheckOnThisDay";
+ CreateProtoService(mi.pszService, &FacebookProto::CheckOnThisDay);
+ mi.name.a = LPGEN("Check On This Day");
+ mi.hIcolibItem = GetIconHandle("mind");
+ Menu_AddProtoMenuItem(&mi, m_szModuleName);
}
int FacebookProto::OnBuildStatusMenu(WPARAM, LPARAM)
|