'API for fields shared directly in name and type with TUI.'
connection_state: str = ''
isupport: Dict[str]
+ motd: Iterable[str]
sasl_account: str = ''
sasl_auth_state: str = ''
return f'{self.nick}!{self.user}@{self.host}'
+class User(NickUserHost):
+ 'Adds to NickUserHost non-naming-specific attributes.'
+ modes: str = '?'
+ exit_msg: str = ''
+
+
@dataclass
class ServerCapability:
'Public API for CAP data.'
who: Optional[NickUserHost] = None
+class Channel:
+ 'Collects .topic, and in .user_ids inhabitant IDs.'
+ topic: Topic
+ user_ids: Iterable[str]
+
+
class LogScope(Enum):
'Where log messages should go.'
ALL = auto()
NickUserHost(copy.nick, copy.user, copy.host))
-class _Channel:
+class _Channel(Channel):
user_ids: _CompletableStringsSet
topic: _CompletableTopic
return name + str(0 if not digits else (int(digits) + 1))
-class _User(_SetNickuserhostMixin, NickUserHost):
- modes: str = '?'
- exit_msg: str = ''
+class _User(_SetNickuserhostMixin, User):
def __init__(self,
names_channels_of_user: Callable,
from ircplom.tui_base import (BaseTui, PromptWidget, TuiEvent, Window,
CMD_SHORTCUTS)
from ircplom.client import (
- AutoAttrMixin, Client, ClientQueueMixin, Dict, DictItem,
+ AutoAttrMixin, Channel, Client, ClientQueueMixin, Dict, DictItem,
IntoEndnodeUpdatesMixin, IrcConnSetup, LogScope, NewClientEvent,
- NickUserHost, ServerCapability, SharedClientDbFields, Topic)
+ NickUserHost, ServerCapability, SharedClientDbFields, User)
CMD_SHORTCUTS['disconnect'] = 'window.disconnect'
CMD_SHORTCUTS['join'] = 'window.join'
pass
-class _UpdatingChannel(_UpdatingNode):
- user_ids: set[str]
- topic: Topic
+class _UpdatingChannel(_UpdatingNode, Channel):
log_scopes = {'': LogScope.CHAT}
+ user_ids: set[str]
def _focused_set_and_report_change(
self, old_value: '_UpdatingNode', update: _Update
return None
-class _UpdatingUser(_UpdatingNode, NickUserHost):
+class _UpdatingUser(_UpdatingNode, User):
log_scopes = {'nick': LogScope.USER, 'exit_msg': LogScope.USER}
prev_nick = '?'
- modes = '?'
- exit_msg = ''
def _focused_set_and_report_change(
self, old_value: '_UpdatingNode', update: _Update