Fixed some bugs pertaining to bot detection. Later, this should be unified (when the class structure is readjusted) or at least turned into a proper mix-in.

This commit is contained in:
karxi 2016-12-19 20:23:45 -05:00
parent 3510e2d383
commit 5c9615cd4c

View file

@ -406,7 +406,7 @@ class PesterText(QtGui.QTextEdit):
window.chatlog.log(parent.chum.handle, lexmsg) window.chatlog.log(parent.chum.handle, lexmsg)
else: else:
if ((window.idler.auto or window.idler.manual) and parent.chumopen if ((window.idler.auto or window.idler.manual) and parent.chumopen
and not parent.isBot(handle)): and not parent.isBot(chum.handle)):
idlethreshhold = 60 idlethreshhold = 60
if (not hasattr(self, 'lastmsg')) or \ if (not hasattr(self, 'lastmsg')) or \
datetime.now() - self.lastmsg > timedelta(0,idlethreshhold): datetime.now() - self.lastmsg > timedelta(0,idlethreshhold):
@ -425,8 +425,7 @@ class PesterText(QtGui.QTextEdit):
self.parent().clearNewMessage() self.parent().clearNewMessage()
QtGui.QTextEdit.focusInEvent(self, event) QtGui.QTextEdit.focusInEvent(self, event)
@staticmethod def isBot(self, *args, **kwargs):
def isBot(*args, **kwargs):
return self.parent().isBot(*args, **kwargs) return self.parent().isBot(*args, **kwargs)
def keyPressEvent(self, event): def keyPressEvent(self, event):
@ -668,6 +667,9 @@ class PesterConvo(QtGui.QFrame):
self.textArea.append(convertTags(msg)) self.textArea.append(convertTags(msg))
self.mainwindow.chatlog.log(self.title(), msg) self.mainwindow.chatlog.log(self.title(), msg)
def isBot(self, *args, **kwargs):
return self.parent().isBot(*args, **kwargs)
def updateMood(self, mood, unblocked=False, old=None): def updateMood(self, mood, unblocked=False, old=None):
syscolor = QtGui.QColor(self.mainwindow.theme["convo/systemMsgColor"]) syscolor = QtGui.QColor(self.mainwindow.theme["convo/systemMsgColor"])
#~ if mood.name() == "offline" and self.chumopen == True and not unblocked: #~ if mood.name() == "offline" and self.chumopen == True and not unblocked: