From 933d240d75ab3ca67792ee88a0b1812564d8aa37 Mon Sep 17 00:00:00 2001 From: shane tully Date: Tue, 6 Aug 2013 22:19:34 -0700 Subject: [PATCH] fixed #19 - Nicknames should be case insensitive --- cryptully/network/connectionManager.py | 2 +- cryptully/qt/qNickInputWidget.py | 2 +- cryptully/server/turnServer.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cryptully/network/connectionManager.py b/cryptully/network/connectionManager.py index b95f593..6ce92df 100644 --- a/cryptully/network/connectionManager.py +++ b/cryptully/network/connectionManager.py @@ -52,7 +52,7 @@ def disconnectFromServer(self): def openChat(self, destNick): - self.__createClient(destNick, initiateHandshakeOnStart=True) + self.__createClient(destNick.lower(), initiateHandshakeOnStart=True) def __createClient(self, nick, initiateHandshakeOnStart=False): diff --git a/cryptully/qt/qNickInputWidget.py b/cryptully/qt/qNickInputWidget.py index 6af30aa..2d6ed70 100644 --- a/cryptully/qt/qNickInputWidget.py +++ b/cryptully/qt/qNickInputWidget.py @@ -60,7 +60,7 @@ def __init__(self, image, imageWidth, connectClickedSlot, nick='', parent=None): def __connectClicked(self): - nick = str(self.nickEdit.text()) + nick = str(self.nickEdit.text()).lower() # Validate the given nick nickStatus = utils.isValidNick(nick) diff --git a/cryptully/server/turnServer.py b/cryptully/server/turnServer.py index de54e64..7dcbfdc 100644 --- a/cryptully/server/turnServer.py +++ b/cryptully/server/turnServer.py @@ -246,9 +246,9 @@ def run(self): printAndLog(self.nick + ": requested to send message to invalid nick") self.__handleError(errors.ERR_INVALID_NICK) - client = nickMap[destNick] + client = nickMap[destNick.lower()] - # Rewrite the nick to prevent nick spoofing + # Rewrite the source nick to prevent nick spoofing message.sourceNick = self.nick client.send(message)