diff options
| author | Grant Limberg <[email protected]> | 2023-08-08 13:14:55 -0700 |
|---|---|---|
| committer | Grant Limberg <[email protected]> | 2023-08-08 13:14:55 -0700 |
| commit | 802c9907a1b41e19bc1e6ea1e05507e40ece72c5 (patch) | |
| tree | a16f0b5880b774c956e6dcbe51d953d9630202e3 /controller/PostgreSQL.cpp | |
| parent | 88b96265d7393684e7d285e023fc848d780907cf (diff) | |
limit to hooks with hook_type = NETWORK_JOIN enabled
Diffstat (limited to 'controller/PostgreSQL.cpp')
| -rw-r--r-- | controller/PostgreSQL.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp index 3b343497..05b90039 100644 --- a/controller/PostgreSQL.cpp +++ b/controller/PostgreSQL.cpp @@ -1689,13 +1689,16 @@ void PostgreSQL::notifyNewMember(const std::string &networkID, const std::string auto res = w.exec_params("SELECT h.hook_url " "FROM ztc_hook h " + "INNER JOIN ztc_hook_hook_types ht " + "ON ht.hook_id = h.hook_id " "INNER JOIN ztc_org o " "ON o.org_id = h.org_id " "INNER JOIN ztc_user u " "ON u.id = o.owner_id " "INNER JOIN ztc_network n " "ON n.owner_id = u.id " - "WHERE n.id = $1", networkID); + "WHERE n.id = $1 " + "AND ht.hook_type = 'NETWORK_JOIN'", networkID); for (auto const &row: res) { std::string hookURL = row[0].as<std::string>(); |
