Merge branch 'develop' into issue/1276-2
authorMaksim Pechnikov <parallel588@gmail.com>
Wed, 6 May 2020 11:47:50 +0000 (14:47 +0300)
committerMaksim Pechnikov <parallel588@gmail.com>
Wed, 6 May 2020 11:47:50 +0000 (14:47 +0300)
1  2 
CHANGELOG.md
lib/pleroma/web/mastodon_api/views/marker_view.ex
test/web/mastodon_api/controllers/marker_controller_test.exs

diff --cc CHANGELOG.md
Simple merge
index 415dae93b43b491a6bd5ce3606649d2e438c912d,9705b7a914290d1ed3a58f60d81e1b7603877cc9..21d535d54e4cde064d82dd9f6227fa0ff9b0900a
@@@ -6,15 -6,13 +6,16 @@@ defmodule Pleroma.Web.MastodonAPI.Marke
    use Pleroma.Web, :view
  
    def render("markers.json", %{markers: markers}) do
-     Enum.reduce(markers, %{}, fn m, acc ->
-       Map.put_new(acc, m.timeline, %{
-         last_read_id: m.last_read_id,
-         version: m.lock_version,
-         updated_at: NaiveDateTime.to_iso8601(m.updated_at),
-         pleroma: %{
-           unread_count: m.unread_count
-         }
-       })
+     Map.new(markers, fn m ->
+       {m.timeline,
+        %{
+          last_read_id: m.last_read_id,
+          version: m.lock_version,
 -         updated_at: NaiveDateTime.to_iso8601(m.updated_at)
++         updated_at: NaiveDateTime.to_iso8601(m.updated_at),
++         pleroma: %{
++           unread_count: m.unread_count
++         }
+        }}
      end)
    end
  end