Commit e02c044a authored by JC Brand's avatar JC Brand

Refactored notification code

responsible for showing messages based on the extended presence information.

- Use DOM API instead of jQuery
- Make info messages overridable (allows also for disabling them)
- Break up large function with inline callbacks into smaller ones
parent ebc7409d
...@@ -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(__(view.newNicknameMessages["210"], "oldnick")); expect($chat_content.find('div.chat-info').html()).toBe(__(converse.muc.newNicknameMessages["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(__(view.newNicknameMessages["303"], "newnick")); expect($chat_content.find('div.chat-info').last().html()).toBe(__(converse.muc.newNicknameMessages["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(__(view.newNicknameMessages["303"], "newnick")); expect($chat_content.find('div.chat-info').last().html()).toBe(__(converse.muc.newNicknameMessages["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");
......
This diff is collapsed.
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