2020-01-17 14:20:42 +00:00
|
|
|
from src import ModuleManager, utils
|
|
|
|
|
2020-01-17 14:45:33 +00:00
|
|
|
CAP = utils.irc.Capability(None, "draft/edit", alias="edit")
|
2020-01-17 14:20:42 +00:00
|
|
|
DELETE_TAG = utils.irc.MessageTag(None, "draft/delete")
|
|
|
|
|
2020-01-17 14:45:33 +00:00
|
|
|
@utils.export("cap", CAP)
|
2020-01-17 14:20:42 +00:00
|
|
|
class Module(ModuleManager.BaseModule):
|
|
|
|
@utils.hook("received.tagmsg.private")
|
|
|
|
@utils.hook("received.tagmsg.channel")
|
|
|
|
def tagmsg(self, event):
|
|
|
|
msgid = DELETE_TAG.get_value(event["line"].tags)
|
|
|
|
if msgid:
|
|
|
|
line = event["target"].buffer.find_id(msgid)
|
|
|
|
if line:
|
|
|
|
line.deleted = True
|