summaryrefslogtreecommitdiff
path: root/users/app/controllers
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2014-02-10 11:00:28 -0800
committerjessib <jessib@riseup.net>2014-02-10 11:00:28 -0800
commita2289579eea138e0b7318f8866a0ed33f269761c (patch)
treea5fb064123600d53a1b8e93953818316f0d0a968 /users/app/controllers
parentb6ef51277b4e6d65cfda15f0124ae4f222f7f241 (diff)
parente3577906891f9ab0edd987544e3432f354bc1721 (diff)
Merge pull request #139 from azul/refactor/tweaks-to-messages
Refactor/tweaks to messages
Diffstat (limited to 'users/app/controllers')
-rw-r--r--users/app/controllers/v1/messages_controller.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/users/app/controllers/v1/messages_controller.rb b/users/app/controllers/v1/messages_controller.rb
index 90986e2..f71d0f1 100644
--- a/users/app/controllers/v1/messages_controller.rb
+++ b/users/app/controllers/v1/messages_controller.rb
@@ -13,10 +13,7 @@ module V1
def update
message = Message.find(params[:id])
if (message and current_user)
- message.user_ids_to_show.delete(current_user.id)
- # is it necessary to keep track of what users have already seen it?
- message.user_ids_have_shown << current_user.id if !message.user_ids_have_shown.include?(current_user.id)
- # TODO: is it quicker to call uniq! after adding rather than check if it is already included?
+ message.mark_as_read_by(current_user)
message.save
render json: true
else