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:
+4
-2
@@ -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
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user