mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Switch some modules to newer API
This commit is contained in:
@@ -141,18 +141,18 @@ class CSChat : public CModule {
|
||||
}
|
||||
}
|
||||
|
||||
EModRet OnUserRaw(CString& sLine) override {
|
||||
if (sLine.StartsWith("schat ")) {
|
||||
OnModCommand("chat " + sLine.substr(6));
|
||||
return (HALT);
|
||||
EModRet OnUserRawMessage(CMessage& msg) override {
|
||||
if (!msg.GetCommand().Equals("schat")) return CONTINUE;
|
||||
|
||||
} else if (sLine.Equals("schat")) {
|
||||
const CString sParams = msg.GetParams(0);
|
||||
if (sParams.empty()) {
|
||||
PutModule("SChat User Area ...");
|
||||
OnModCommand("help");
|
||||
return (HALT);
|
||||
} else {
|
||||
OnModCommand("chat " + sParams);
|
||||
}
|
||||
|
||||
return (CONTINUE);
|
||||
return HALT;
|
||||
}
|
||||
|
||||
void OnModCommand(const CString& sCommand) override {
|
||||
|
||||
@@ -170,16 +170,11 @@ class CSimpleAway : public CModule {
|
||||
}
|
||||
}
|
||||
|
||||
EModRet OnUserRaw(CString& sLine) override {
|
||||
if (!sLine.Token(0).Equals("AWAY")) return CONTINUE;
|
||||
EModRet OnUserRawMessage(CMessage& msg) override {
|
||||
if (!msg.GetCommand().Equals("AWAY")) return CONTINUE;
|
||||
|
||||
// If a client set us away, we don't touch that away message
|
||||
const CString sArg = sLine.Token(1, true).Trim_n(" ");
|
||||
if (sArg.empty() || sArg == ":")
|
||||
m_bClientSetAway = false;
|
||||
else
|
||||
m_bClientSetAway = true;
|
||||
|
||||
m_bClientSetAway = !msg.GetParam(0).Trim_n(" ").empty();
|
||||
m_bWeSetAway = false;
|
||||
|
||||
return CONTINUE;
|
||||
|
||||
@@ -194,17 +194,15 @@ class CStickyChan : public CModule {
|
||||
return false;
|
||||
}
|
||||
|
||||
EModRet OnRaw(CString& sLine) override {
|
||||
CString sNumeric = sLine.Token(1);
|
||||
|
||||
if (sNumeric.Equals("479")) {
|
||||
EModRet OnNumericMessage(CNumericMessage& msg) override {
|
||||
if (msg.GetCode() == 479) {
|
||||
// ERR_BADCHANNAME (juped channels or illegal channel name - ircd
|
||||
// hybrid)
|
||||
// prevent the module from getting into an infinite loop of trying
|
||||
// to join it.
|
||||
// :irc.network.net 479 mynick #channel :Illegal channel name
|
||||
|
||||
CString sChannel = sLine.Token(3);
|
||||
const CString sChannel = msg.GetParam(1);
|
||||
for (MCString::iterator it = BeginNV(); it != EndNV(); ++it) {
|
||||
if (sChannel.Equals(it->first)) {
|
||||
PutModule(
|
||||
|
||||
Reference in New Issue
Block a user