Add find_from
to IRCBuffer.Buffer, to find the most recent line from a given
user (src/IRCBuffer.py)
This commit is contained in:
parent
8dcd6b2937
commit
e1e4fbf9bc
1 changed files with 8 additions and 0 deletions
|
@ -58,5 +58,13 @@ class Buffer(object):
|
||||||
continue
|
continue
|
||||||
return line
|
return line
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def find_from(self, nickname: str) -> typing.Optional[BufferLine]:
|
||||||
|
nickname_lower = self.server.irc_lower(nickname)
|
||||||
|
for line in self.lines:
|
||||||
|
if self.server.irc_lower(line.sender) == nickname_lower:
|
||||||
|
return line
|
||||||
|
return None
|
||||||
|
|
||||||
def skip_next(self):
|
def skip_next(self):
|
||||||
self._skip_next = True
|
self._skip_next = True
|
||||||
|
|
Loading…
Reference in a new issue