This commit is contained in:
Dpeta 2022-03-17 19:56:12 +00:00
parent bf09618d0b
commit 8e3c79c4b9

View file

@ -1254,20 +1254,24 @@ class PesterMemo(PesterConvo):
# Add ban(kick) reason # Add ban(kick) reason
# l = split update # l = split update
kick_msg = ("press 0k to rec0nnect or cancel to absc0nd")
if len(l) >= 3: if len(l) >= 3:
if l[1] != l[2]: # If there's no reason then reason is set to handle try:
# Process spare ':' characters (this might not be safe?) if l[1] != l[2]: # If there's no reason then reason is set to handle
aggrievocation = l[1] + ": " + l[2] # Process spare ':' characters (this might not be safe?)
if len(l) > 3: aggrievocation = l[1] + ": " + l[2]
aggrievocation += ':' if len(l) > 3:
for x in range(3, len(l)): aggrievocation += ':'
aggrievocation += l[x] + ':' for x in range(3, len(l)):
aggrievocation = aggrievocation.strip(':') aggrievocation += l[x]
msgbox.setInformativeText("%s\n\npress 0k to rec0nnect or cancel to absc0nd" % aggrievocation) # Not for last slice
else: if x != (len(l)-1):
msgbox.setInformativeText("press 0k to rec0nnect or cancel to absc0nd") aggrievocation += ':'
else: kick_msg = ("%s\n\npress 0k to rec0nnect or cancel to absc0nd" % aggrievocation)
msgbox.setInformativeText("press 0k to rec0nnect or cancel to absc0nd") except IndexError as e:
# This shouldn't happen
PchumLog.warning("kickmsg IndexError: %s" % e)
msgbox.setInformativeText(kick_msg)
msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel) msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel)
# Find the OK button and make it default # Find the OK button and make it default
for b in msgbox.buttons(): for b in msgbox.buttons():