diff options
| author | 2019-06-02 15:18:49 +0100 | |
|---|---|---|
| committer | 2019-06-02 15:18:49 +0100 | |
| commit | c44424b5a1c967b37f2171fd95e6916c8fce385d (patch) | |
| tree | 1f5363d8a7e9388fabcd77710e2318deb505fcbc /modules | |
| parent | Hold on to BATCH args, allow event hooks to manipulate batches (diff) | |
| signature | ||
Track last-seen msgid per-channel (add msgid.py)
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/msgid.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/msgid.py b/modules/msgid.py new file mode 100644 index 00000000..7edeed78 --- /dev/null +++ b/modules/msgid.py @@ -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) |
