summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-02-20 19:49:01 +0000
committerSadie Powell <sadie@witchery.services>2025-02-20 19:49:01 +0000
commit0c193f8149a0af210383a1798586075d132e4904 (patch)
tree7b4f2479516ed6e2e88d8f9c25228b39b4088d0c /include
parentfa0f78b937a970049623d11361d106cf2f12cedd (diff)
Store the source address in the identify request.
Diffstat (limited to 'include')
-rw-r--r--include/account.h4
-rw-r--r--include/modules/sasl.h17
2 files changed, 14 insertions, 7 deletions
diff --git a/include/account.h b/include/account.h
index 487a79b00..5c2e52fd2 100644
--- a/include/account.h
+++ b/include/account.h
@@ -196,6 +196,7 @@ class CoreExport IdentifyRequest
Module *owner;
Anope::string account;
Anope::string password;
+ Anope::string address;
std::set<Module *> holds;
bool dispatched = false;
@@ -204,7 +205,7 @@ class CoreExport IdentifyRequest
static std::set<IdentifyRequest *> Requests;
protected:
- IdentifyRequest(Module *o, const Anope::string &acc, const Anope::string &pass);
+ IdentifyRequest(Module *o, const Anope::string &acc, const Anope::string &pass, const Anope::string &ip);
virtual ~IdentifyRequest();
public:
@@ -215,6 +216,7 @@ public:
Module *GetOwner() const { return owner; }
const Anope::string &GetAccount() const { return account; }
const Anope::string &GetPassword() const { return password; }
+ const Anope::string &GetAddress() const { return address; }
/* Holds this request. When a request is held it must be Released later
* for the request to complete. Multiple modules may hold a request at any time,
diff --git a/include/modules/sasl.h b/include/modules/sasl.h
index e5786b524..f088ec1f1 100644
--- a/include/modules/sasl.h
+++ b/include/modules/sasl.h
@@ -81,10 +81,15 @@ namespace SASL
: public ::IdentifyRequest
{
Anope::string uid;
- Anope::string hostname, ip;
+ Anope::string hostname;
public:
- IdentifyRequest(Module *m, const Anope::string &id, const Anope::string &acc, const Anope::string &pass, const Anope::string &h, const Anope::string &i) : ::IdentifyRequest(m, acc, pass), uid(id), hostname(h), ip(i) { }
+ IdentifyRequest(Module *m, const Anope::string &id, const Anope::string &acc, const Anope::string &pass, const Anope::string &h, const Anope::string &i)
+ : ::IdentifyRequest(m, acc, pass, i)
+ , uid(id)
+ , hostname(h)
+ {
+ }
void OnSuccess() override
{
@@ -103,8 +108,8 @@ namespace SASL
if (s)
{
Anope::string user = "A user";
- if (!hostname.empty() && !ip.empty())
- user = hostname + " (" + ip + ")";
+ if (!hostname.empty() && !GetAddress().empty())
+ user = hostname + " (" + GetAddress() + ")";
Log(this->GetOwner(), "sasl", Config->GetClient("NickServ")) << user << " identified to account " << this->GetAccount() << " using SASL";
sasl->Succeed(s, na->nc);
@@ -134,8 +139,8 @@ namespace SASL
accountstatus = "unconfirmed ";
Anope::string user = "A user";
- if (!hostname.empty() && !ip.empty())
- user = hostname + " (" + ip + ")";
+ if (!hostname.empty() && !GetAddress().empty())
+ user = hostname + " (" + GetAddress() + ")";
Log(this->GetOwner(), "sasl", Config->GetClient("NickServ")) << user << " failed to identify for " << accountstatus << "account " << this->GetAccount() << " using SASL";
}