mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-02-10 18:05:16 +08:00
small refactoring
This commit is contained in:
@ -34,7 +34,7 @@
|
||||
#include <fstream>
|
||||
#include <ctime>
|
||||
#include <stack>
|
||||
#if defined(_WIN32) && !defined(FORCE_USING_EML)
|
||||
#ifdef WIN32_USING_MAPI
|
||||
# include <Windows.h>
|
||||
# include <shlwapi.h>
|
||||
# include <commctrl.h>
|
||||
@ -52,7 +52,7 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && !defined(FORCE_USING_EML)
|
||||
#ifdef WIN32_USING_MAPI
|
||||
static void regValue(HKEY rootKey, std::wstring &value)
|
||||
{
|
||||
HKEY hKey;
|
||||
@ -221,7 +221,7 @@ public:
|
||||
tmp_files.pop();
|
||||
}
|
||||
}
|
||||
#if defined(_WIN32) && !defined(FORCE_USING_EML)
|
||||
#ifdef WIN32_USING_MAPI
|
||||
bool sendMailMAPI(std::string to, std::string subject, std::string msg)
|
||||
{
|
||||
to.insert(0, "SMTP:");
|
||||
@ -315,7 +315,7 @@ CMailMessage &CMailMessage::instance()
|
||||
return inst;
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && !defined(FORCE_USING_EML)
|
||||
#ifdef WIN32_USING_MAPI
|
||||
int CMailMessage::checkMAPIClient()
|
||||
{
|
||||
if (!isMAPIClientAssigned()) {
|
||||
@ -338,7 +338,7 @@ int CMailMessage::checkMAPIClient()
|
||||
|
||||
bool CMailMessage::sendMail(const std::string &to, const std::string &subject, const std::string &msg)
|
||||
{
|
||||
#if defined(_WIN32) && !defined(FORCE_USING_EML)
|
||||
#ifdef WIN32_USING_MAPI
|
||||
return pimpl->sendMailMAPI(to, subject, msg);
|
||||
#else
|
||||
return pimpl->openEML(to, subject, msg);
|
||||
|
||||
@ -35,6 +35,9 @@
|
||||
|
||||
#include <string>
|
||||
// #define FORCE_USING_EML
|
||||
#if defined(_WIN32) && !defined(FORCE_USING_EML)
|
||||
# define WIN32_USING_MAPI
|
||||
#endif
|
||||
|
||||
class CMailMessage
|
||||
{
|
||||
@ -43,7 +46,7 @@ public:
|
||||
CMailMessage& operator=(const CMailMessage&) = delete;
|
||||
static CMailMessage& instance();
|
||||
|
||||
#if defined(_WIN32) && !defined(FORCE_USING_EML)
|
||||
#ifdef WIN32_USING_MAPI
|
||||
enum MAPIResult {MAPIClientOK, MapiClientCancel, MAPIClientEmpty, MAPIClientError};
|
||||
int checkMAPIClient();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user