diff --git a/amadeus/static/js/chat.js b/amadeus/static/js/chat.js
index 779138f..170c157 100644
--- a/amadeus/static/js/chat.js
+++ b/amadeus/static/js/chat.js
@@ -79,6 +79,48 @@ function getModalInfo(btn, space, space_type) {
}
});
+ var viewed = $(".messages-container").data('viewed'),
+ sub_badge = $(".messages-container").data('space'),
+ father = $(".messages-container").parent().parent().parent().parent(),
+ chat_list_item_id = "#talk-" + father.attr("id");
+
+ $('.chat_badge').each(function () {
+ var actual = $(this).text();
+
+ if (actual != "+99") {
+ actual = parseInt(actual, 10) - viewed;
+
+ if (actual <= 0) {
+ $(this).text("0");
+ $(this).hide();
+ } else {
+ $(this).text(actual);
+ }
+ }
+ });
+
+ var counter = $(chat_list_item_id).find('.chat_notify_list').text();
+
+ counter = parseInt(counter, 10) - viewed;
+
+ if (counter <= 0) {
+ counter = "0";
+ }
+
+ $(chat_list_item_id).find('.chat_notify_list').text(counter);
+
+ var subject_cbadge = $("#subject_" + sub_badge).find('.chat_notify'),
+ actual = subject_cbadge.text();
+
+ if (actual != "+99") {
+ actual = parseInt(actual, 10) - viewed;
+
+ if (actual <= 0) {
+ subject_cbadge.text("0");
+ subject_cbadge.hide();
+ }
+ }
+
setShortChatFormSubmit();
setFiltersSubmitAndPagination();
});
diff --git a/amadeus/static/js/mural_ungeneral.js b/amadeus/static/js/mural_ungeneral.js
index f240e8b..15e0fe4 100644
--- a/amadeus/static/js/mural_ungeneral.js
+++ b/amadeus/static/js/mural_ungeneral.js
@@ -50,6 +50,7 @@ $('.mural-ungeneral').on('shown.bs.collapse', function(e) {
actual = parseInt(actual, 10) - data.unviewed;
if (actual <= 0) {
+ $(this).text("0");
$(this).hide();
} else {
$(this).text(actual);
diff --git a/amadeus/static/js/socket.js b/amadeus/static/js/socket.js
index f715017..5c22a17 100644
--- a/amadeus/static/js/socket.js
+++ b/amadeus/static/js/socket.js
@@ -241,9 +241,14 @@ function messageReceived(content) {
$(this).hide();
});
+
+ $.ajax({
+ type: 'GET',
+ url: content.view_url
+ });
} else {
var talk_line = $("#talk-" + content.container),
- talk_notifies = talk_line.find('.chat_notify'),
+ talk_notifies = talk_line.find('.chat_notify_list'),
actual_count = talk_notifies.text(),
actual_date = talk_line.find(".talk-last_msg");
diff --git a/chat/templates/chat/_view.html b/chat/templates/chat/_view.html
index 6b97d15..ba47ddb 100644
--- a/chat/templates/chat/_view.html
+++ b/chat/templates/chat/_view.html
@@ -9,7 +9,7 @@