tried to fix the op issue, and added control command to sparrowmodule
This commit is contained in:
parent
12da0a08f7
commit
5d4ee3c6f6
@ -8,7 +8,7 @@ SUBDIRS = ircbot \
|
||||
app.depends = ircbot
|
||||
|
||||
#copy res
|
||||
copydata.commands = $(COPY_DIR) $$PWD/res $$OUT_PWD
|
||||
copydata.commands = $(COPY_DIR) $$relative_path($$PWD/res) $$relative_path($$OUT_PWD)
|
||||
first.depends = $(first) copydata
|
||||
export(first.depends)
|
||||
export(copydata.commands)
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "sparrowmodule.h"
|
||||
#include "message.h"
|
||||
#include "basemodule.h"
|
||||
|
||||
SparrowModule::SparrowModule()
|
||||
{
|
||||
@ -15,6 +16,16 @@ bool SparrowModule::messageHandler(Message msg)
|
||||
answer = say("Bienvenue sur #epicsparrow "+msg.nick+"!");
|
||||
return true;
|
||||
}
|
||||
else if(msg.command.compare("PRIVMSG"))
|
||||
{
|
||||
User* user = getUsers()->getFromNick(msg.nick);
|
||||
if(msg.args.startsWith("!control ") && user->isOp())
|
||||
{
|
||||
QString command = msg.args.remove(0, 9);
|
||||
answer = command + "\r\n";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -180,7 +180,7 @@ bool BaseModule::onChanHandler(Message msg)
|
||||
QStringList chanList = msg.args.split(' ');
|
||||
for(QString s : chanList)
|
||||
{
|
||||
if(s.endsWith(getChan()))
|
||||
if(s.contains(getChan()))
|
||||
{
|
||||
u->setOp(s.startsWith('@'));
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user