Request draft/event-playback when available
This commit is contained in:
parent
b5a467552f
commit
fd35acb01b
1 changed files with 12 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue