aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2019-06-15 00:49:14 +0100
committerGravatar jesopo2019-06-15 00:49:14 +0100
commitfd35acb01b44ce662258dbe24dc3035239b31850 (patch)
tree73815f661efe7cd23a206aa8b5490190fb21127a
parentCRITICAL log exceptions caught in _loop_catch() (diff)
signature
Request draft/event-playback when available
-rw-r--r--modules/ircv3_chathistory.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/ircv3_chathistory.py b/modules/ircv3_chathistory.py
index 1607263c..36609368 100644
--- a/modules/ircv3_chathistory.py
+++ b/modules/ircv3_chathistory.py
@@ -3,11 +3,22 @@
from src import ModuleManager, utils
TAG = utils.irc.MessageTag("msgid", "draft/msgid")
+CHATHISTORY_BATCH = utils.irc.BatchType("chathistory")
+
+EVENTPLAYBACK_CAP = utils.irc.Capability(None, "draft/event-playback")
+HISTORY_BATCH = utils.irc.BatchType("history")
class Module(ModuleManager.BaseModule):
+ @utils.hook("received.cap.ls")
+ @utils.hook("received.cap.new")
+ def on_cap(self, event):
+ if EVENTPLAYBACK_CAP.available(event["capabilities"]):
+ return EVENTPLAYBACK_CAP.copy()
+
@utils.hook("received.batch.end")
def batch_end(self, event):
- if event["batch"].type == "chathistory":
+ if (CHATHISTORY_BATCH.match(event["batch"].type) or
+ HISTORY_BATCH.match(event["batch"].type)):
target_name = event["batch"].args[0]
if target_name in event["server"].channels:
target = event["server"].channels.get(target_name)