1
0
mirror of https://github.com/anope/anope.git synced 2026-07-03 05:53:12 +02:00

Fixed the mlock events to be useful and fixed /cs access view's last used time

This commit is contained in:
Adam
2010-11-17 19:59:23 -05:00
parent 4f8dfc2132
commit 27652144ec
3 changed files with 7 additions and 5 deletions
+4 -2
View File
@@ -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 &param) { return EVENT_CONTINUE; }
virtual EventReturn OnMLock(ChannelInfo *ci, ChannelModeName Name, bool status, const Anope::string &param) { 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
+1 -1
View File
@@ -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";
+2 -2
View File
@@ -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;