diff options
| author | 2019-06-03 12:44:04 +0100 | |
|---|---|---|
| committer | 2019-06-03 12:44:04 +0100 | |
| commit | 9a8b345c53e852d7092197cee084d0d3c02bc0ff (patch) | |
| tree | 408c6833c2f4de7198c354043c8ca265c0616901 /modules/chathistory.py | |
| parent | Check from_self, not if target==is_own_nickname, use from_self when adding to (diff) | |
Prefix names for all IRCv3 modules with "ircv3_"
Diffstat (limited to 'modules/chathistory.py')
| -rw-r--r-- | modules/chathistory.py | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/modules/chathistory.py b/modules/chathistory.py deleted file mode 100644 index 1f1711b1..00000000 --- a/modules/chathistory.py +++ /dev/null @@ -1,29 +0,0 @@ -#--depends-on msgid - -from src import ModuleManager, utils - -TAG = utils.irc.MessageTag("msgid", "draft/msgid") - -class Module(ModuleManager.BaseModule): - @utils.hook("received.batch.end") - def batch_end(self, event): - if event["batch"].type == "chathistory": - target_name = event["batch"].args[0] - if target_name in event["server"].channels: - target = event["server"].channels.get(target_name) - else: - target = event["server"].get_user(target_name) - - last_msgid = target.get_setting("last-msgid", None) - if not last_msgid == None: - lines = event["batch"].get_lines() - stop_index = -1 - - for i, line in enumerate(lines): - msgid = TAG.get_value(line.tags) - if msgid == last_msgid: - stop_index = i - break - - if not stop_index == -1: - return lines[stop_index+1:] |
