diff options
| author | Adam <Adam@anope.org> | 2011-09-03 01:10:12 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-09-10 02:06:29 -0400 |
| commit | 1478b5bbd7ecc99c3ceefc0396845ebb0608d331 (patch) | |
| tree | 24783150322c7774643e22f4b3074764dab0736e /include | |
| parent | 19e0b87aa1f41c3aabf6afc87ecdc8517dd47af0 (diff) | |
Added chanserv/log
Diffstat (limited to 'include')
| -rw-r--r-- | include/logger.h | 7 | ||||
| -rw-r--r-- | include/modules.h | 7 | ||||
| -rw-r--r-- | include/regchannel.h | 14 | ||||
| -rw-r--r-- | include/services.h | 2 |
4 files changed, 27 insertions, 3 deletions
diff --git a/include/logger.h b/include/logger.h index 423e096d3..5f611b277 100644 --- a/include/logger.h +++ b/include/logger.h @@ -35,6 +35,11 @@ class CoreExport Log { public: BotInfo *bi; + User *u; + Command *c; + Channel *chan; + ChannelInfo *ci; + Server *s; LogType Type; Anope::string Category; std::list<Anope::string> Sources; @@ -59,6 +64,8 @@ class CoreExport Log ~Log(); + Anope::string BuildPrefix() const; + template<typename T> Log &operator<<(T val) { this->buf << val; diff --git a/include/modules.h b/include/modules.h index 600b3ce8c..5d2e7247f 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1019,6 +1019,11 @@ class CoreExport Module : public Extensible * @param msg The message */ virtual void OnPrivmsg(User *u, Channel *c, Anope::string &msg) { } + + /** Called when a message is logged + * @param l The log message + */ + virtual void OnLog(Log *l) { } }; /** Implementation-specific flags which may be set in ModuleManager::Attach() @@ -1072,7 +1077,7 @@ enum Implementation I_OnServerQuit, I_OnTopicUpdated, I_OnEncrypt, I_OnDecrypt, I_OnChannelModeSet, I_OnChannelModeUnset, I_OnUserModeSet, I_OnUserModeUnset, I_OnChannelModeAdd, I_OnUserModeAdd, - I_OnMLock, I_OnUnMLock, I_OnServerSync, I_OnUplinkSync, I_OnBotPrivmsg, I_OnPrivmsg, + I_OnMLock, I_OnUnMLock, I_OnServerSync, I_OnUplinkSync, I_OnBotPrivmsg, I_OnPrivmsg, I_OnLog, I_END }; diff --git a/include/regchannel.h b/include/regchannel.h index 1d071fb0f..017b93afe 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -96,6 +96,19 @@ struct ModeLock ModeLock(bool s, ChannelModeName n, const Anope::string &p, const Anope::string &se = "", time_t c = Anope::CurTime) : set(s), name(n), param(p), setter(se), created(c) { } }; +struct LogSetting +{ + /* Our service name of the command */ + Anope::string service_name; + /* The name of the client the command is on */ + Anope::string command_service; + /* Name of the command to the user, can have spaces */ + Anope::string command_name; + Anope::string method, extra; + Anope::string creator; + time_t created; +}; + class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag, CI_END> { private: @@ -108,6 +121,7 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag, public: typedef std::multimap<ChannelModeName, ModeLock> ModeList; ModeList mode_locks; + std::vector<LogSetting> log_settings; /** Default constructor * @param chname The channel name diff --git a/include/services.h b/include/services.h index 84776d064..9ed5e2ba3 100644 --- a/include/services.h +++ b/include/services.h @@ -805,7 +805,6 @@ class CoreExport IRCDProto virtual void SendModeInternal(const BotInfo *, const Channel *, const Anope::string &) = 0; virtual void SendModeInternal(const BotInfo *, const User *, const Anope::string &) = 0; virtual void SendKickInternal(const BotInfo *, const Channel *, const User *, const Anope::string &) = 0; - virtual void SendNoticeChanopsInternal(const BotInfo *bi, const Channel *, const Anope::string &) = 0; virtual void SendMessageInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &buf); virtual void SendNoticeInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &msg); virtual void SendPrivmsgInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &buf); @@ -827,7 +826,6 @@ class CoreExport IRCDProto virtual void SendMode(const BotInfo *bi, const User *u, const char *fmt, ...); virtual void SendClientIntroduction(const User *u) = 0; virtual void SendKick(const BotInfo *bi, const Channel *chan, const User *user, const char *fmt, ...); - virtual void SendNoticeChanops(const BotInfo *bi, const Channel *dest, const char *fmt, ...); virtual void SendMessage(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...); virtual void SendNotice(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...); virtual void SendAction(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...); |
