summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_check.cpp6
-rw-r--r--src/modules/m_hideoper.cpp6
-rw-r--r--src/modules/m_operprefix.cpp18
3 files changed, 26 insertions, 4 deletions
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp
index 96b357f20..9c5c414f1 100644
--- a/src/modules/m_check.cpp
+++ b/src/modules/m_check.cpp
@@ -38,8 +38,10 @@ class CommandCheck : public Command
{
char timebuf[60];
struct tm *mytime = gmtime(&time);
- strftime(timebuf, 59, "%Y-%m-%d %H:%M:%S UTC (%s)", mytime);
- return std::string(timebuf);
+ strftime(timebuf, 59, "%Y-%m-%d %H:%M:%S UTC (", mytime);
+ std::string ret(timebuf);
+ ret.append(ConvToStr(time)).push_back(')');
+ return ret;
}
void dumpExt(User* user, const std::string& checkstr, Extensible* ext)
diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp
index b83c7de1a..88b0c4cdf 100644
--- a/src/modules/m_hideoper.cpp
+++ b/src/modules/m_hideoper.cpp
@@ -82,7 +82,11 @@ class ModuleHideOper : public Module
if (user->IsModeSet('H') && !source->HasPrivPermission("users/auspex"))
{
// hide the "*" that marks the user as an oper from the /WHO line
- std::string::size_type pos = line.find("*");
+ std::string::size_type spcolon = line.find(" :");
+ if (spcolon == std::string::npos)
+ return; // Another module hid the user completely
+ std::string::size_type sp = line.rfind(' ', spcolon-1);
+ std::string::size_type pos = line.find('*', sp);
if (pos != std::string::npos)
line.erase(pos, 1);
// hide the line completely if doing a "/who * o" query
diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp
index 62ddb6c67..9f1f6cc5e 100644
--- a/src/modules/m_operprefix.cpp
+++ b/src/modules/m_operprefix.cpp
@@ -85,7 +85,7 @@ class ModuleOperPrefixMode : public Module
{
ServerInstance->Modules->AddService(opm);
- Implementation eventlist[] = { I_OnUserPreJoin, I_OnPostOper, I_OnLoadModule, I_OnUnloadModule };
+ Implementation eventlist[] = { I_OnUserPreJoin, I_OnPostOper, I_OnLoadModule, I_OnUnloadModule, I_OnPostJoin };
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
/* To give clients a chance to learn about the new prefix we don't give +y to opers
@@ -110,6 +110,22 @@ class ModuleOperPrefixMode : public Module
return MOD_RES_PASSTHRU;
}
+ void OnPostJoin(Membership* memb)
+ {
+ if ((!IS_LOCAL(memb->user)) || (!IS_OPER(memb->user)) || (((mw_added) && (memb->user->IsModeSet('H')))))
+ return;
+
+ if (memb->hasMode(opm.GetModeChar()))
+ return;
+
+ // The user was force joined and OnUserPreJoin() did not run. Set the operprefix now.
+ std::vector<std::string> modechange;
+ modechange.push_back(memb->chan->name);
+ modechange.push_back("+y");
+ modechange.push_back(memb->user->nick);
+ ServerInstance->SendGlobalMode(modechange, ServerInstance->FakeClient);
+ }
+
void SetOperPrefix(User* user, bool add)
{
std::vector<std::string> modechange;