Dont' toast messages from base bots

This commit is contained in:
Kiooeht 2014-01-11 23:33:33 -08:00
parent 7dbe1e37d2
commit 525b2b1bf8
2 changed files with 8 additions and 4 deletions

View file

@ -89,7 +89,7 @@ from memos import PesterMemo, MemoTabWindow, TimeTracker
from irc import PesterIRC from irc import PesterIRC
from logviewer import PesterLogUserSelect, PesterLogViewer from logviewer import PesterLogUserSelect, PesterLogViewer
from bugreport import BugReporter from bugreport import BugReporter
from randomer import RandomHandler from randomer import RandomHandler, RANDNICK
# Rawr, fuck you OSX leopard # Rawr, fuck you OSX leopard
if not ostools.isOSXLeopard(): if not ostools.isOSXLeopard():
@ -103,6 +103,7 @@ canon_handles = ["apocalypseArisen", "arsenicCatnip", "arachnidsGrip", "adiosTor
"caligulasAquarium", "cuttlefishCuller", "carcinoGeneticist", "centaursTesticle", \ "caligulasAquarium", "cuttlefishCuller", "carcinoGeneticist", "centaursTesticle", \
"grimAuxiliatrix", "gallowsCalibrator", "gardenGnostic", "ectoBiologist", \ "grimAuxiliatrix", "gallowsCalibrator", "gardenGnostic", "ectoBiologist", \
"twinArmageddons", "terminallyCapricious", "turntechGodhead", "tentacleTherapist"] "twinArmageddons", "terminallyCapricious", "turntechGodhead", "tentacleTherapist"]
BOTNAMES = ["NICKSERV", "CHANSERV", "MEMOSERV", "OPERSERV", "HELPSERV", "CALSPRITE", RANDNICK.upper()]
class waitingMessageHolder(object): class waitingMessageHolder(object):
@ -1306,8 +1307,9 @@ class PesterWindow(MovingWindow):
t.show() t.show()
elif not self.config.notifyOptions() & self.config.NEWCONVO: elif not self.config.notifyOptions() & self.config.NEWCONVO:
if msg[:11] != "PESTERCHUM:": if msg[:11] != "PESTERCHUM:":
t = self.tm.Toast("From: %s" % handle, re.sub("</?c(=.*?)?>", "", msg)) if handle.upper() not in BOTNAMES:
t.show() t = self.tm.Toast("From: %s" % handle, re.sub("</?c(=.*?)?>", "", msg))
t.show()
else: else:
if msg == "PESTERCHUM:CEASE": if msg == "PESTERCHUM:CEASE":
t = self.tm.Toast("Closed Conversation", handle) t = self.tm.Toast("Closed Conversation", handle)

View file

@ -1,9 +1,11 @@
from PyQt4 import QtGui, QtCore from PyQt4 import QtGui, QtCore
RANDNICK = "randomEncounter"
class RandomHandler(QtCore.QObject): class RandomHandler(QtCore.QObject):
def __init__(self, parent): def __init__(self, parent):
QtCore.QObject.__init__(self, parent) QtCore.QObject.__init__(self, parent)
self.randNick = "randomEncounter" self.randNick = RANDNICK
self.mainwindow = parent self.mainwindow = parent
self.queue = [] self.queue = []
self.running = False self.running = False