Merge branch 'develop' into issue/1276
authorMaksim Pechnikov <parallel588@gmail.com>
Tue, 7 Apr 2020 11:09:43 +0000 (14:09 +0300)
committerMaksim Pechnikov <parallel588@gmail.com>
Tue, 7 Apr 2020 11:09:43 +0000 (14:09 +0300)
1  2 
CHANGELOG.md
docs/API/differences_in_mastoapi_responses.md
test/notification_test.exs

diff --combined CHANGELOG.md
index b331ea83c47c16b4bf7c92da0fc557f6d7456e71,b6e5d807c47f19edf0e09785476dcedbdc495af0..888d24ddcb9e12970424e282ad2546053f09643c
@@@ -12,6 -12,7 +12,7 @@@ The format is based on [Keep a Changelo
  
  ### Added
  - NodeInfo: `pleroma:api/v1/notifications:include_types_filter` to the `features` list.
+ - NodeInfo: `pleroma_emoji_reactions` to the `features` list.
  - Configuration: `:restrict_unauthenticated` setting, restrict access for unauthenticated users to timelines (public and federate), user profiles and statuses.
  - New HTTP adapter [gun](https://github.com/ninenines/gun). Gun adapter requires minimum OTP version of 22.2 otherwise Pleroma won’t start. For hackney OTP update is not required.
  <details>
@@@ -75,7 -76,6 +76,7 @@@
  - Mastodon API: `pleroma.thread_muted` to the Status entity
  - Mastodon API: Mark the direct conversation as read for the author when they send a new direct message
  - Mastodon API, streaming: Add `pleroma.direct_conversation_id` to the `conversation` stream event payload.
 +- Mastodon API: Add `pleroma.unread_count` to the Marker entity
  - Admin API: Render whole status in grouped reports
  - Mastodon API: User timelines will now respect blocks, unless you are getting the user timeline of somebody you blocked (which would be empty otherwise).
  - Mastodon API: Favoriting / Repeating a post multiple times will now return the identical response every time. Before, executing that action twice would return an error ("already favorited") on the second try.
index 01be7787f5d5828d78ba7604e7f68252aab34d29,1059155cfccba73ec292a048f7fd5c13fbd3f9ed..0a7520f9e2e113ff9bc8e8e3e457def06c6c8fdf
@@@ -164,6 -164,7 +164,7 @@@ Additional parameters can be added to t
  - `actor_type` - the type of this account.
  
  ### Pleroma Settings Store
  Pleroma has mechanism that allows frontends to save blobs of json for each user on the backend. This can be used to save frontend-specific settings for a user that the backend does not need to know about.
  
  The parameter should have a form of `{frontend_name: {...}}`, with `frontend_name` identifying your type of client, e.g. `pleroma_fe`. It will overwrite everything under this property, but will not overwrite other frontend's settings.
@@@ -172,23 -173,20 +173,27 @@@ This information is returned in the `ve
  
  ## Authentication
  
- *Pleroma supports refreshing tokens.
+ *Pleroma supports refreshing tokens.*
  
  `POST /oauth/token`
- Post here request with grant_type=refresh_token to obtain new access token. Returns an access token.
+ Post here request with `grant_type=refresh_token` to obtain new access token. Returns an access token.
  
  ## Account Registration
  `POST /api/v1/accounts`
  
  Has theses additional parameters (which are the same as in Pleroma-API):
-     * `fullname`: optional
-     * `bio`: optional
-     * `captcha_solution`: optional, contains provider-specific captcha solution,
-     * `captcha_token`: optional, contains provider-specific captcha token
-     * `token`: invite token required when the registerations aren't public.
 -- `fullname`: optional
 -- `bio`: optional
 -- `captcha_solution`: optional, contains provider-specific captcha solution,
 -- `captcha_token`: optional, contains provider-specific captcha token
 -- `token`: invite token required when the registrations aren't public.
++ `fullname`: optional
++ `bio`: optional
++ `captcha_solution`: optional, contains provider-specific captcha solution,
++ `captcha_token`: optional, contains provider-specific captcha token
++ `token`: invite token required when the registrations aren't public.
++
 +
 +## Markers
 +
 +Has these additional fields under the `pleroma` object:
 +
 +- `unread_count`: contains number unread notifications
index c3d70c51febd92ef719e066f004d4ca3a016f4dc,837a9dacd17a9ea854878580817ebd4a39515430..f78a47af6a37ec48c14f8c91e35afdaf9f27a941
@@@ -45,9 -45,6 +45,9 @@@ defmodule Pleroma.NotificationTest d
        assert notified_ids == [other_user.id, third_user.id]
        assert notification.activity_id == activity.id
        assert other_notification.activity_id == activity.id
 +
 +      assert [%Pleroma.Marker{unread_count: 2}] =
 +               Pleroma.Marker.get_markers(other_user, ["notifications"])
      end
  
      test "it creates a notification for subscribed users" do
        assert n1.seen == true
        assert n2.seen == true
        assert n3.seen == false
 +
 +      assert %Pleroma.Marker{} =
 +               m =
 +               Pleroma.Repo.get_by(
 +                 Pleroma.Marker,
 +                 user_id: other_user.id,
 +                 timeline: "notifications"
 +               )
 +
 +      assert m.last_read_id == to_string(n2.id)
      end
    end
  
            "status" => "hey @#{other_user.nickname}!"
          })
  
-       {:ok, activity_two, _} = CommonAPI.favorite(activity_one.id, third_user)
+       {:ok, activity_two} = CommonAPI.favorite(third_user, activity_one.id)
  
        {enabled_receivers, _disabled_receivers} =
          Notification.get_notified_from_activity(activity_two)
  
        assert Enum.empty?(Notification.for_user(user))
  
-       {:ok, _, _} = CommonAPI.favorite(activity.id, other_user)
+       {:ok, _} = CommonAPI.favorite(other_user, activity.id)
  
        assert length(Notification.for_user(user)) == 1
  
  
        assert Enum.empty?(Notification.for_user(user))
  
-       {:ok, _, _} = CommonAPI.favorite(activity.id, other_user)
+       {:ok, _} = CommonAPI.favorite(other_user, activity.id)
  
        assert length(Notification.for_user(user)) == 1
  
  
        assert Enum.empty?(Notification.for_user(user))
  
-       {:error, _} = CommonAPI.favorite(activity.id, other_user)
+       {:error, :not_found} = CommonAPI.favorite(other_user, activity.id)
  
        assert Enum.empty?(Notification.for_user(user))
      end