home · contact · privacy
Rename methods to show they're merely guards to TUI calls.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 9 Nov 2025 23:47:12 +0000 (00:47 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 9 Nov 2025 23:47:12 +0000 (00:47 +0100)
src/ircplom/client_tui.py

index 90708bbbb8379fa28c29ae7ace0bee72c211321c..908f5307bb3cf5f0ba91aa0e235f3f8b57ca7499 100644 (file)
@@ -89,11 +89,11 @@ class _ClientWindow(Window, ClientQueueMixin):
 
     def cmd__disconnect(self, quit_msg: str = 'ircplom says bye') -> None:
         'Ask to disconnect, or end auto-connect attempts if disconnected.'
-        self._client_trigger('disconnect', quit_msg=quit_msg)
+        self._client_trigger('cmd__disconnect', quit_msg=quit_msg)
 
     def cmd__reconnect(self) -> None:
         'Attempt reconnection.'
-        self._client_trigger('reconnect')
+        self._client_trigger('cmd__reconnect')
 
     def cmd__nick(self, new_nick: str) -> None:
         'Attempt nickname change.'
@@ -101,11 +101,11 @@ class _ClientWindow(Window, ClientQueueMixin):
 
     def cmd__join(self, channel: str) -> None:
         'Attempt joining a channel.'
-        self._client_trigger('join', chan_name=channel)
+        self._client_trigger('cmd__join', chan_name=channel)
 
     def cmd__privmsg(self, target: str, msg: str) -> None:
         'Send chat message msg to target.'
-        self._client_trigger('privmsg', chat_target=target, msg=msg)
+        self._client_trigger('cmd__privmsg', chat_target=target, msg=msg)
 
     def cmd__raw(self, verb: str, params_str: str = '') -> None:
         'Send raw command, with direct input of params string.'
@@ -176,7 +176,7 @@ class _ChannelWindow(_ChatWindow):
 
     def cmd__part(self) -> None:
         'Attempt parting channel.'
-        self._client_trigger('part', chan_name=self.chatname,)
+        self._client_trigger('cmd__part', chan_name=self.chatname,)
 
 
 class _QueryWindow(_ChatWindow):
@@ -510,7 +510,7 @@ class ClientKnowingTui(Client):
         'Helper for ClientWindow to trigger .send, for it can only do kwargs.'
         self.send(verb, *params)
 
-    def privmsg(self, chat_target: str, msg: str) -> None:
+    def cmd__privmsg(self, chat_target: str, msg: str) -> None:
         'Catch /privmsg, only allow for channel if in channel, else complain.'
         if self.db.is_chan_name(chat_target)\
                 and chat_target not in self.db.channels.keys():
@@ -518,7 +518,7 @@ class ClientKnowingTui(Client):
         elif self.send('PRIVMSG', chat_target, msg):
             self.db.messaging('').to(chat_target).privmsg = msg  # type: ignore
 
-    def disconnect(self, quit_msg: str) -> None:
+    def cmd__disconnect(self, quit_msg: str) -> None:
         'Send QUIT if connected, else end auto-connect attempts.'
         if self.conn:
             self.send('QUIT', quit_msg)
@@ -531,7 +531,7 @@ class ClientKnowingTui(Client):
         else:
             self._tui_alert_trigger(f'{prefix} and not attempting connect')
 
-    def reconnect(self) -> None:
+    def cmd__reconnect(self) -> None:
         'Catch /reconnect, only initiate if not connected, else complain back.'
         if self.conn:
             self._tui_alert_trigger(
@@ -539,14 +539,14 @@ class ClientKnowingTui(Client):
             return
         self.connect()
 
-    def join(self, chan_name: str) -> None:
+    def cmd__join(self, chan_name: str) -> None:
         'Catch /join to complain if already in channel.'
         if chan_name in self.db.channels.keys():
             self._tui_alert_trigger('already in that channel')
         else:
             self.send('JOIN', chan_name)
 
-    def part(self, chan_name: str) -> None:
+    def cmd__part(self, chan_name: str) -> None:
         'Catch /part to complain if not in channel.'
         if chan_name not in self.db.channels.keys():
             self._tui_alert_trigger('not in that channel')