Fix toast notifications to not require sound be on

This commit is contained in:
Kiooeht 2014-01-10 22:59:28 -08:00
parent cab2412284
commit e29791402d

View file

@ -1355,19 +1355,25 @@ class PesterWindow(MovingWindow):
systemColor = QtGui.QColor(self.theme["memos/systemMsgColor"]) systemColor = QtGui.QColor(self.theme["memos/systemMsgColor"])
msg = "<c=%s>%s</c>" % (systemColor.name(), msg) msg = "<c=%s>%s</c>" % (systemColor.name(), msg)
memo.addMessage(msg, handle) memo.addMessage(msg, handle)
mentioned = False
m = convertTags(msg, "text")
if m.find(":") <= 3:
m = m[m.find(":"):]
for search in self.userprofile.getMentions():
if re.search(search, m):
mentioned = True
break
if mentioned:
if self.config.notifyOptions() & self.config.INITIALS:
t = self.tm.Toast(chan, re.sub("</?c(=.*?)?>", "", msg))
t.show()
if self.config.soundOn(): if self.config.soundOn():
if self.config.memoSound(): if self.config.memoSound():
if self.config.nameSound(): if self.config.nameSound():
m = convertTags(msg, "text") if mentioned:
if m.find(":") <= 3: self.namesound.play()
m = m[m.find(":"):] return
for search in self.userprofile.getMentions():
if re.search(search, m):
if self.config.notifyOptions() & self.config.INITIALS:
t = self.tm.Toast(chan, re.sub("</?c(=.*?)?>", "", msg))
t.show()
self.namesound.play()
return
if self.honk and re.search(r"\bhonk\b", convertTags(msg, "text"), re.I): if self.honk and re.search(r"\bhonk\b", convertTags(msg, "text"), re.I):
self.honksound.play() self.honksound.play()
elif self.config.memoPing(): elif self.config.memoPing():