Start implementing email command
This commit is contained in:
parent
152bc08970
commit
0777a55264
|
@ -8,11 +8,23 @@ class EmailCommand:
|
||||||
def email(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
def email(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
||||||
if authed:
|
if authed:
|
||||||
if length == 4:
|
if length == 4:
|
||||||
if spl[1] == "add":
|
|
||||||
if not spl[2].isdigit():
|
if not spl[2].isdigit():
|
||||||
failure("Must be a number, not %s" % spl[2])
|
# failure("Must be a number, not %s" % spl[2])
|
||||||
|
if spl[2] == "domain":
|
||||||
|
domain = spl[3]
|
||||||
|
if "@" in domain:
|
||||||
|
failure("Not a domain: %s" % domain)
|
||||||
return
|
return
|
||||||
|
if not domain in main.irc["_"]["domains"]:
|
||||||
|
main.irc["_"]["domains"].append(domain)
|
||||||
|
success("Successfully added domain %s to default config" % domain)
|
||||||
|
else:
|
||||||
|
failure("Domain already exists in default config: %s" % domain)
|
||||||
|
return
|
||||||
|
|
||||||
|
else:
|
||||||
num = int(spl[2])
|
num = int(spl[2])
|
||||||
|
if spl[1] == "add":
|
||||||
if not num in main.alias.keys():
|
if not num in main.alias.keys():
|
||||||
failure("No such alias: %i" % num)
|
failure("No such alias: %i" % num)
|
||||||
return
|
return
|
||||||
|
@ -25,10 +37,6 @@ class EmailCommand:
|
||||||
failure("Email already exists in alias %i: %s" % (num, spl[3]))
|
failure("Email already exists in alias %i: %s" % (num, spl[3]))
|
||||||
return
|
return
|
||||||
elif spl[1] == "del":
|
elif spl[1] == "del":
|
||||||
if not spl[2].isdigit():
|
|
||||||
failure("Must be a number, not %s" % spl[2])
|
|
||||||
return
|
|
||||||
num = int(spl[2])
|
|
||||||
if not num in main.alias.keys():
|
if not num in main.alias.keys():
|
||||||
failure("No such alias: %i" % num)
|
failure("No such alias: %i" % num)
|
||||||
return
|
return
|
||||||
|
|
|
@ -33,5 +33,6 @@
|
||||||
"pending": "pending [<network>]",
|
"pending": "pending [<network>]",
|
||||||
"authcheck": "authcheck [<network>]",
|
"authcheck": "authcheck [<network>]",
|
||||||
"recheckauth": "recheckauth [<network>]",
|
"recheckauth": "recheckauth [<network>]",
|
||||||
"blacklist": "blacklist <network> <channel>"
|
"blacklist": "blacklist <network> <channel>",
|
||||||
|
"email": "email <add|del|list> [(domain)|<num>] [<email>]"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue