Skip to content

Commit

Permalink
Merge pull request #137 from ericbarch/master
Browse files Browse the repository at this point in the history
Fix for messages sent from user's with capitals in their nick
  • Loading branch information
David Petersen committed Jul 4, 2012
2 parents 0959cd9 + cf565ca commit 65bf463
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion assets/js/client.js
Expand Up @@ -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'});
Expand Down
2 changes: 1 addition & 1 deletion assets/js/views/message.js
Expand Up @@ -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') + ')'
});
Expand Down
6 changes: 3 additions & 3 deletions lib/socket.js
Expand Up @@ -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});
}
Expand All @@ -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}
);
});
Expand All @@ -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;
});

Expand Down

0 comments on commit 65bf463

Please sign in to comment.