From: Christian Heller Date: Tue, 19 Aug 2025 12:53:49 +0000 (+0200) Subject: Minor refactoring. X-Git-Url: https://plomlompom.com/repos/process_efforts?a=commitdiff_plain;h=a0a178bb105fb62fa7ca3ee956e7a61c08a7e245;p=ircplom Minor refactoring. --- diff --git a/ircplom/client.py b/ircplom/client.py index 9bd1829..05c84e3 100644 --- a/ircplom/client.py +++ b/ircplom/client.py @@ -598,7 +598,6 @@ class Client(ABC, ClientQueueMixin): and ('.' not in msg_tok or set('@!') & set(msg_tok)): break key_nick = 'sender' if not idx else 'nickname' - key_nick_me = f'{key_nick}_me' if ex_tok is _MsgTok.CHANNEL: if msg_tok[0] != '#': break @@ -608,10 +607,6 @@ class Client(ABC, ClientQueueMixin): if msg_tok[0] in '~&@%+# ': break to_return[key_nick] = msg_tok - if ex_tok is _MsgTok.NICKNAME_ME: - if msg_tok != self._db.nickname: - break - to_return[key_nick_me] = to_return[key_nick] elif ex_tok in {_MsgTok.USER_ADDRESS, _MsgTok.USER_ADDRESS_ME}: toks = msg_tok.split('!') if len(toks) != 2: @@ -620,12 +615,12 @@ class Client(ABC, ClientQueueMixin): if len(toks) != 3: break to_return[key_nick] = toks[0] - if ex_tok is _MsgTok.USER_ADDRESS_ME: - if not self._db.nickname == toks[0]: - break - to_return[key_nick_me] = to_return[key_nick] - elif ex_tok is _MsgTok.ANY: +: elif ex_tok is _MsgTok.ANY: to_return['any'] = msg_tok + if ex_tok in {_MsgTok.NICKNAME_ME, _MsTok.USER_ADDRESS_ME}: + if to_return[key_nick] != self._db.nickname: + break + to_return[f'{key_nick}_me'] = to_return[key_nick] passing = True if passing: return to_return