Commit Graph

1613 Commits

Author SHA1 Message Date
Mark Felder 6a22a80f9f Pleroma.Web.MastodonAPI.DirectoryController: dialyzer errors
lib/pleroma/web/mastodon_api/controllers/directory_controller.ex:6:unused_fun
Function skip_auth/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/mastodon_api/controllers/directory_controller.ex:6:unused_fun
Function skip_plug/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/mastodon_api/controllers/directory_controller.ex:18:guard_fail
The guard clause:

when _action :: atom() == <<105, 110, 100, 101, 120>>

can never succeed.
2024-01-28 17:41:07 -05:00
Mark Felder e53c20b03c Pleroma.Web.MastodonAPI.AccountController: dialyzer errors
lib/pleroma/web/mastodon_api/controllers/account_controller.ex:479:call
The function call will not succeed.

Phoenix.Controller.render(
  _conn :: %{
    :assigns => %{:account => _, :user => _, _ => _},
    :body_params => %{:comment => _, _ => _},
    _ => _
  },
  <<114, 101, 108, 97, 116, 105, 111, 110, 115, 104, 105, 112, 46, 106, 115, 111, 110>>,
  [
    {:target, %Pleroma.User{:id => _, _ => _}} | {:user, %Pleroma.User{:id => _, _ => _}},
    ...
  ]
)

will never return since the success typing is:
(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{binary() => binary() | [any()] | map()},
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() => binary() | [any()] | map()
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{_, _}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{_, _}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | binary(),
  atom() | binary() | [{_, _}] | map()
) :: %Plug.Conn{
  :adapter => {atom(), _},
  :assigns => %{atom() => _},
  :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :halted => boolean(),
  :host => binary(),
  :method => binary(),
  :owner => pid(),
  :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :path_info => [binary()],
  :path_params => %{binary() => binary() | [any()] | map()},
  :port => char(),
  :private => %{atom() => _},
  :query_params => %Plug.Conn.Unfetched{
    :aspect => atom(),
    binary() => binary() | [any()] | map()
  },
  :query_string => binary(),
  :remote_ip =>
    {byte(), byte(), byte(), byte()}
    | {char(), char(), char(), char(), char(), char(), char(), char()},
  :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
  :req_headers => [{_, _}],
  :request_path => binary(),
  :resp_body =>
    nil
    | binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | byte(),
        binary() | []
      ),
  :resp_cookies => %{binary() => map()},
  :resp_headers => [{_, _}],
  :scheme => :http | :https,
  :script_name => [binary()],
  :secret_key_base => nil | binary(),
  :state => :sent,
  :status => nil | non_neg_integer()
}

and the contract is
(Plug.Conn.t(), binary() | atom(), Keyword.t() | map()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/mastodon_api/controllers/account_controller.ex:519:call
The function call will not succeed.

Plug.Conn.assign(
  _conn :: %{:body_params => %{:uri => _, _ => _}, _ => _},
  :account,
  _user :: %Pleroma.User{_ => _}
)

breaks the contract
(t(), atom(), term()) :: t()
2024-01-28 17:41:07 -05:00
marcin mikołajczak b39403a48f Update API docs for my changes
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-01-17 17:13:21 +01:00
Alexander Tumin 32d8e0d496 Fix authentication check on account rendering when bio is defined 2024-01-04 16:57:48 +03:00
Haelwenn ddc321a094 Merge branch 'tusooa/3205-group-actor' into 'develop'
Implement group actors

See merge request pleroma/pleroma!3969
2023-12-28 10:46:53 +00:00
marcin mikołajczak 017e35fbf1 Fix some more typos
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-12-28 00:17:04 +01:00
tusooa b273025fd7
Add pleroma:group_actors to instance features 2023-12-27 12:28:11 -05:00
tusooa 7a58ddfa48
Allow local user to have group actor type
https://git.pleroma.social/pleroma/pleroma/-/issues/3205
2023-12-27 12:27:37 -05:00
Haelwenn bd50892c25 Merge branch 'instance-v2' into 'develop'
Implement api/v2/instance route

See merge request pleroma/pleroma!3939
2023-12-21 21:14:46 +00:00
marcin mikołajczak 4f2fb8dc5e Use consistent terminology
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-12-21 00:13:13 +01:00
lain 29d202e1df Merge branch 'add-opengraph-rich-media-proxy' into 'develop'
Add media proxy to opengraph rich media cards

See merge request pleroma/pleroma!3997
2023-12-13 06:23:16 +00:00
Alexander Tumin e7af2addd8 Add media proxy to opengraph rich media cards 2023-12-12 18:32:02 +03:00
Lain Soykaf ef8a2134bc AccountView: Add test, refactor 2023-12-07 11:25:18 +04:00
Haelwenn (lanodan) Monnier 8ac7cc98c1 MastoAPI AccountView: Change last_status_at to be a date
Changed in Mastodon 3.1.0 with: https://github.com/tootsuite/mastodon/pull/12966
2023-11-16 15:52:01 +01:00
lain 752bc168f6 Merge branch 'quotes-count' into 'develop'
Count and display post quotes

See merge request pleroma/pleroma!3956
2023-11-12 13:38:09 +00:00
marcin mikołajczak 9a063deacc Count and display post quotes 2023-11-12 13:38:08 +00:00
Lain Soykaf 0c5cc51983 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into pleroma-meilisearch 2023-11-12 13:53:18 +04:00
Marcin Mikołajczak 1e9333a9aa Merge remote-tracking branch 'origin/develop' into instance-v2 2023-11-08 20:46:57 +01:00
marcin mikołajczak c6cedbb810 InstanceV2: skip auth
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-10-28 00:07:18 +02:00
tusooa a348c2e4dd
Use pleroma: instead of pleroma. for ws events 2023-10-15 17:20:25 -04:00
tusooa 7d005e8c93
Return stream attribute in server-sent events 2023-10-15 17:20:23 -04:00
tusooa 21395aa509
Allow authenticating via client-sent events 2023-10-15 17:19:49 -04:00
tusooa 273cda63ad
Allow subscribing to streams 2023-10-15 17:19:49 -04:00
tusooa 2b5636bf12
Allow unified streaming endpoint 2023-10-15 17:19:40 -04:00
tusooa 08608afca5
Fix quote_visible attribute 2023-09-13 19:20:33 -04:00
tusooa a8b2f9205d
Expose quote_id parameter on the api 2023-09-13 19:20:32 -04:00
Alex Gleason cf8e425883
StatusView: return quote post inside a reblog 2023-09-13 19:19:04 -04:00
Alex Gleason 74e0a4555f
StatusView: add `quote_visible` param 2023-09-13 19:19:04 -04:00
Alex Gleason 6f11f11519
StatusView: fix quote visibility 2023-09-13 19:19:04 -04:00
Alex Gleason 80ab2572a4
Return quote_url through the API, don't render quotes more than 1 level deep 2023-09-13 19:19:04 -04:00
Alex Gleason 5716f88a1d
InstanceView: add "quote_posting" feature 2023-09-13 19:19:03 -04:00
Alex Gleason 0d9c443e51
StatusView: render the whole quoted status 2023-09-13 19:19:03 -04:00
Alex Gleason ce5eb31723
StatusView: show quoted posts through the API, probably 2023-09-13 19:19:03 -04:00
marcin mikołajczak 28ef5ebd3c Update InstanceView.features
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-09-07 15:00:24 +02:00
marcin mikołajczak 79e46ce73f InstanceView: Add common_information function
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-08-11 13:57:22 +02:00
marcin mikołajczak 9effa24f30 Implement api/v2/instance route
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-08-11 00:08:05 +02:00
tusooa 2c66f584b5
Show more informative errors when profile exceeds char limits 2023-05-25 08:22:33 -04:00
tusooa c5d946bc92
Fix emoji reactions for legacy 2-tuple formats 2023-03-26 15:12:40 -04:00
Haelwenn 353538d16c Merge branch 'pleroma-akkoma-emoji-port' into 'develop'
Custom emoji reactions support

See merge request pleroma/pleroma!3845
2023-03-16 08:00:00 +00:00
Alexander Tumin 2c2ea16b50 Allow custom emoji reactions: Add pleroma_custom_emoji_reactions feature, review changes 2023-03-12 11:39:17 +03:00
Alexander Tumin 8d3b29aaba Allow custom emoji reactions: add test for mixed emoji react, fix credo errors 2023-03-02 11:18:16 +03:00
Alexander Tumin 4b85d1c617 Allow custom emoji reactions: Fix tests, mixed custom and unicode reactions 2023-03-02 11:18:16 +03:00
floatingghost 787e30c5fd Allow reacting with remote emoji when they exist on the post (#200)
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/200
2023-03-02 11:18:16 +03:00
tusooa d83f16fe44
Allow with_relationships param for blocks 2023-02-28 22:16:01 -05:00
lain 755279e253 Merge branch 'tusooa/api-spec-property-map' into 'develop'
OpenApiSpex: overhaul

See merge request pleroma/pleroma!3832
2023-02-09 19:50:59 +00:00
tusooa bc7ec43179
Allow customizing instance languages 2023-01-26 20:17:13 -05:00
tusooa 97f947deaf
Fix tests 2023-01-15 21:39:05 -05:00
lain e853cfe7c3 Revert "Merge branch 'copyright-bump' into 'develop'"
This reverts merge request !3825
2023-01-02 20:38:50 +00:00
marcin mikołajczak 10886eeaa2 Bump copyright year
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-01-01 12:13:06 +01:00
Sean King 90681c720d
Make lint happy 2022-12-21 23:40:39 -07:00