mirror of
https://github.com/anope/anope.git
synced 2026-07-02 02:46:39 +02:00
Added chanserv/log
This commit is contained in:
@@ -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;
|
||||
|
||||
+6
-1
@@ -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
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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, ...);
|
||||
|
||||
Reference in New Issue
Block a user