diff options
| author | Adam <Adam@anope.org> | 2011-04-22 03:16:11 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-05-16 04:06:17 -0400 |
| commit | c8c23158a4ff74822d6c7d201dc53d879e3d91e8 (patch) | |
| tree | 4bc9ae029691d5e7c03ebc1481683a010b733844 /modules/core/memoserv.h | |
| parent | 1782ce260c5bc214ec0b2e39257ab1371b68ae9c (diff) | |
Moved the core pseudo clients out into their own modules
Diffstat (limited to 'modules/core/memoserv.h')
| -rw-r--r-- | modules/core/memoserv.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/modules/core/memoserv.h b/modules/core/memoserv.h new file mode 100644 index 000000000..3252a2a2b --- /dev/null +++ b/modules/core/memoserv.h @@ -0,0 +1,44 @@ +#ifndef MEMOSERV_H +#define MEMOSERV_H + +class MemoServService : public Service +{ + public: + enum MemoResult + { + MEMO_SUCCESS, + MEMO_INVALID_TARGET, + MEMO_TOO_FAST, + MEMO_TARGET_FULL + }; + + MemoServService(Module *m) : Service(m, "MemoServ") { } + + virtual BotInfo *Bot() = 0; + + /** Retrieve the memo info for a nick or channel + * @param target Target + * @param ischan Set to true if target is a channel + * @param isforbid Set to true if the target is forbidden + * @return A memoinfo structure or NULL + */ + virtual MemoInfo *GetMemoInfo(const Anope::string &target, bool &ischan, bool &isforbid) = 0; + + /** Sends a memo. + * @param source The source of the memo, can be anythin. + * @param target The target of the memo, nick or channel. + * @param message Memo text + * @param force true to force the memo, restrictions/delays etc are not checked + */ + virtual MemoResult Send(const Anope::string &source, const Anope::string &target, const Anope::string &message, bool force = false) = 0; + + /** Check for new memos and notify the user if there are any + * @param u The user + */ + virtual void Check(User *u) = 0; +}; + +static service_reference<MemoServService> memoserv("MemoServ"); + +#endif // MEMOSERV_H + |
