From 525b2b1bf84c5bf0d61d5448b0d645aad5e8aec2 Mon Sep 17 00:00:00 2001 From: Kiooeht Date: Sat, 11 Jan 2014 23:33:33 -0800 Subject: [PATCH] Dont' toast messages from base bots --- pesterchum.py | 8 +++++--- randomer.py | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pesterchum.py b/pesterchum.py index 7e7b579..271b71f 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -89,7 +89,7 @@ from memos import PesterMemo, MemoTabWindow, TimeTracker from irc import PesterIRC from logviewer import PesterLogUserSelect, PesterLogViewer from bugreport import BugReporter -from randomer import RandomHandler +from randomer import RandomHandler, RANDNICK # Rawr, fuck you OSX leopard if not ostools.isOSXLeopard(): @@ -103,6 +103,7 @@ canon_handles = ["apocalypseArisen", "arsenicCatnip", "arachnidsGrip", "adiosTor "caligulasAquarium", "cuttlefishCuller", "carcinoGeneticist", "centaursTesticle", \ "grimAuxiliatrix", "gallowsCalibrator", "gardenGnostic", "ectoBiologist", \ "twinArmageddons", "terminallyCapricious", "turntechGodhead", "tentacleTherapist"] +BOTNAMES = ["NICKSERV", "CHANSERV", "MEMOSERV", "OPERSERV", "HELPSERV", "CALSPRITE", RANDNICK.upper()] class waitingMessageHolder(object): @@ -1306,8 +1307,9 @@ class PesterWindow(MovingWindow): t.show() elif not self.config.notifyOptions() & self.config.NEWCONVO: if msg[:11] != "PESTERCHUM:": - t = self.tm.Toast("From: %s" % handle, re.sub("", "", msg)) - t.show() + if handle.upper() not in BOTNAMES: + t = self.tm.Toast("From: %s" % handle, re.sub("", "", msg)) + t.show() else: if msg == "PESTERCHUM:CEASE": t = self.tm.Toast("Closed Conversation", handle) diff --git a/randomer.py b/randomer.py index 6078d56..ff62399 100644 --- a/randomer.py +++ b/randomer.py @@ -1,9 +1,11 @@ from PyQt4 import QtGui, QtCore +RANDNICK = "randomEncounter" + class RandomHandler(QtCore.QObject): def __init__(self, parent): QtCore.QObject.__init__(self, parent) - self.randNick = "randomEncounter" + self.randNick = RANDNICK self.mainwindow = parent self.queue = [] self.running = False