summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_cban.cpp9
-rw-r--r--src/modules/m_rline.cpp4
-rw-r--r--src/modules/m_shun.cpp4
-rw-r--r--src/modules/m_spanningtree/netburst.cpp6
-rw-r--r--src/modules/m_svshold.cpp12
-rw-r--r--src/modules/m_xline_db.cpp8
6 files changed, 25 insertions, 18 deletions
diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp
index 044aa45a5..5e629ed42 100644
--- a/src/modules/m_cban.cpp
+++ b/src/modules/m_cban.cpp
@@ -29,12 +29,15 @@
*/
class CBan : public XLine
{
-public:
+private:
+ std::string displaytext;
irc::string matchtext;
+public:
CBan(time_t s_time, long d, std::string src, std::string re, std::string ch)
: XLine(s_time, d, src, re, "CBAN")
{
+ this->displaytext = ch;
this->matchtext = ch.c_str();
}
@@ -51,9 +54,9 @@ public:
return false;
}
- const char* Displayable()
+ const std::string& Displayable()
{
- return matchtext.c_str();
+ return displaytext;
}
};
diff --git a/src/modules/m_rline.cpp b/src/modules/m_rline.cpp
index 161cd4d0f..aa96d4951 100644
--- a/src/modules/m_rline.cpp
+++ b/src/modules/m_rline.cpp
@@ -92,9 +92,9 @@ class RLine : public XLine
DefaultApply(u, "R", false);
}
- const char* Displayable()
+ const std::string& Displayable()
{
- return matchtext.c_str();
+ return matchtext;
}
std::string matchtext;
diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp
index e7dc3086d..6da24208a 100644
--- a/src/modules/m_shun.cpp
+++ b/src/modules/m_shun.cpp
@@ -56,9 +56,9 @@ public:
return false;
}
- const char* Displayable()
+ const std::string& Displayable()
{
- return matchtext.c_str();
+ return matchtext;
}
};
diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp
index c22ad3acb..639a397c6 100644
--- a/src/modules/m_spanningtree/netburst.cpp
+++ b/src/modules/m_spanningtree/netburst.cpp
@@ -120,7 +120,6 @@ void TreeSocket::SendFJoins(Channel* c)
void TreeSocket::SendXLines()
{
char data[MAXBUF];
- const char* sn = ServerInstance->Config->GetSID().c_str();
std::vector<std::string> types = ServerInstance->XLines->GetAllTypes();
@@ -140,7 +139,10 @@ void TreeSocket::SendXLines()
if (!i->second->IsBurstable())
break;
- snprintf(data,MAXBUF,":%s ADDLINE %s %s %s %lu %lu :%s",sn, it->c_str(), i->second->Displayable(),
+ snprintf(data, MAXBUF, ":%s ADDLINE %s %s %s %lu %lu :%s",
+ ServerInstance->Config->GetSID().c_str(),
+ it->c_str(),
+ i->second->Displayable().c_str(),
i->second->source.c_str(),
(unsigned long)i->second->set_time,
(unsigned long)i->second->duration,
diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp
index bd80bb048..d35d5f3ba 100644
--- a/src/modules/m_svshold.cpp
+++ b/src/modules/m_svshold.cpp
@@ -30,12 +30,12 @@
class SVSHold : public XLine
{
public:
- irc::string nickname;
+ std::string nickname;
SVSHold(time_t s_time, long d, std::string src, std::string re, std::string nick)
: XLine(s_time, d, src, re, "SVSHOLD")
{
- this->nickname = nick.c_str();
+ this->nickname = nick;
}
bool Matches(User *u)
@@ -47,14 +47,12 @@ public:
bool Matches(const std::string &s)
{
- if (nickname == s)
- return true;
- return false;
+ return InspIRCd::Match(s, nickname);
}
- const char* Displayable()
+ const std::string& Displayable()
{
- return nickname.c_str();
+ return nickname;
}
};
diff --git a/src/modules/m_xline_db.cpp b/src/modules/m_xline_db.cpp
index 020095f7c..021f2e78d 100644
--- a/src/modules/m_xline_db.cpp
+++ b/src/modules/m_xline_db.cpp
@@ -125,8 +125,12 @@ class ModuleXLineDB : public Module
for (LookupIter i = lookup->begin(); i != lookup->end(); ++i)
{
XLine* line = i->second;
- fprintf(f, "LINE %s %s %s %lu %lu :%s\n", line->type.c_str(), line->Displayable(),
- ServerInstance->Config->ServerName.c_str(), (unsigned long)line->set_time, (unsigned long)line->duration, line->reason.c_str());
+ fprintf(f, "LINE %s %s %s %lu %lu :%s\n",
+ line->type.c_str(),
+ line->Displayable().c_str(),
+ ServerInstance->Config->ServerName.c_str(),
+ (unsigned long)line->set_time,
+ (unsigned long)line->duration, line->reason.c_str());
}
}