diff --git a/Changelog.md b/Changelog.md index b8693d599441c3a43bc28746ef507f080c6dc9e1..cd77627df82fdee3fd6290729921a627f092ba19 100644 --- a/Changelog.md +++ b/Changelog.md @@ -129,9 +129,10 @@ Contributions are very welcome, the hard work is done! ## Bug fixes * Fix empty name field when editing aspect names [#6706](https://github.com/diaspora/diaspora/pull/6706) * Fix internal server error when trying to log out of an expired session [#6707](https://github.com/diaspora/diaspora/pull/6707) +* Only mark unread notifications as read [#6711](https://github.com/diaspora/diaspora/pull/6711) ## Features -* Added the footer to conversation pages +* Added the footer to conversation pages [#6710](https://github.com/diaspora/diaspora/pull/6710) # 0.5.7.0 diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index a9a873c2e9b84e3709370d289d7b721d8b75ac35..2d7a5f4ef00f06bfad18b0357ce370909006986f 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -61,9 +61,9 @@ class NotificationsController < ApplicationController def read_all current_type = Notification.types[params[:type]] - notifications = Notification.where(:recipient_id => current_user.id) - notifications = notifications.where(:type => current_type) if params[:type] - notifications.update_all(:unread => false) + notifications = Notification.where(recipient_id: current_user.id, unread: true) + notifications = notifications.where(type: current_type) if params[:type] + notifications.update_all(unread: false) respond_to do |format| if current_user.unread_notifications.count > 0 format.html { redirect_to notifications_path } @@ -75,7 +75,6 @@ class NotificationsController < ApplicationController format.xml { render :xml => {}.to_xml } format.json { render :json => {}.to_json } end - end end