In module events: we can remove both events and strends

This commit is contained in:
Némunaire 2012-06-23 13:36:08 +02:00
parent d9eab146e6
commit 7f181864b7

View File

@ -133,7 +133,8 @@ def parseanswer(msg):
msg.send_snd ("%s existe déjà."% (msg.cmd[1])) msg.send_snd ("%s existe déjà."% (msg.cmd[1]))
return True return True
elif (msg.cmd[0] == "end" or msg.cmd[0] == "forceend") and len(msg.cmd) > 1: elif (msg.cmd[0] == "end" or msg.cmd[0] == "forceend") and len(msg.cmd) > 1:
if msg.cmd[1] in DATAS.index and DATAS.index[msg.cmd[1]].hasAttribute("end"): if msg.cmd[1] in DATAS.index:
if DATAS.index[msg.cmd[1]].hasAttribute("end"):
msg.send_chn ("%s a duré %s." % (msg.cmd[1], msg.just_countdown(datetime.now () - DATAS.index[msg.cmd[1]].getDate("start")))) msg.send_chn ("%s a duré %s." % (msg.cmd[1], msg.just_countdown(datetime.now () - DATAS.index[msg.cmd[1]].getDate("start"))))
if DATAS.index[msg.cmd[1]]["proprio"] == msg.sender or (msg.cmd[0] == "forceend" and msg.sender == msg.srv.owner): if DATAS.index[msg.cmd[1]]["proprio"] == msg.sender or (msg.cmd[0] == "forceend" and msg.sender == msg.srv.owner):
DATAS.delChild(DATAS.index[msg.cmd[1]]) DATAS.delChild(DATAS.index[msg.cmd[1]])