Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix for messages sent from user's with capitals in their nick #137

Merged
merged 1 commit into from

2 participants

@ericbarch
Collaborator

Been looking into cwc's issue with not getting messages. I think this may solve that. Either way, it's an issue I introduced while fixing the case sensitivity of channels/PMs.

@thedjpetersen thedjpetersen merged commit 65bf463 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
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;
});
Something went wrong with that request. Please try again.