diff --git a/CHANGELOG.mkdn b/CHANGELOG.mkdn
index 7800ac0..ef9514b 100644
--- a/CHANGELOG.mkdn
+++ b/CHANGELOG.mkdn
@@ -38,10 +38,11 @@ CHANGELOG
* Memo OP options: Secret, Invite-only, Mute - Kiooeht [evacipatedBox]
* Notify user if channel blocks message - Kiooeht [evacipatedBox]
* Bug reporter - Kiooeht [evacipatedBox]
-* Python quirks (users can create own quirk functions) - Kiooeht [evacipatedBox]
-* Incorporate support for the new randomEncounter - Kiooeht [evacipatedBox]
-* Only GETMOOD for people online (less spam!) - Kiooeht [evacipatedBox]
-* Quirk tester in quirk window - Kiooeht [evacipatedBox]
+* Python quirks (users can create own quirk functions) - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance])
+* Incorporate support for the new randomEncounter - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance])
+* Only GETMOOD for people online (less spam!) - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance])
+* Quirk tester in quirk window - Kiooeht [evacipatedBox] (Idea: [alGore])
+* Show and support giving kick reasons - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance])
* Bug fixes
* Logviewer updates - Kiooeht [evacipatedBox]
* Memo scrollbar thing - Kiooeht [evacipatedBox]
diff --git a/TODO.mkdn b/TODO.mkdn
index e871232..4a67c67 100644
--- a/TODO.mkdn
+++ b/TODO.mkdn
@@ -11,6 +11,7 @@ Features
* Turn @ and # links on/off?
* "someone has friended you" notifier
* Reorder quirk window into a multi-page wizard
+* MSPA update notifier option
Bugs
----
diff --git a/dataobjs.py b/dataobjs.py
index dff0181..c5f8799 100644
--- a/dataobjs.py
+++ b/dataobjs.py
@@ -239,11 +239,15 @@ class PesterProfile(object):
initials = pcf+self.initials()
return "%s %s %s %s." % \
(syscolor.name(), self.colorhtml(), initials, timetext, verb, channel[1:].upper().replace("_", " "))
- def memobanmsg(self, opchum, opgrammar, syscolor, timeGrammar):
+ def memobanmsg(self, opchum, opgrammar, syscolor, timeGrammar, reason):
initials = timeGrammar.pcf+self.initials()+timeGrammar.number
opinit = opgrammar.pcf+opchum.initials()+opgrammar.number
- return "%s banned %s from responding to memo." % \
- (opchum.colorhtml(), opinit, self.colorhtml(), initials)
+ if opchum.handle == reason:
+ return "%s banned %s from responding to memo." % \
+ (opchum.colorhtml(), opinit, self.colorhtml(), initials)
+ else:
+ return "%s banned %s from responding to memo: [%s]." % \
+ (opchum.colorhtml(), opinit, self.colorhtml(), initials, unicode(reason))
def memojoinmsg(self, syscolor, td, timeGrammar, verb):
(temporal, pcf, when) = (timeGrammar.temporal, timeGrammar.pcf, timeGrammar.when)
timetext = timeDifference(td)
diff --git a/irc.py b/irc.py
index c178ac0..0f5ecf8 100644
--- a/irc.py
+++ b/irc.py
@@ -228,10 +228,15 @@ class PesterIRC(QtCore.QThread):
self.setConnectionBroken()
@QtCore.pyqtSlot(QtCore.QString, QtCore.QString)
def kickUser(self, handle, channel):
+ l = handle.split(":")
c = unicode(channel)
- h = unicode(handle)
+ h = unicode(l[0])
+ if len(l) > 1:
+ reason = unicode(l[1])
+ else:
+ reason = ""
try:
- helpers.kick(self.cli, h, c)
+ helpers.kick(self.cli, h, c, reason)
except socket.error:
self.setConnectionBroken()
@QtCore.pyqtSlot(QtCore.QString, QtCore.QString, QtCore.QString)
@@ -359,8 +364,9 @@ class PesterHandler(DefaultCommandHandler):
handle = nick[0:nick.find("!")]
self.parent.userPresentUpdate.emit(handle, "", "quit")
self.parent.moodUpdated.emit(handle, Mood("offline"))
- def kick(self, opnick, channel, handle, op):
- self.parent.userPresentUpdate.emit(handle, channel, "kick:%s" % (op))
+ def kick(self, opnick, channel, handle, reason):
+ op = opnick[0:opnick.find("!")]
+ self.parent.userPresentUpdate.emit(handle, channel, "kick:%s:%s" % (op, reason))
# ok i shouldnt be overloading that but am lazy
def part(self, nick, channel, reason="nanchos"):
handle = nick[0:nick.find("!")]
diff --git a/memos.py b/memos.py
index b7bff8d..d6437e5 100644
--- a/memos.py
+++ b/memos.py
@@ -743,6 +743,7 @@ class PesterMemo(PesterConvo):
l = update.split(":")
update = l[0]
op = l[1]
+ reason = l[2]
if update == "nick":
l = h.split(":")
oldnick = l[0]
@@ -807,7 +808,7 @@ class PesterMemo(PesterConvo):
opgrammar = self.time.getGrammar()
else:
opgrammar = TimeGrammar("CURRENT", "C", "RIGHT NOW")
- msg = chum.memobanmsg(opchum, opgrammar, systemColor, grammar)
+ msg = chum.memobanmsg(opchum, opgrammar, systemColor, grammar, reason)
self.textArea.append(convertTags(msg))
self.mainwindow.chatlog.log(self.channel, msg)
ttracker.removeTime(ttracker.getTime())
@@ -981,7 +982,9 @@ class PesterMemo(PesterConvo):
if not self.userlist.currentItem():
return
currentHandle = unicode(self.userlist.currentItem().text())
- self.mainwindow.kickUser.emit(currentHandle, self.channel)
+ (reason, ok) = QtGui.QInputDialog.getText(self, "Ban User", "Enter the reason you are banning this user (optional):")
+ if ok:
+ self.mainwindow.kickUser.emit("%s:%s" % (currentHandle, reason), self.channel)
@QtCore.pyqtSlot()
def opSelectedUser(self):
if not self.userlist.currentItem():
diff --git a/oyoyo/helpers.py b/oyoyo/helpers.py
index 7ecab79..a300f4f 100644
--- a/oyoyo/helpers.py
+++ b/oyoyo/helpers.py
@@ -38,8 +38,8 @@ def names(cli, *channels):
def channel_list(cli):
cli.send("LIST")
-def kick(cli, handle, channel):
- cli.send("KICK %s %s" % (channel, handle))
+def kick(cli, handle, channel, reason=""):
+ cli.send("KICK %s %s %s" % (channel, handle, reason))
def mode(cli, channel, mode, options=None):
cmd = "MODE %s %s" % (channel, mode)