Skip to content
Browse files

Merge pull request #137 from ericbarch/master

Fix for messages sent from user's with capitals in their nick
  • Loading branch information...
2 parents 0959cd9 + cf565ca commit 65bf463ee2a058729feb63ae46cea3a645ba09f6 David Petersen committed
Showing with 5 additions and 5 deletions.
  1. +1 −1 assets/js/client.js
  2. +1 −1 assets/js/views/message.js
  3. +3 −3 lib/socket.js
View
2 assets/js/client.js
@@ -131,7 +131,7 @@ $(function() {
var type = 'message';
// Only handle channel messages here; PMs handled separately
if (data.to.substr(0, 1) === '#') {
- chatWindow.stream.add({sender: data.from.toLowerCase(), raw: data.text, type: type});
+ chatWindow.stream.add({sender: data.from, raw: data.text, type: type});
} else if(data.to !== irc.me.get('nick')) {
// Handle PMs intiated by me
chatWindow.stream.add({sender: data.from.toLowerCase(), raw: data.text, type: 'pm'});
View
2 assets/js/views/message.js
@@ -50,7 +50,7 @@ var MessageView = Backbone.View.extend({
type: 'part',
nick: this.model.get('nick'),
action: 'left',
- reason: '(' + this.model.get('reason') + ')',
+ reason: this.model.get('reason') !== 'undefined' ? '('+this.model.get('reason')+')' : '(leaving)'
//Message resolving to undefined will include again later
//message: '(' + this.model.get('message') + ')'
});
View
6 lib/socket.js
@@ -119,7 +119,7 @@ module.exports = function(socket, connections) {
socket.on('say', function(data) {
connection.client.say(data.target, data.message);
- socket.emit('message', {to:data.target.toLowerCase(), from: connection.client.nick.toLowerCase(), text:data.message});
+ socket.emit('message', {to:data.target.toLowerCase(), from: connection.client.nick, text:data.message});
if(current_user){
connection.logMessage(data.target, {user: connection.client.nick, message: data.message});
}
@@ -129,7 +129,7 @@ module.exports = function(socket, connections) {
connection.client.action(data.target, data.message);
socket.emit('message', {
to: data.target.toLowerCase(),
- from: connection.client.nick.toLowerCase(),
+ from: connection.client.nick,
text: '\u0001ACTION ' + data.message}
);
});
@@ -140,7 +140,7 @@ module.exports = function(socket, connections) {
socket.on('nick', function(data){
connection.client.send('NICK', data.nick);
- connection.client.nick = data.nick.toLowerCase();
+ connection.client.nick = data.nick;
connection.client.opt.nick = client.nick;
});

0 comments on commit 65bf463

Please sign in to comment.
Something went wrong with that request. Please try again.