aboutsummaryrefslogtreecommitdiff
path: root/src/IRCBuffer.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-11-27 12:06:57 +0000
committerGravatar jesopo2019-11-27 12:06:57 +0000
commit9972125b24c9917f74cabfafa780617b439acfa0 (patch)
tree59a139885e398bdc04043b695f39c71b4bc5e98e /src/IRCBuffer.py
parentMerge branch 'master' into develop (diff)
signature
remove IRCBuffer.skip_next (not used), pass buffer lines on message events
Diffstat (limited to 'src/IRCBuffer.py')
-rw-r--r--src/IRCBuffer.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/IRCBuffer.py b/src/IRCBuffer.py
index f30b13ca..f1ad0888 100644
--- a/src/IRCBuffer.py
+++ b/src/IRCBuffer.py
@@ -24,20 +24,20 @@ class Buffer(object):
self.server = server
self._lines = collections.deque(maxlen=MAX_LINES
) # type: typing.Deque[BufferLine]
- self._skip_next = False
def _add_message(self, sender: str, message: str, action: bool, tags: dict,
- from_self: bool, method: str):
- if not self._skip_next:
- line = BufferLine(sender, message, action, tags, from_self, method)
- self._lines.appendleft(line)
- self._skip_next = False
+ from_self: bool, method: str) -> BufferLine:
+ line = BufferLine(sender, message, action, tags, from_self, method)
+ self._lines.appendleft(line)
+ return line
def add_message(self, sender: str, message: str, action: bool, tags: dict,
- from_self: bool=False):
- self._add_message(sender, message, action, tags, from_self, "PRIVMSG")
+ from_self: bool=False) -> BufferLine:
+ return self._add_message(sender, message, action, tags, from_self,
+ "PRIVMSG")
def add_notice(self, sender: str, message: str, tags: dict,
from_self: bool=False):
- self._add_message(sender, message, False, tags, from_self, "NOTICE")
+ return self._add_message(sender, message, False, tags, from_self,
+ "NOTICE")
def get(self, index: int=0, **kwargs) -> typing.Optional[BufferLine]:
from_self = kwargs.get("from_self", True)
@@ -83,6 +83,3 @@ class Buffer(object):
if len(found_lines) == max:
break
return found_lines
-
- def skip_next(self):
- self._skip_next = True