diff --git a/CHANGELOG.md b/CHANGELOG.md index 07aeb73..3880968 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,11 @@ # Changelog (This document uses YYYY-MM-DD) -## [v2.4.3] - 2022-09-01 +## [v2.4.3] - 2022-09-05 ### Added - Support for color via IRCv3 metadata draft. + - This way clients can keep track of each other's colors without requiring them to send a message first. - Prompt for connecting anyway when certificate validation fails. ### Changed diff --git a/irc.py b/irc.py index 67dec17..2ab9587 100644 --- a/irc.py +++ b/irc.py @@ -247,6 +247,14 @@ class PesterIRC(QtCore.QThread): def updateColor(self): #PchumLog.debug("irc updateColor (outgoing)") #me = self.mainwindow.profile() + # Update color metadata field + try: + color = self.mainwindow.profile().color + helpers.metadata(self.cli, '*', "set", "color", str(color.name())) + except OSError as e: + PchumLog.warning(e) + self.setConnectionBroken() + # Send color messages for h in list(self.mainwindow.convos.keys()): try: helpers.msg(self.cli, h, "COLOR >%s" % (self.mainwindow.profile().colorcmd())) diff --git a/pesterchum.py b/pesterchum.py index 4d7b04b..8156de9 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -3273,6 +3273,7 @@ class PesterWindow(MovingWindow): self.sendNotice.emit(code, RANDNICK) except: PchumLog.warning("No randomEncounter set in userconfig?") + self.mycolorUpdated.emit() def aboutPesterchum(self): if hasattr(self, 'aboutwindow') and self.aboutwindow: @@ -3698,8 +3699,11 @@ class PesterWindow(MovingWindow): def connectAnyway(self, e): # Prompt user to connect anyway msgbox = QtWidgets.QMessageBox() - msgbox.setStyleSheet("QMessageBox{ %s }" - % self.theme["main/defaultwindow/style"]) + try: + msgbox.setStyleSheet("QMessageBox{ %s }" + % self.theme["main/defaultwindow/style"]) + except: + pass msgbox.setIcon(QtWidgets.QMessageBox.Icon.Warning) msgbox.setText("Server certificate validation failed") msgbox.setInformativeText("Reason: \"%s (%s)\"" % (e.verify_message, e.verify_code) @@ -3709,10 +3713,7 @@ class PesterWindow(MovingWindow): msgbox.setDefaultButton(QtWidgets.QMessageBox.StandardButton.No) ret = msgbox.exec() if ret == QtWidgets.QMessageBox.StandardButton.Yes: - self.parent.restartIRC(verify_hostname=False) - else: - return False - + self.parent.restartIRC(verify_hostname=False) pcUpdate = QtCore.pyqtSignal('QString', 'QString') closeToTraySignal = QtCore.pyqtSignal()