浏览代码

limit to hooks with hook_type = NETWORK_JOIN enabled

Grant Limberg 1 年之前
父节点
当前提交
802c9907a1
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      controller/PostgreSQL.cpp

+ 4 - 1
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>();