Resolve conflicts
authorRoman Chvanikov <chvanikoff@pm.me>
Thu, 6 Jun 2019 22:20:50 +0000 (01:20 +0300)
committerRoman Chvanikov <chvanikoff@pm.me>
Thu, 6 Jun 2019 22:20:50 +0000 (01:20 +0300)
1  2 
CHANGELOG.md
config/config.exs
config/test.exs
docs/config.md
lib/pleroma/application.ex
lib/pleroma/user.ex
test/user_test.exs

diff --cc CHANGELOG.md
index da7623cae844f96e8574c32dd6679b8adbe030e1,cf2232b09defbbd1e1f2e3d441f407602531335e..df387e8ac2e514931b0241e514bba49548c6ad38
@@@ -5,8 -5,8 +5,9 @@@ The format is based on [Keep a Changelo
  
  ## [unreleased]
  ### Added
 +- Digest email for inactive users
  - Add a generic settings store for frontends / clients to use.
+ - Explicit addressing option for posting.
  - Optional SSH access mode. (Needs `erlang-ssh` package on some distributions).
  - [MongooseIM](https://github.com/esl/MongooseIM) http authentication support.
  - LDAP authentication
@@@ -27,7 -27,7 +28,8 @@@
  - Configuration: `notify_email` option
  - Configuration: Media proxy `whitelist` option
  - Configuration: `report_uri` option
 +- Configuration: `email_notifications` option
+ - Configuration: `limit_unauthenticated_to_local_content` option
  - Pleroma API: User subscriptions
  - Pleroma API: Healthcheck endpoint
  - Pleroma API: `/api/v1/pleroma/mascot` per-user frontend mascot configuration endpoints
Simple merge
diff --cc config/test.exs
Simple merge
diff --cc docs/config.md
index c1d20e0cc998d543bbe597e7b155304c8dbc01cb,c61a5d8a3cc587e55bd01ce8043e8a7bde137793..5ed7fb299f078eb4ee28f218efe3fc1b2ae2d9ac
@@@ -514,20 -515,8 +515,20 @@@ Authentication / authorization settings
  
  * `auth_template`: authentication form template. By default it's `show.html` which corresponds to `lib/pleroma/web/templates/o_auth/o_auth/show.html.eex`.
  * `oauth_consumer_template`: OAuth consumer mode authentication form template. By default it's `consumer.html` which corresponds to `lib/pleroma/web/templates/o_auth/o_auth/consumer.html.eex`.
- * `oauth_consumer_strategies`: the list of enabled OAuth consumer strategies; by default it's set by OAUTH_CONSUMER_STRATEGIES environment variable. Each entry in this space-delimited string should be of format `<strategy>` or `<strategy>:<dependency>` (e.g. `twitter` or `keycloak:ueberauth_keycloak_strategy` in case dependency is named differently than `ueberauth_<strategy>`).
+ * `oauth_consumer_strategies`: the list of enabled OAuth consumer strategies; by default it's set by `OAUTH_CONSUMER_STRATEGIES` environment variable. Each entry in this space-delimited string should be of format `<strategy>` or `<strategy>:<dependency>` (e.g. `twitter` or `keycloak:ueberauth_keycloak_strategy` in case dependency is named differently than `ueberauth_<strategy>`).
  
 +## :email_notifications
 +
 +Email notifications settings.
 +
 +  - digest - emails of "what you've missed" for users who have been
 +    inactive for a while.
 +    - active: globally enable or disable digest emails
 +    - schedule: When to send digest email, in [crontab format](https://en.wikipedia.org/wiki/Cron).
 +      "0 0 * * 0" is the default, meaning "once a week at midnight on Sunday morning"
 +    - interval: Minimum interval between digest emails to one user
 +    - inactivity_threshold: Minimum user inactivity threshold
 +
  ## OAuth consumer mode
  
  OAuth consumer mode allows sign in / sign up via external OAuth providers (e.g. Twitter, Facebook, Google, Microsoft, etc.).
index acc314df1a586a46543d97c610d22a64b122bc67,69a8a576117ac46af5fc303b7c44ab7fe8538e5c..664cf578e88f8da497edba186e6acfab2032afc7
@@@ -31,82 -30,91 +30,95 @@@ defmodule Pleroma.Application d
      children =
        [
          # Start the Ecto repository
-         supervisor(Pleroma.Repo, []),
-         worker(Pleroma.Emoji, []),
-         worker(Pleroma.Captcha, []),
-         worker(
-           Cachex,
-           [
-             :used_captcha_cache,
-             [
-               ttl_interval: :timer.seconds(Pleroma.Config.get!([Pleroma.Captcha, :seconds_valid]))
-             ]
-           ],
-           id: :cachex_used_captcha_cache
-         ),
-         worker(
-           Cachex,
-           [
-             :user_cache,
-             [
-               default_ttl: 25_000,
-               ttl_interval: 1000,
-               limit: 2500
-             ]
-           ],
-           id: :cachex_user
-         ),
-         worker(
-           Cachex,
-           [
-             :object_cache,
-             [
-               default_ttl: 25_000,
-               ttl_interval: 1000,
-               limit: 2500
-             ]
-           ],
-           id: :cachex_object
-         ),
-         worker(
-           Cachex,
-           [
-             :rich_media_cache,
-             [
-               default_ttl: :timer.minutes(120),
-               limit: 5000
-             ]
-           ],
-           id: :cachex_rich_media
-         ),
-         worker(
-           Cachex,
-           [
-             :scrubber_cache,
-             [
-               limit: 2500
-             ]
-           ],
-           id: :cachex_scrubber
-         ),
-         worker(
-           Cachex,
-           [
-             :idempotency_cache,
-             [
-               expiration:
-                 expiration(
-                   default: :timer.seconds(6 * 60 * 60),
-                   interval: :timer.seconds(60)
-                 ),
-               limit: 2500
-             ]
-           ],
-           id: :cachex_idem
-         ),
-         worker(Pleroma.FlakeId, []),
-         worker(Pleroma.ScheduledActivityWorker, []),
-         worker(Pleroma.QuantumScheduler, [])
+         %{id: Pleroma.Repo, start: {Pleroma.Repo, :start_link, []}, type: :supervisor},
+         %{id: Pleroma.Emoji, start: {Pleroma.Emoji, :start_link, []}},
+         %{id: Pleroma.Captcha, start: {Pleroma.Captcha, :start_link, []}},
+         %{
+           id: :cachex_used_captcha_cache,
+           start:
+             {Cachex, :start_link,
+              [
+                :used_captcha_cache,
+                [
+                  ttl_interval:
+                    :timer.seconds(Pleroma.Config.get!([Pleroma.Captcha, :seconds_valid]))
+                ]
+              ]}
+         },
+         %{
+           id: :cachex_user,
+           start:
+             {Cachex, :start_link,
+              [
+                :user_cache,
+                [
+                  default_ttl: 25_000,
+                  ttl_interval: 1000,
+                  limit: 2500
+                ]
+              ]}
+         },
+         %{
+           id: :cachex_object,
+           start:
+             {Cachex, :start_link,
+              [
+                :object_cache,
+                [
+                  default_ttl: 25_000,
+                  ttl_interval: 1000,
+                  limit: 2500
+                ]
+              ]}
+         },
+         %{
+           id: :cachex_rich_media,
+           start:
+             {Cachex, :start_link,
+              [
+                :rich_media_cache,
+                [
+                  default_ttl: :timer.minutes(120),
+                  limit: 5000
+                ]
+              ]}
+         },
+         %{
+           id: :cachex_scrubber,
+           start:
+             {Cachex, :start_link,
+              [
+                :scrubber_cache,
+                [
+                  limit: 2500
+                ]
+              ]}
+         },
+         %{
+           id: :cachex_idem,
+           start:
+             {Cachex, :start_link,
+              [
+                :idempotency_cache,
+                [
+                  expiration:
+                    expiration(
+                      default: :timer.seconds(6 * 60 * 60),
+                      interval: :timer.seconds(60)
+                    ),
+                  limit: 2500
+                ]
+              ]}
+         },
+         %{id: Pleroma.FlakeId, start: {Pleroma.FlakeId, :start_link, []}},
+         %{
+           id: Pleroma.ScheduledActivityWorker,
+           start: {Pleroma.ScheduledActivityWorker, :start_link, []}
++        },
++        %{
++          id: Pleroma.QuantumScheduler,
++          start: {Pleroma.QuantumScheduler, :start_link, []}
+         }
        ] ++
          hackney_pool_children() ++
          [
Simple merge
index 8a16dc495753064ab840ba6b3104067a5207587d,8dd672173cf33412a3a49e0b4416595e87468603..157fdfbd75924f29a0fdff18add29b85b45ce856
@@@ -1097,17 -1137,17 +1137,20 @@@ defmodule Pleroma.UserTest d
      end
  
      test "works with URIs" do
-       [result] = User.search("http://mastodon.example.org/users/admin", resolve: true)
+       user = insert(:user)
 -      results =
++      [result] =
+         User.search("http://mastodon.example.org/users/admin", resolve: true, for_user: user)
 -      result = results |> List.first()
 -
+       user = User.get_cached_by_ap_id("http://mastodon.example.org/users/admin")
  
 -      assert length(results) == 1
 -      assert user == result |> Map.put(:search_rank, nil) |> Map.put(:search_type, nil)
 +      expected =
 +        result
 +        |> Map.put(:search_rank, nil)
 +        |> Map.put(:search_type, nil)
 +        |> Map.put(:last_digest_emailed_at, nil)
 +
-       user = User.get_cached_by_ap_id("http://mastodon.example.org/users/admin")
 +      assert user == expected
      end
    end