Commit 5a72466c authored by JC Brand's avatar JC Brand

Rename variables to adhere to coding style.

parent 5e9e6852
...@@ -529,7 +529,7 @@ ...@@ -529,7 +529,7 @@
expect($occupants.children().first(0).text()).toBe("oldnick"); expect($occupants.children().first(0).text()).toBe("oldnick");
expect($chat_content.find('div.chat-info').length).toBe(1); expect($chat_content.find('div.chat-info').length).toBe(1);
expect($chat_content.find('div.chat-info').html()).toBe(__(converse.muc.newNicknameMessages["210"], "oldnick")); expect($chat_content.find('div.chat-info').html()).toBe(__(converse.muc.new_nickname_messages["210"], "oldnick"));
presence = $pres().attrs({ presence = $pres().attrs({
from:'lounge@localhost/oldnick', from:'lounge@localhost/oldnick',
...@@ -549,7 +549,7 @@ ...@@ -549,7 +549,7 @@
converse.connection._dataRecv(test_utils.createRequest(presence)); converse.connection._dataRecv(test_utils.createRequest(presence));
expect($chat_content.find('div.chat-info').length).toBe(2); expect($chat_content.find('div.chat-info').length).toBe(2);
expect($chat_content.find('div.chat-info').last().html()).toBe(__(converse.muc.newNicknameMessages["303"], "newnick")); expect($chat_content.find('div.chat-info').last().html()).toBe(__(converse.muc.new_nickname_messages["303"], "newnick"));
$occupants = view.$('.occupant-list'); $occupants = view.$('.occupant-list');
expect($occupants.children().length).toBe(0); expect($occupants.children().length).toBe(0);
...@@ -569,7 +569,7 @@ ...@@ -569,7 +569,7 @@
converse.connection._dataRecv(test_utils.createRequest(presence)); converse.connection._dataRecv(test_utils.createRequest(presence));
expect($chat_content.find('div.chat-info').length).toBe(2); expect($chat_content.find('div.chat-info').length).toBe(2);
expect($chat_content.find('div.chat-info').last().html()).toBe(__(converse.muc.newNicknameMessages["303"], "newnick")); expect($chat_content.find('div.chat-info').last().html()).toBe(__(converse.muc.new_nickname_messages["303"], "newnick"));
$occupants = view.$('.occupant-list'); $occupants = view.$('.occupant-list');
expect($occupants.children().length).toBe(1); expect($occupants.children().length).toBe(1);
expect($occupants.children().first(0).text()).toBe("newnick"); expect($occupants.children().first(0).text()).toBe("newnick");
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
* 332 presence Removal from room Inform user that he or she is being removed from the room because of a system shutdown * 332 presence Removal from room Inform user that he or she is being removed from the room because of a system shutdown
*/ */
converse.muc = { converse.muc = {
infoMessages: { info_messages: {
100: __('This room is not anonymous'), 100: __('This room is not anonymous'),
102: __('This room now shows unavailable members'), 102: __('This room now shows unavailable members'),
103: __('This room does not show unavailable members'), 103: __('This room does not show unavailable members'),
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
201: __('A new room has been created') 201: __('A new room has been created')
}, },
disconnectMessages: { disconnect_messages: {
301: __('You have been banned from this room'), 301: __('You have been banned from this room'),
307: __('You have been kicked from this room'), 307: __('You have been kicked from this room'),
321: __("You have been removed from this room because of an affiliation change"), 321: __("You have been removed from this room because of an affiliation change"),
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
332: __("You have been removed from this room because the MUC (Multi-user chat) service is being shut down.") 332: __("You have been removed from this room because the MUC (Multi-user chat) service is being shut down.")
}, },
actionInfoMessages: { action_info_messages: {
/* XXX: Note the triple underscore function and not double /* XXX: Note the triple underscore function and not double
* underscore. * underscore.
* *
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
322: ___("<strong>%1$s</strong> has been removed for not being a member") 322: ___("<strong>%1$s</strong> has been removed for not being a member")
}, },
newNicknameMessages: { new_nickname_messages: {
210: ___('Your nickname has been automatically set to: <strong>%1$s</strong>'), 210: ___('Your nickname has been automatically set to: <strong>%1$s</strong>'),
303: ___('Your nickname has been changed to: <strong>%1$s</strong>') 303: ___('Your nickname has been changed to: <strong>%1$s</strong>')
} }
...@@ -1048,13 +1048,13 @@ ...@@ -1048,13 +1048,13 @@
getMessageFromStatus: function (stat, is_self, from_nick, item) { getMessageFromStatus: function (stat, is_self, from_nick, item) {
var code = stat.getAttribute('code'); var code = stat.getAttribute('code');
if (is_self && code === "210") { if (is_self && code === "210") {
return __(converse.muc.newNicknameMessages[code], from_nick); return __(converse.muc.new_nickname_messages[code], from_nick);
} else if (is_self && code === "303") { } else if (is_self && code === "303") {
return __(converse.muc.newNicknameMessages[code], item.getAttribute('nick')); return __(converse.muc.new_nickname_messages[code], item.getAttribute('nick'));
} else if (!is_self && (code in converse.muc.actionInfoMessages)) { } else if (!is_self && (code in converse.muc.action_info_messages)) {
return __(converse.muc.actionInfoMessages[code], from_nick); return __(converse.muc.action_info_messages[code], from_nick);
} else if (code in converse.muc.infoMessages) { } else if (code in converse.muc.info_messages) {
return converse.muc.infoMessages[code]; return converse.muc.info_messages[code];
} else if (code !== '110') { } else if (code !== '110') {
if (stat.textContent) { if (stat.textContent) {
// Sometimes the status contains human readable text and not a code. // Sometimes the status contains human readable text and not a code.
...@@ -1096,11 +1096,11 @@ ...@@ -1096,11 +1096,11 @@
notification.actor = actor ? actor.getAttribute('nick') : undefined; notification.actor = actor ? actor.getAttribute('nick') : undefined;
} }
var codes = _.map(statuses, function (stat) { return stat.getAttribute('code'); }); var codes = _.map(statuses, function (stat) { return stat.getAttribute('code'); });
var disconnection_codes = _.intersection(codes, _.keys(converse.muc.disconnectMessages)); var disconnection_codes = _.intersection(codes, _.keys(converse.muc.disconnect_messages));
var disconnected = is_self && disconnection_codes.length > 0; var disconnected = is_self && disconnection_codes.length > 0;
if (disconnected) { if (disconnected) {
notification.disconnected = true; notification.disconnected = true;
notification.disconnection_message = converse.muc.disconnectMessages[disconnection_codes[0]]; notification.disconnection_message = converse.muc.disconnect_messages[disconnection_codes[0]];
} }
return notification; return notification;
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment