) -> Optional[tuple[LogScope, Any]]:
scope = self._scope(update.key)
if update.value is None:
- if not self._is_set(update.key):
- return None
- self._unset(update.key)
- return (scope, None)
+ if self._is_set(update.key):
+ self._unset(update.key)
+ return scope, None
+ return None
if old_value == update.value:
return None
self._set(update.key, update.value)
- return (scope, update.value)
+ return scope, update.value
def _get(self, key: str):
return getattr(self, key)
self, old_value: '_UpdatingNode', update: _Update
) -> Optional[tuple[LogScope, Any]]:
assert isinstance(update.value, str)
- if update.key == 'modes':
- return super()._focused_set_and_report_change(old_value, update)
- if super()._focused_set_and_report_change(old_value, update):
+ if (result := super()._focused_set_and_report_change(old_value,
+ update)):
+ if update.key not in {'nick', 'exit_msg'}:
+ return result
scope = self._scope(update.key)
msg = 'RAW:'
if update.key == 'nick':