Track last-seen msgid per-channel (add msgid.py)
This commit is contained in:
parent
c212d70b68
commit
c44424b5a1
1 changed files with 13 additions and 0 deletions
13
modules/msgid.py
Normal file
13
modules/msgid.py
Normal 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)
|
Loading…
Reference in a new issue