summaryrefslogtreecommitdiff
path: root/protocols/MRA/src/Mra_menus.cpp
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-03-07 21:50:21 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-03-07 21:50:21 +0000
commit4b00a811ae7e3678578b04e6811265076f9404d9 (patch)
treeaec31fae331b9e4c4543433ed4bdd3fc2300fd0e /protocols/MRA/src/Mra_menus.cpp
parent5e54cbba072d17eb0f3d0fea9a14f048a3f2ab84 (diff)
MRA
+ Add: Send E-Mail to contact - Del: mail.ru blog service * Change: web authorization via https * Fix: contact services: auth request, auth grang, send post card * Fix: net error handle (after prev commit) git-svn-id: http://svn.miranda-ng.org/main/trunk@8466 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/src/Mra_menus.cpp')
-rw-r--r--protocols/MRA/src/Mra_menus.cpp46
1 files changed, 27 insertions, 19 deletions
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp
index d4fa5a7c16..3d429ca4ee 100644
--- a/protocols/MRA/src/Mra_menus.cpp
+++ b/protocols/MRA/src/Mra_menus.cpp
@@ -106,6 +106,23 @@ INT_PTR CMraProto::MraGrantAuthorization(WPARAM wParam, LPARAM lParam)
return 0;
}
+INT_PTR CMraProto::MraSendEmail(WPARAM wParam, LPARAM lParam)
+{
+ DWORD dwContactEMailCount = GetContactEMailCount(wParam, FALSE);
+ if (dwContactEMailCount) {
+ if (dwContactEMailCount == 1) {
+ CMStringA szUrl, szEmail;
+ if (GetContactFirstEMail(wParam, FALSE, szEmail)) {
+ szEmail.MakeLower();
+ szUrl.Format("https://e.mail.ru/cgi-bin/sentmsg?To=%s", szEmail);
+ MraMPopSessionQueueAddUrl(hMPopSessionQueue, szUrl);
+ }
+ }
+ else MraSelectEMailDlgShow(wParam, MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD);
+ }
+ return 0;
+}
+
INT_PTR CMraProto::MraSendPostcard(WPARAM wParam, LPARAM lParam)
{
DWORD dwContactEMailCount = GetContactEMailCount(wParam, FALSE);
@@ -137,20 +154,6 @@ INT_PTR CMraProto::MraViewAlbum(WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR CMraProto::MraReadBlog(WPARAM wParam, LPARAM lParam)
-{
- DWORD dwContactEMailMRCount = GetContactEMailCount(wParam, TRUE);
- if (dwContactEMailMRCount)
- if (dwContactEMailMRCount == 1) {
- CMStringA szEmail;
- if (GetContactFirstEMail(wParam, TRUE, szEmail))
- MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_BLOGS_URL, szEmail);
- }
- else MraSelectEMailDlgShow(wParam, MRA_SELECT_EMAIL_TYPE_READ_BLOG);
-
- return 0;
-}
-
INT_PTR CMraProto::MraReplyBlogStatus(WPARAM wParam, LPARAM lParam)
{
if (!m_bLoggedIn)
@@ -244,13 +247,13 @@ int CMraProto::MraRebuildContactMenu(WPARAM hContact, LPARAM lParam)
//"Grant authorization"
Menu_ShowItem(hContactMenuItems[1], (m_bLoggedIn && bIsContactMRA && !bChatAgent));
- //"&Send postcard"
+ //"&Send E-Mail"
Menu_ShowItem(hContactMenuItems[2], (bHasEMail && !bChatAgent));
- //"&View Album"
- Menu_ShowItem(hContactMenuItems[3], (bHasEMailMR && !bChatAgent));
+ //"&Send postcard"
+ Menu_ShowItem(hContactMenuItems[3], (bHasEMail && !bChatAgent));
- //"&Read Blog"
+ //"&View Album"
Menu_ShowItem(hContactMenuItems[4], (bHasEMailMR && !bChatAgent));
//"Reply Blog Status"
@@ -373,11 +376,11 @@ HGENMENU CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bI
void CMraProto::InitMenus()
{
+ /* Main menu and contacts services. */
CreateProtoService(MRA_GOTO_INBOX, &CMraProto::MraGotoInbox);
CreateProtoService(MRA_SHOW_INBOX_STATUS, &CMraProto::MraShowInboxStatus);
CreateProtoService(MRA_EDIT_PROFILE, &CMraProto::MraEditProfile);
CreateProtoService(MRA_VIEW_ALBUM, &CMraProto::MraViewAlbum);
- CreateProtoService(MRA_READ_BLOG, &CMraProto::MraReadBlog);
CreateProtoService(MRA_REPLY_BLOG_STATUS, &CMraProto::MraReplyBlogStatus);
CreateProtoService(MRA_VIEW_VIDEO, &CMraProto::MraViewVideo);
CreateProtoService(MRA_ANSWERS, &CMraProto::MraAnswers);
@@ -386,6 +389,11 @@ void CMraProto::InitMenus()
CreateProtoService(MRA_UPD_ALL_USERS_INFO, &CMraProto::MraUpdateAllUsersInfo);
CreateProtoService(MRA_CHK_USERS_AVATARS, &CMraProto::MraCheckUpdatesUsersAvt);
CreateProtoService(MRA_REQ_AUTH_FOR_ALL, &CMraProto::MraRequestAuthForAll);
+ /* Contacts only services. */
+ CreateProtoService(MRA_REQ_AUTH, &CMraProto::MraRequestAuthorization);
+ CreateProtoService(MRA_GRANT_AUTH, &CMraProto::MraGrantAuthorization);
+ CreateProtoService(MRA_SEND_EMAIL, &CMraProto::MraSendEmail);
+ CreateProtoService(MRA_SEND_POSTCARD, &CMraProto::MraSendPostcard);
hContactMenuRoot = CListCreateMenu(-2000001001, -500050000, FALSE, gdiContactMenuItems, CONTACT_MENU_ITEMS_COUNT, hContactMenuItems);