Support draft/delivered
and draft/read
(message_tracking.py)
This commit is contained in:
parent
8d97e51bf3
commit
52387900bc
1 changed files with 17 additions and 0 deletions
17
modules/message_tracking.py
Normal file
17
modules/message_tracking.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
from src import ModuleManager, utils
|
||||
|
||||
MSGID_TAG = "draft/msgid"
|
||||
READ_TAG = "+draft/read"
|
||||
DELIVERED_TAG = "+draft/delivered"
|
||||
|
||||
class Module(ModuleManager.BaseModule):
|
||||
@utils.hook("received.message.private")
|
||||
@utils.hook("received.message.channel")
|
||||
@utils.hook("received.notice.private")
|
||||
@utils.hook("received.notice.channel")
|
||||
def privmsg(self, event):
|
||||
if MSGID_TAG in event["tags"]:
|
||||
target = event.get("channel", event["user"])
|
||||
msgid = event["tags"][MSGID_TAG]
|
||||
tags = {DELIVERED_TAG: msgid, READ_TAG: msgid}
|
||||
server.send_tagmsg(target.name, tags)
|
Loading…
Reference in a new issue