summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r--protocols/FacebookRM/src/constants.h1
-rw-r--r--protocols/FacebookRM/src/proto.cpp20
-rw-r--r--protocols/FacebookRM/src/proto.h1
-rw-r--r--protocols/FacebookRM/src/resource.h1
-rw-r--r--protocols/FacebookRM/src/theme.cpp17
-rw-r--r--protocols/FacebookRM/src/theme.h3
6 files changed, 38 insertions, 5 deletions
diff --git a/protocols/FacebookRM/src/constants.h b/protocols/FacebookRM/src/constants.h
index b4af81412a..83da81d108 100644
--- a/protocols/FacebookRM/src/constants.h
+++ b/protocols/FacebookRM/src/constants.h
@@ -31,6 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define FACEBOOK_URL_PROFILE "http://www.facebook.com/profile.php?id="
#define FACEBOOK_URL_GROUP "http://www.facebook.com/n/?home.php&sk=group_"
#define FACEBOOK_URL_PICTURE "http://graph.facebook.com/%s/picture"
+#define FACEBOOK_URL_CONVERSATION "http://www.facebook.com/messages/"
// Connection
#define FACEBOOK_SERVER_REGULAR "www.facebook.com"
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 10e61fc840..7ec20b4790 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -551,6 +551,26 @@ INT_PTR FacebookProto::VisitFriendship(WPARAM wParam,LPARAM lParam)
return 0;
}
+INT_PTR FacebookProto::VisitConversation(WPARAM wParam, LPARAM lParam)
+{
+ MCONTACT hContact = MCONTACT(wParam);
+
+ if (wParam == 0 || !IsMyContact(hContact, true))
+ return 1;
+
+ std::string url = FACEBOOK_URL_CONVERSATION;
+
+ if (isChatRoom(hContact)) {
+ url += "conversation-";
+ url += ptrA(getStringA(hContact, FACEBOOK_KEY_TID));
+ } else {
+ url += ptrA(getStringA(hContact, FACEBOOK_KEY_ID));
+ }
+
+ OpenUrl(url);
+ return 0;
+}
+
INT_PTR FacebookProto::Poke(WPARAM wParam,LPARAM lParam)
{
if (wParam == NULL || isOffline())
diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h
index 06aae5acb4..319e08074c 100644
--- a/protocols/FacebookRM/src/proto.h
+++ b/protocols/FacebookRM/src/proto.h
@@ -116,6 +116,7 @@ public:
INT_PTR __cdecl GetAvatarCaps(WPARAM, LPARAM);
INT_PTR __cdecl VisitProfile(WPARAM, LPARAM);
INT_PTR __cdecl VisitFriendship(WPARAM, LPARAM);
+ INT_PTR __cdecl VisitConversation(WPARAM, LPARAM);
INT_PTR __cdecl Poke(WPARAM, LPARAM);
INT_PTR __cdecl CancelFriendship(WPARAM, LPARAM);
INT_PTR __cdecl RequestFriendship(WPARAM, LPARAM);
diff --git a/protocols/FacebookRM/src/resource.h b/protocols/FacebookRM/src/resource.h
index ae65552642..4c706e58e5 100644
--- a/protocols/FacebookRM/src/resource.h
+++ b/protocols/FacebookRM/src/resource.h
@@ -14,6 +14,7 @@
#define IDI_NOTIFICATION 128
#define IDI_NEWSFEED 129
#define IDI_FRIENDS 130
+#define IDI_CONVERSATION 131
#define IDC_UN 1001
#define IDC_PW 1002
#define IDC_NEWACCOUNTLINK 1003
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp
index f9e60078ee..eb10c0d6a8 100644
--- a/protocols/FacebookRM/src/theme.cpp
+++ b/protocols/FacebookRM/src/theme.cpp
@@ -32,6 +32,7 @@ static IconItem icons[] =
{ LPGEN("Notification"), "notification", IDI_NOTIFICATION },
{ LPGEN("Newsfeed"), "newsfeed", IDI_NEWSFEED },
{ LPGEN("Friendship details"), "friendship", IDI_FRIENDS },
+ { LPGEN("Conversation history"), "conversation", IDI_CONVERSATION },
};
// TODO: uninit
@@ -101,14 +102,21 @@ void InitContactMenus()
CreateServiceFunction(mi.pszService,GlobalService<&FacebookProto::VisitFriendship>);
g_hContactMenuItems[CMI_VISIT_FRIENDSHIP] = Menu_AddContactMenuItem(&mi);
- mi.position=-2000006001;
+ mi.position = -2000006002;
+ mi.icolibItem = GetIconHandle("conversation");
+ mi.pszName = LPGEN("Visit conversation history");
+ mi.pszService = "FacebookProto/VisitConversation";
+ CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::VisitConversation>);
+ g_hContactMenuItems[CMI_VISIT_CONVERSATION] = Menu_AddContactMenuItem(&mi);
+
+ mi.position=-2000006003;
mi.icolibItem = GetIconHandle("mind");
mi.pszName = LPGEN("Share status...");
mi.pszService = "FacebookProto/Mind";
CreateServiceFunction(mi.pszService,GlobalService<&FacebookProto::OnMind>);
g_hContactMenuItems[CMI_POST_STATUS] = Menu_AddContactMenuItem(&mi);
- mi.position=-2000006002;
+ mi.position=-2000006004;
mi.icolibItem = GetIconHandle("poke");
mi.pszName = LPGEN("Poke");
mi.pszService = "FacebookProto/Poke";
@@ -155,8 +163,9 @@ int FacebookProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM lParam)
MCONTACT hContact = MCONTACT(wParam);
bool bIsChatroom = isChatRoom(hContact);
- Menu_ShowItem(g_hContactMenuItems[CMI_VISIT_PROFILE], true);
+ Menu_ShowItem(g_hContactMenuItems[CMI_VISIT_PROFILE], !bIsChatroom);
Menu_ShowItem(g_hContactMenuItems[CMI_VISIT_FRIENDSHIP], !bIsChatroom);
+ Menu_ShowItem(g_hContactMenuItems[CMI_VISIT_CONVERSATION], true);
Menu_ShowItem(g_hContactMenuItems[CMI_POST_STATUS], !bIsChatroom);
if (!isOffline() && !bIsChatroom)
@@ -167,7 +176,7 @@ int FacebookProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM lParam)
Menu_ShowItem(g_hContactMenuItems[CMI_AUTH_ASK], ctrlPressed || type == CONTACT_NONE || !type);
Menu_ShowItem(g_hContactMenuItems[CMI_AUTH_GRANT], ctrlPressed || type == CONTACT_APPROVE);
Menu_ShowItem(g_hContactMenuItems[CMI_AUTH_REVOKE], ctrlPressed || type == CONTACT_FRIEND);
- Menu_ShowItem(g_hContactMenuItems[CMI_AUTH_CANCEL], ctrlPressed || type == CONTACT_REQUEST);
+ Menu_ShowItem(g_hContactMenuItems[CMI_AUTH_CANCEL], ctrlPressed || type == CONTACT_REQUEST);
Menu_ShowItem(g_hContactMenuItems[CMI_POKE], true);
}
diff --git a/protocols/FacebookRM/src/theme.h b/protocols/FacebookRM/src/theme.h
index 0bb0fdc129..6c3f9a566a 100644
--- a/protocols/FacebookRM/src/theme.h
+++ b/protocols/FacebookRM/src/theme.h
@@ -37,5 +37,6 @@ void UninitContactMenus(void);
#define CMI_AUTH_CANCEL 5
#define CMI_POKE 6
#define CMI_POST_STATUS 7
+#define CMI_VISIT_CONVERSATION 8
-#define CMITEMS_COUNT 8 \ No newline at end of file
+#define CMITEMS_COUNT 9 \ No newline at end of file