]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/api/messages/_message.xml.builder
Merge pull request #5421 from tomhughes/ecma-version
[rails.git] / app / views / api / messages / _message.xml.builder
index 64ac9e3bcc0d8aecb442a4661221496f7d65cc12..2ab307f1ab1e848cd0b433832d6c5f479bb6e401 100644 (file)
@@ -8,10 +8,11 @@ attrs = {
   "body_format" => message.body_format
 }
 
   "body_format" => message.body_format
 }
 
+attrs["message_read"] = message.message_read if current_user.id == message.to_user_id
+
 if current_user.id == message.from_user_id
   attrs["deleted"] = !message.from_user_visible
 elsif current_user.id == message.to_user_id
 if current_user.id == message.from_user_id
   attrs["deleted"] = !message.from_user_visible
 elsif current_user.id == message.to_user_id
-  attrs["message_read"] = message.message_read
   attrs["deleted"] = !message.to_user_visible
 end
 
   attrs["deleted"] = !message.to_user_visible
 end