From 02c0b9e47bf365e0cab0279be5ae0d02cd5d6c69 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Fri, 16 Apr 2021 15:37:38 +0200 Subject: [PATCH] Fixes for botnames, chumroll & dm colors. --- CHANGELOG.md | 19 +++++++++++++++++-- convo.py | 2 ++ irc.py | 5 ++++- pesterchum.py | 34 ++++++++++++++++++++-------------- setup.py | 2 +- 5 files changed, 44 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc9c226..2c5418c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,28 @@ # Changelog (This document uses YYYY-MM-DD as per ISO 8601) +## [v2.1.2] - 2021-4-16 + +### Added +- Added HOSTSERV and BOTSERV to BOTNAMES. + +### Fixed +- Colors in direct messages sometimes not working. +- Handles sometimes not showing up in chumroll or trollslum. + +### Removed +- Separate handling for canon handles on chumroll because it was buggy and unneeded. + +### Changed +- setup.py build description to just "Pesterchum" + ## [v2.1.1] - 2021-4-12 -# Fixed +### Fixed - Fixed theme not getting applied correctly to memo. - Fixed sRGB profile in steamchum. -## Changed +### Changed - convo/tabwindow on trollian seems to be used for the general background color, so, I changed it to a value. I'm not use if this was intentional. ## [v2.1.0] - 2021-4-11 diff --git a/convo.py b/convo.py index d1fc34c..2eeca4c 100644 --- a/convo.py +++ b/convo.py @@ -6,6 +6,7 @@ from time import strftime from copy import copy from datetime import datetime, timedelta from PyQt5 import QtCore, QtGui, QtWidgets +import logging from mood import Mood from dataobjs import PesterProfile, PesterHistory @@ -752,6 +753,7 @@ class PesterConvo(QtWidgets.QFrame): self.optionsMenu.removeAction(self.blockAction) def updateColor(self, color): + logging.debug("convo updateColor: " + str(color)) self.chum.color = color def addMessage(self, msg, me=True): if type(msg) in [str, str]: diff --git a/irc.py b/irc.py index bee5638..aa91372 100644 --- a/irc.py +++ b/irc.py @@ -196,6 +196,7 @@ class PesterIRC(QtCore.QThread): self.setConnectionBroken() @QtCore.pyqtSlot() def updateColor(self): + #logging.debug("irc updateColor (outgoing)") me = self.mainwindow.profile() for h in list(self.mainwindow.convos.keys()): try: @@ -411,8 +412,10 @@ class PesterHandler(DefaultCommandHandler): colors = msg[7:].split(",") try: colors = [int(d) for d in colors] - except ValueError: + except ValueError as e: + logging.warning(e) colors = [0,0,0] + logging.debug("colors: " + str(colors)) color = QtGui.QColor(*colors) self.parent.colorUpdated.emit(handle, color) else: diff --git a/pesterchum.py b/pesterchum.py index 9098acf..17559cb 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -202,12 +202,13 @@ from toast import PesterToastMachine, PesterToast import pytwmn from profile import * -canon_handles = ["apocalypseArisen", "arsenicCatnip", "arachnidsGrip", "adiosToreador", \ - "caligulasAquarium", "cuttlefishCuller", "carcinoGeneticist", "centaursTesticle", \ - "grimAuxiliatrix", "gallowsCalibrator", "gardenGnostic", "ectoBiologist", \ - "twinArmageddons", "terminallyCapricious", "turntechGodhead", "tentacleTherapist"] +#canon_handles = ["apocalypseArisen", "arsenicCatnip", "arachnidsGrip", "adiosToreador", \ +# "caligulasAquarium", "cuttlefishCuller", "carcinoGeneticist", "centaursTesticle", \ +# "grimAuxiliatrix", "gallowsCalibrator", "gardenGnostic", "ectoBiologist", \ +# "twinArmageddons", "terminallyCapricious", "turntechGodhead", "tentacleTherapist"] +canon_handles = ["",]# Unused, kept to prevent unexpected calls causing a crash. CUSTOMBOTS = ["CALSPRITE", RANDNICK.upper()] -BOTNAMES = ["NICKSERV", "CHANSERV", "MEMOSERV", "OPERSERV", "HELPSERV"] +BOTNAMES = ["NICKSERV", "CHANSERV", "MEMOSERV", "OPERSERV", "HELPSERV", "HOSTSERV", "BOTSERV"] BOTNAMES.extend(CUSTOMBOTS) # Save the main app. From here, we should be able to get everything else in @@ -414,10 +415,10 @@ class chumArea(RightClickTree): return self.groupMenu else: currenthandle = self.currentItem().chum.handle - if currenthandle in canon_handles: - return self.canonMenu - else: - return self.optionsMenu + #if currenthandle in canon_handles: + # return self.canonMenu + #else: + return self.optionsMenu def startDrag(self, dropAction): ## Traceback (most recent call last): @@ -564,7 +565,8 @@ class chumArea(RightClickTree): def showAllChums(self): for c in self.chums: chandle = c.handle - if not len(self.findItems(chandle, QtCore.Qt.MatchContains | QtCore.Qt.MatchRecursive)): + if not len(self.findItems(chandle, QtCore.Qt.MatchExactly | QtCore.Qt.MatchRecursive)): + #if True:# For if it doesn't work at all :/ chumLabel = chumListing(c, self.mainwindow) self.addItem(chumLabel) self.sort() @@ -672,7 +674,8 @@ class chumArea(RightClickTree): if text.rfind(" (") != -1: text = text[0:text.rfind(" (")] curgroups.append(text) - if not self.findItems(chumLabel.handle, QtCore.Qt.MatchContains | QtCore.Qt.MatchRecursive): + if not self.findItems(chumLabel.handle, QtCore.Qt.MatchExactly | QtCore.Qt.MatchRecursive): + #if True:# For if it doesn't work at all :/ if chumLabel.chum.group not in curgroups: child_1 = QtWidgets.QTreeWidgetItem(["%s" % (chumLabel.chum.group)]) i = 0 @@ -724,7 +727,8 @@ class chumArea(RightClickTree): if self.mainwindow.config.showOnlineNumbers(): self.showOnlineNumbers() else: # usually means this is now the trollslum - if not self.findItems(chumLabel.handle, QtCore.Qt.MatchContains | QtCore.Qt.MatchRecursive): + if not self.findItems(chumLabel.handle, QtCore.Qt.MatchExactly | QtCore.Qt.MatchRecursive): + #if True:# For if it doesn't work at all :/ self.topLevelItem(0).addChild(chumLabel) self.topLevelItem(0).sortChildren(0, QtCore.Qt.AscendingOrder) def takeItem(self, chumLabel): @@ -2125,6 +2129,7 @@ class PesterWindow(MovingWindow): @QtCore.pyqtSlot(QString, QtGui.QColor) def updateColorSlot(self, handle, color): + logging.debug("updateColorSlot, "+ str(handle) +", " + str(color)) h = str(handle) self.changeColor(h, color) @@ -3576,8 +3581,8 @@ Click this message to never see this again.") irc2widget = [('connected()', 'connected()'), ('moodUpdated(QString, PyQt_PyObject)', 'updateMoodSlot(QString, PyQt_PyObject)'), - ('colorUpdated(QString, QColor)', - 'updateColorSlot(QString, QColor)'), + ('colorUpdated(QString, QtGui.QColor)', + 'updateColorSlot(QString, QtGui.QColor)'), ('messageReceived(QString, QString)', 'deliverMessage(QString, QString)'), ('memoReceived(QString, QString, QString)', @@ -3637,6 +3642,7 @@ Click this message to never see this again.") # Main window --> IRC (irc.connected, widget.connected), (irc.moodUpdated, widget.updateMoodSlot), + (irc.colorUpdated, widget.updateColorSlot), (irc.messageReceived, widget.deliverMessage), (irc.memoReceived, widget.deliverMemo), (irc.noticeReceived, widget.deliverNotice), diff --git a/setup.py b/setup.py index d6e61be..39dc407 100644 --- a/setup.py +++ b/setup.py @@ -51,7 +51,7 @@ bdist_mac_options = { 'bundle_name': "Pesterchum" } -description = "Instant messaging client copying the look and feel of clients from Andrew Hussie's webcomic Homestuck." +description = "Pesterchum" icon = "pesterchum.ico" # See https://stackoverflow.com/questions/15734703/use-cx-freeze-to-create-an-msi-that-adds-a-shortcut-to-the-desktop