diff options
author | Adam <Adam@anope.org> | 2010-11-17 19:59:23 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-11-17 19:59:23 -0500 |
commit | 27652144ec6e30e88cdef3dc39aa2168f3f31cc8 (patch) | |
tree | 4b7c05e520b5ff7c2f9cdfc17441d87909c91933 | |
parent | 4f8dfc2132e2c67bf8047cbba0a78ea22e870d28 (diff) |
Fixed the mlock events to be useful and fixed /cs access view's last used time
-rw-r--r-- | include/modules.h | 6 | ||||
-rw-r--r-- | modules/core/cs_access.cpp | 2 | ||||
-rw-r--r-- | src/regchannel.cpp | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/include/modules.h b/include/modules.h index f39757489..7e7e69194 100644 --- a/include/modules.h +++ b/include/modules.h @@ -991,18 +991,20 @@ class CoreExport Module : public Extensible virtual void OnUserModeAdd(UserMode *um) { } /** Called when a mode is about to be mlocked + * @param ci The channel * @param Name The mode being mlocked * @param status true if its being mlocked +, false for - * @param param The param, if there is one and if status is true * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the mlock. */ - virtual EventReturn OnMLock(ChannelModeName Name, bool status, const Anope::string ¶m) { return EVENT_CONTINUE; } + virtual EventReturn OnMLock(ChannelInfo *ci, ChannelModeName Name, bool status, const Anope::string ¶m) { return EVENT_CONTINUE; } /** Called when a mode is about to be unlocked + * @param ci The channel * @param Name The mode being mlocked * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the mlock. */ - virtual EventReturn OnUnMLock(ChannelModeName Name) { return EVENT_CONTINUE; } + virtual EventReturn OnUnMLock(ChannelInfo *ci, ChannelModeName Name) { return EVENT_CONTINUE; } /** Called after a module is loaded * @param u The user loading the module, can be NULL diff --git a/modules/core/cs_access.cpp b/modules/core/cs_access.cpp index 2b94885a1..9f77baead 100644 --- a/modules/core/cs_access.cpp +++ b/modules/core/cs_access.cpp @@ -82,7 +82,7 @@ class AccessViewCallback : public AccessListCallback static void DoList(User *u, ChannelInfo *ci, unsigned Number, ChanAccess *access) { Anope::string timebuf; - if (ci->c && u->Account() && nc_on_chan(ci->c, u->Account())) + if (ci->c && nc_on_chan(ci->c, access->nc)) timebuf = "Now"; else if (access->last_seen == 0) timebuf = "Never"; diff --git a/src/regchannel.cpp b/src/regchannel.cpp index 053f75d5b..b4cded05b 100644 --- a/src/regchannel.cpp +++ b/src/regchannel.cpp @@ -432,7 +432,7 @@ bool ChannelInfo::SetMLock(ChannelModeName Name, bool status, const Anope::strin throw CoreException("Was told to mlock a mode negatively with a param?"); EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnMLock, OnMLock(Name, status, param)); + FOREACH_RESULT(I_OnMLock, OnMLock(this, Name, status, param)); if (MOD_RESULT == EVENT_STOP) return false; @@ -462,7 +462,7 @@ bool ChannelInfo::SetMLock(ChannelModeName Name, bool status, const Anope::strin bool ChannelInfo::RemoveMLock(ChannelModeName Name) { EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnUnMLock, OnUnMLock(Name)); + FOREACH_RESULT(I_OnUnMLock, OnUnMLock(this, Name)); if (MOD_RESULT == EVENT_STOP) return false; |