Track last-seen msgid per-channel (add msgid.py)

This commit is contained in:
jesopo 2019-06-02 15:18:49 +01:00
parent c212d70b68
commit c44424b5a1

13
modules/msgid.py Normal file
View file

@ -0,0 +1,13 @@
from src import ModuleManager, utils
TAG = utils.irc.MessageTag("msgid", "draft/msgid")
class Module(ModuleManager.BaseModule):
@utils.hook("received.message.channel")
#TODO: catch CTCPs
@utils.hook("received.notice.channel")
@utils.hook("received.tagmsg.channel")
def on_channel(self, event):
msgid = TAG.get_value(event["tags"])
if not msgid == None:
event["channel"].set_setting("last-msgid", msgid)