summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/chat.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-15 19:19:37 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-15 19:19:37 +0300
commit85cfcb81a2ee0afad3cb3b2b7951f68ad74ce8bf (patch)
treeb59672fd05d525df6702a509c4480c1aff66164b /protocols/FacebookRM/src/chat.cpp
parent5b0699740c8998327a2681f79347e1d630bbaab6 (diff)
Facebook: action added to destroy chat history
Diffstat (limited to 'protocols/FacebookRM/src/chat.cpp')
-rw-r--r--protocols/FacebookRM/src/chat.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp
index 7ccaef2459..266818d1af 100644
--- a/protocols/FacebookRM/src/chat.cpp
+++ b/protocols/FacebookRM/src/chat.cpp
@@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
enum ChatMenuItems
{
- IDM_INVITE = 10, IDM_EXIT,
+ IDM_INVITE = 10, IDM_EXIT, IDM_DESTROY,
IDM_DETAILS = 20, IDM_HISTORY
};
@@ -35,6 +35,7 @@ static const struct gc_item LogMenuItems[] =
{
{ LPGENW("&Invite user..."), IDM_INVITE, MENU_ITEM, FALSE },
{ LPGENW("E&xit chat session"), IDM_EXIT, MENU_ITEM, FALSE },
+ { LPGENW("&Destroy chat session"), IDM_DESTROY, MENU_ITEM, FALSE },
};
static const struct gc_item NickMenuItems[] =
@@ -125,6 +126,15 @@ int FacebookProto::OnGCEvent(WPARAM, LPARAM lParam)
facy.sendRequest(facy.exitThreadRequest(it->second));
}
break;
+
+ case IDM_DESTROY:
+ {
+ std::string thread_id = _T2A(hook->ptszID, CP_UTF8);
+ auto it = facy.chat_rooms.find(thread_id);
+ if (it != facy.chat_rooms.end())
+ if (IDOK == MessageBoxW(nullptr, TranslateT("Delete conversation"), TranslateT("This will permanently delete the conversation history"), MB_OKCANCEL))
+ facy.sendRequest(facy.destroyThreadRequest(it->second));
+ }
}
break;