|
|
|
@ -324,6 +324,20 @@ struct IRCBasePriv |
|
|
|
|
sock->write_some(asio::buffer(out)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ctcp(const std::string& messageType, const std::string& target, const std::string& command, const std::string& message = "") |
|
|
|
|
{ |
|
|
|
|
if (!isConnected) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
std::string ctcpdata; |
|
|
|
|
ctcpdata.push_back(CTCPflag); |
|
|
|
|
ctcpdata.append(command); |
|
|
|
|
if (!message.empty()) |
|
|
|
|
ctcpdata.append(" " + message); |
|
|
|
|
ctcpdata.push_back(CTCPflag); |
|
|
|
|
write(messageType, { target }, ctcpdata); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void addMemberToChannel(const IRCPrefix& prefix, const std::string& channel) |
|
|
|
|
{ |
|
|
|
|
auto member = super.getMember(prefix.nickname()); |
|
|
|
@ -468,7 +482,7 @@ struct IRCBasePriv |
|
|
|
|
return IRCError::NoError; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void parseChannelModeMessage(std::shared_ptr<IRCChannel> chan, const std::string& modes, const std::vector<std::string>& args) |
|
|
|
|
void parseChannelModeMessage(std::shared_ptr<IRCChannel> chan, const std::string& modes, const std::vector<std::string>& args) const |
|
|
|
|
{ |
|
|
|
|
char sign; // + or -
|
|
|
|
|
int argidx = 0; |
|
|
|
@ -681,18 +695,14 @@ void IRCBase::raw(const std::string& data) |
|
|
|
|
mp->writeNoMsg(data, {}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void IRCBase::ctcp(const std::string& target, const std::string& command, const std::string& message) |
|
|
|
|
void IRCBase::ctcpRequest(const std::string& target, const std::string& command, const std::string& message) |
|
|
|
|
{ |
|
|
|
|
if (!mp->isConnected) |
|
|
|
|
return; |
|
|
|
|
mp->ctcp(Command::IRC::PRIVMSG, target, command, message); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::string ctcpdata; |
|
|
|
|
ctcpdata.push_back(CTCPflag); |
|
|
|
|
ctcpdata.append(command); |
|
|
|
|
if (!message.empty()) |
|
|
|
|
ctcpdata.append(" " + message); |
|
|
|
|
ctcpdata.push_back(CTCPflag); |
|
|
|
|
mp->write(Command::IRC::PRIVMSG, { target }, ctcpdata); |
|
|
|
|
void IRCBase::ctcpResponse(const std::string& target, const std::string& command, const std::string& message) |
|
|
|
|
{ |
|
|
|
|
mp->ctcp(Command::IRC::NOTICE, target, command, message); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void IRCBase::setManualKeepalive(std::chrono::seconds freq) |
|
|
|
|