From 802c9907a1b41e19bc1e6ea1e05507e40ece72c5 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Tue, 8 Aug 2023 13:14:55 -0700 Subject: [PATCH] limit to hooks with hook_type = NETWORK_JOIN enabled --- controller/PostgreSQL.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp index 3b343497d..05b900395 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();