summaryrefslogtreecommitdiff
path: root/src/core/stdemail
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-05 22:27:16 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-05 22:27:16 +0000
commit007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (patch)
treeb1ee30b70c6e36d1a06aed6885cb80dc560a68ca /src/core/stdemail
parentf4a1bbc6ba4b8137cb868639ac146aa97e97e9df (diff)
- rest of menus cleared;
- old database macroses wiped out from all plugins (left in m_database.h for compatibility) git-svn-id: http://svn.miranda-ng.org/main/trunk@4324 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core/stdemail')
-rw-r--r--src/core/stdemail/email.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/core/stdemail/email.cpp b/src/core/stdemail/email.cpp
index d744e71f51..95f772884b 100644
--- a/src/core/stdemail/email.cpp
+++ b/src/core/stdemail/email.cpp
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "commonheaders.h"
-static HANDLE hEMailMenuItem;
+static HGENMENU hEMailMenuItem;
void SendEmailThread(void *szUrl)
{
@@ -35,8 +35,8 @@ static INT_PTR SendEMailCommand(WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv;
char *szProto = GetContactProto((HANDLE)wParam);
- if (szProto == NULL || DBGetContactSettingString((HANDLE)wParam, szProto, "e-mail", &dbv)) {
- if (DBGetContactSettingString((HANDLE)wParam, "UserInfo", "Mye-mail0", &dbv)) {
+ if (szProto == NULL || db_get_s((HANDLE)wParam, szProto, "e-mail", &dbv)) {
+ if (db_get_s((HANDLE)wParam, "UserInfo", "Mye-mail0", &dbv)) {
MessageBox((HWND)lParam, TranslateT("User has not registered an e-mail address"), TranslateT("Send e-mail"), MB_OK);
return 1;
}
@@ -51,17 +51,15 @@ static INT_PTR SendEMailCommand(WPARAM wParam, LPARAM lParam)
static int EMailPreBuildMenu(WPARAM wParam, LPARAM)
{
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS;
-
+ bool bEnabled = true;
DBVARIANT dbv = { 0 };
char *szProto = GetContactProto((HANDLE)wParam);
- if (szProto == NULL || DBGetContactSettingString((HANDLE)wParam, szProto, "e-mail", & dbv))
- if (DBGetContactSettingString((HANDLE)wParam, "UserInfo", "Mye-mail0", &dbv))
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
+ if (szProto == NULL || db_get_s((HANDLE)wParam, szProto, "e-mail", & dbv))
+ if (db_get_s((HANDLE)wParam, "UserInfo", "Mye-mail0", &dbv))
+ bEnabled = false;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hEMailMenuItem, (LPARAM)&mi);
- if (dbv.pszVal) DBFreeVariant(&dbv);
+ Menu_ShowItem(hEMailMenuItem, bEnabled);
+ if (dbv.pszVal) db_free(&dbv);
return 0;
}