diff options
author | Robert Pösel <robyer@seznam.cz> | 2016-08-31 10:11:26 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2016-08-31 10:11:26 +0000 |
commit | a5a6c8afb1d68330dc1e112ca9bdb0e38c435ad8 (patch) | |
tree | 4e46c9a32742d43b992e5ea00f5d6cf3e3594156 /protocols/FacebookRM/src/proto.cpp | |
parent | 052f82ecce5ebd44ea631bc0a8affb1864267301 (diff) |
Facebook: Implement loading history from server (via contact menu)
git-svn-id: http://svn.miranda-ng.org/main/trunk@17220 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/proto.cpp')
-rw-r--r-- | protocols/FacebookRM/src/proto.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 4af360a747..ea84b7033a 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -769,6 +769,34 @@ INT_PTR FacebookProto::Poke(WPARAM wParam, LPARAM) return 0; } +INT_PTR FacebookProto::LoadHistory(WPARAM wParam, LPARAM) +{ + if (wParam == NULL || isOffline()) + return 1; + + MCONTACT hContact = MCONTACT(wParam); + + // Ignore groupchats // TODO: Support for groupchats? + if (isChatRoom(hContact)) + return 0; + + ptrW name(getWStringA(hContact, FACEBOOK_KEY_NICK)); + if (name == NULL) + name = getWStringA(hContact, FACEBOOK_KEY_ID); + if (name == NULL) + return 1; + + CMStringW title; + title.AppendFormat(L"%s - %s", m_tszUserName, name); + CMStringW message("This will load all messages from the server. It might take a while, so be patient.\n\nDo you want to continue?"); + + if (MessageBox(0, message, title, MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2) == IDYES) { + ForkThread(&FacebookProto::LoadHistory, new MCONTACT(hContact)); + } + + return 0; +} + INT_PTR FacebookProto::CancelFriendship(WPARAM wParam, LPARAM lParam) { if (wParam == NULL || isOffline()) |