Merge pull request #154 from Dpeta/botfix

Don't send begin/color to bots
This commit is contained in:
Dpeta 2023-09-12 22:33:44 +02:00 committed by GitHub
commit aa200a520d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 8 deletions

View file

@ -17,6 +17,7 @@ from pnc import lexercon
from generic import mysteryTime from generic import mysteryTime
from quirks import ScriptQuirks from quirks import ScriptQuirks
from pyquirks import PythonQuirks from pyquirks import PythonQuirks
from scripts.services import BOTNAMES
PchumLog = logging.getLogger("pchumLogger") PchumLog = logging.getLogger("pchumLogger")
@ -851,8 +852,8 @@ def kxhandleInput(ctx, text=None, flavor=None, irc_compatible=False):
if flavor == "convo": if flavor == "convo":
# if ceased, rebegin # if ceased, rebegin
if hasattr(ctx, "chumopen") and not ctx.chumopen: if hasattr(ctx, "chumopen") and not ctx.chumopen:
if not irc_compatible: if not irc_compatible and ctx.title().casefold() not in BOTNAMES:
ctx.mainwindow.newConvoStarted.emit(str(ctx.title()), True) ctx.mainwindow.newConvoStarted.emit(ctx.title(), True)
ctx.setChumOpen(True) ctx.setChumOpen(True)
# Post-process and send the messages. # Post-process and send the messages.

View file

@ -1903,12 +1903,8 @@ class PesterWindow(MovingWindow):
if chum.handle.casefold() in BOTNAMES: if chum.handle.casefold() in BOTNAMES:
convoWindow.toggleQuirks(True) convoWindow.toggleQuirks(True)
convoWindow.quirksOff.setChecked(True) convoWindow.quirksOff.setChecked(True)
if ( elif not self.config.irc_compatibility_mode():
not self.config.irc_compatibility_mode() # Send PESTERCHUM:BEGIN and color.
or chum.handle.casefold() in CUSTOMBOTS
):
self.newConvoStarted.emit(chum.handle, initiated)
else:
self.newConvoStarted.emit(chum.handle, initiated) self.newConvoStarted.emit(chum.handle, initiated)
convoWindow.show() convoWindow.show()