From 4d9625d1c9f114e78a570457840479e8ae78f3ab Mon Sep 17 00:00:00 2001 From: swee Date: Wed, 29 Jan 2025 21:08:04 -0800 Subject: [PATCH] Update modules/cfd1.py --- modules/cfd1.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/cfd1.py b/modules/cfd1.py index 2c5625f..804429a 100644 --- a/modules/cfd1.py +++ b/modules/cfd1.py @@ -29,6 +29,9 @@ class broker: temp.append(v) return temp def nickserv_identify(self, nick, password:str): + f = self.cfexec("SELECT * FROM groups WHERE name=?;", [nick]) + if len(f) != 0: + nick = f[0]["owner"] e = self.cfexec("SELECT * FROM nickserv WHERE user=?;", [nick]) if len(e) == 0: return False @@ -43,4 +46,10 @@ class broker: e = self.cfexec("INSERT INTO nickserv values(?, 'iw', ?, ?);", [nick, hashed, email]) def nickserv_isexist(self, nick): e = self.cfexec("SELECT * FROM nickserv WHERE user=?;", [nick]) - return len(e) != 0 \ No newline at end of file + f = self.cfexec("SELECT * FROM groups WHERE name=?;", [nick]) + return len(e) != 0 or len(f) != 0 + def nickserv_group(self, nick, account): + self.cfexec("INSERT INTO groups VALUES (?, ?);", [nick.lower(), account.lower()]) + def nickserv_drop(self, account): + self.cfexec("DELETE FROM nickserv WHERE user=?;", [account.lower()]) + self.cfexec("DELETE FROM groups WHERE owner=?;", [account.lower()]) \ No newline at end of file