diff --git a/CHANGELOG.md b/CHANGELOG.md index db59aba..739d20c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Added styleing/markup to "PESTER" and "ADD GROUP" menu options and some other previously unstyled elements :) - Added pesterchum.spec for use with pyinstaller. - Wrapped socket in SSL context and changed the port appropriately, hostname verification is turned off. +- Pesterchum now sends a ``QUIT :reason`` to the server when shutting down instead of just quitting instantly. ### Changed - Transitioned to Python 3. @@ -17,6 +18,7 @@ ### Fixed - Fixed sRGB profile issue with certain images. - Fixed issue where Pesterchum crashed if a quirk was malformed. +- Fixed Pesterchum icon getting stuck on the system tray even after shutdown on windows. ### Deprecated - Removed update system (it seemed to be non-functional). diff --git a/TODO.md b/TODO.md index 923c859..110dcdc 100644 --- a/TODO.md +++ b/TODO.md @@ -1,11 +1,12 @@ # TODO LIST : ) +~~Crossed out~~ entries are completed :3c ## ADD - A proper prompt for choosing a server. ## FIX -- Pesterchum gets stuck on the system tray even after shutdown on windows. +- ~~Pesterchum gets stuck on the system tray even after shutdown on windows.~~ - Audio mixer slider in options doesn't always work. (Not working on linux?) -- QUIT not send to server on shutdown. -- TLS randomly causing socket to break. +- ~~QUIT not send to server on shutdown.~~ +- ~~TLS randomly causing socket to break.~~ - Make setup.py work with 32-bit python. - Make setup.py work with py2app (might not be required if pyinstaller works better!!). \ No newline at end of file diff --git a/irc.py b/irc.py index 2a50e09..9b3e3d3 100644 --- a/irc.py +++ b/irc.py @@ -420,6 +420,8 @@ class PesterHandler(DefaultCommandHandler): mychumhandle = self.mainwindow.profile().handle mymood = self.mainwindow.profile().mood.value() if not self.mainwindow.config.lowBandwidth(): + from time import sleep + sleep(0.5) # To prevent TLS from dying %d" % (mymood)) diff --git a/oyoyo/client.py b/oyoyo/client.py index 163973a..ef1c581 100644 --- a/oyoyo/client.py +++ b/oyoyo/client.py @@ -84,8 +84,8 @@ class IRCClient: """ self.context = ssl.create_default_context() self.context.check_hostname = False - self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.socket = self.context.wrap_socket(self.socket) + self.bare_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.socket = self.context.wrap_socket(self.bare_socket) self.nick = None self.real_name = None self.host = None @@ -221,9 +221,22 @@ class IRCClient: # with extreme prejudice if self.socket: logging.info('shutdown socket') + #print("shutdown socket") self._end = True - self.socket.shutdown(socket.SHUT_RDWR) + self.socket.shutdown(socket.SHUT_WR) + self.socket.close() + + def simple_send(self, message): + self.socket.send(bytes(message, "UTF-8")) + def quit(self, msg): + # I am going mad :) + # Why does this only work 33% of the time