ban/kick message to msgbox

This commit is contained in:
Dpeta 2022-03-17 04:11:52 +00:00
parent c32e54de7f
commit 4571b6dce7
2 changed files with 19 additions and 6 deletions

3
irc.py
View file

@ -543,10 +543,7 @@ class PesterHandler(DefaultCommandHandler):
# Server-set usermodes don't need to be passed. # Server-set usermodes don't need to be passed.
if (handles == ['']) & ( ('x' in m) | ('z' in m) | ('o' in m) | ('x' in m) )!=True: if (handles == ['']) & ( ('x' in m) | ('z' in m) | ('o' in m) | ('x' in m) )!=True:
try:
self.parent.userPresentUpdate.emit(handles[i], channel, m+":%s" % (op)) self.parent.userPresentUpdate.emit(handles[i], channel, m+":%s" % (op))
except:
PchumLog.exception('')
#self.parent.userPresentUpdate.emit(handles[i], channel, m+":%s" % (op)) #self.parent.userPresentUpdate.emit(handles[i], channel, m+":%s" % (op))
# Passing an empty handle here might cause a crash. # Passing an empty handle here might cause a crash.

View file

@ -1251,6 +1251,22 @@ class PesterMemo(PesterConvo):
msgbox = QtWidgets.QMessageBox() msgbox = QtWidgets.QMessageBox()
msgbox.setStyleSheet("QMessageBox{" + self.mainwindow.theme["main/defaultwindow/style"] + "}") msgbox.setStyleSheet("QMessageBox{" + self.mainwindow.theme["main/defaultwindow/style"] + "}")
msgbox.setText(self.mainwindow.theme["convo/text/kickedmemo"]) msgbox.setText(self.mainwindow.theme["convo/text/kickedmemo"])
# Add ban(kick) reason
# l = split update
if len(l) >= 3:
if l[1] != l[2]: # If there's no reason then reason is set to handle
# Process spare ':' characters (this might not be safe?)
aggrievocation = l[1] + ": " + l[2]
if len(l) > 3:
aggrievocation += ':'
for x in range(3, len(l)):
aggrievocation += l[x] + ':'
aggrievocation = aggrievocation.strip(':')
msgbox.setInformativeText("%s\n\npress 0k to rec0nnect or cancel to absc0nd" % aggrievocation)
else:
msgbox.setInformativeText("press 0k to rec0nnect or cancel to absc0nd")
else:
msgbox.setInformativeText("press 0k to rec0nnect or cancel to absc0nd") msgbox.setInformativeText("press 0k to rec0nnect or cancel to absc0nd")
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