diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/extern.h | 9 | ||||
| -rw-r--r-- | include/mail.h | 24 | ||||
| -rw-r--r-- | include/services.h | 1 | ||||
| -rw-r--r-- | include/threadengine.h | 9 |
4 files changed, 30 insertions, 13 deletions
diff --git a/include/extern.h b/include/extern.h index 7998b7c74..ed3323c3b 100644 --- a/include/extern.h +++ b/include/extern.h @@ -211,15 +211,6 @@ E void log_perror(const char *fmt, ...) FORMAT(printf,1,2); E void fatal(const char *fmt, ...) FORMAT(printf,1,2); E void fatal_perror(const char *fmt, ...) FORMAT(printf,1,2); -/**** mail.c ****/ - -E MailInfo *MailBegin(User *u, NickCore *nc, char *subject, char *service); -E MailInfo *MailRegBegin(User *u, NickRequest *nr, char *subject, char *service); -E MailInfo *MailMemoBegin(NickCore * nc); -E void MailEnd(MailInfo *mail); -E void MailReset(User *u, NickCore *nc); -E int MailValidate(const char *email); - /**** main.c ****/ E const char version_number[]; diff --git a/include/mail.h b/include/mail.h new file mode 100644 index 000000000..d64e36f30 --- /dev/null +++ b/include/mail.h @@ -0,0 +1,24 @@ + +extern CoreExport bool Mail(User *u, NickRequest *nr, const std::string &service, const std::string &subject, const std::string &message); +extern CoreExport bool Mail(User *u, NickCore *nc, const std::string &service, const std::string &subject, const std::string &message); +extern CoreExport bool Mail(NickCore *nc, const std::string &subject, const std::string &message); +extern CoreExport bool MailValidate(const std::string &email); + +class MailThread : public Thread +{ + private: + const std::string MailTo; + const std::string Addr; + const std::string Subject; + const std::string Message; + + bool Success; + public: + MailThread(const std::string &mailto, const std::string &addr, const std::string &subject, const std::string &message) : Thread(), MailTo(mailto), Addr(addr), Subject(subject), Message(message), Success(false) + { + } + + ~MailThread(); + + void Run(); +}; diff --git a/include/services.h b/include/services.h index 9b660f3a2..a26802983 100644 --- a/include/services.h +++ b/include/services.h @@ -901,6 +901,7 @@ struct Uplink; class ServerConfig; #include "extern.h" +#include "mail.h" #include "servers.h" #include "config.h" diff --git a/include/threadengine.h b/include/threadengine.h index e2125c6bd..ab668ea50 100644 --- a/include/threadengine.h +++ b/include/threadengine.h @@ -36,10 +36,7 @@ class Thread : public Extensible private: /* Set to true to tell the thread to finish and we are waiting for it */ bool Exit; - - /** Join to the thread, sets the exit state to true - */ - void Join(); + public: /* Handle for this thread */ ThreadHandle Handle; @@ -52,6 +49,10 @@ class Thread : public Extensible */ virtual ~Thread(); + /** Join to the thread, sets the exit state to true + */ + void Join(); + /** Sets the exit state as true informing the thread we want it to shut down */ void SetExitState(); |
