Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into feature/jobs

# Conflicts:
#	lib/pleroma/web/activity_pub/activity_pub.ex
#	lib/pleroma/web/federator/federator.ex
This commit is contained in:
Egor Kislitsyn 2019-02-04 20:50:28 +07:00
commit 3a3a3996b7
604 changed files with 7319 additions and 692 deletions

View file

@ -146,6 +146,7 @@
banner_upload_limit: 4_000_000, banner_upload_limit: 4_000_000,
registrations_open: true, registrations_open: true,
federating: true, federating: true,
federation_reachability_timeout_days: 7,
allow_relay: true, allow_relay: true,
rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy, rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
public: true, public: true,
@ -226,7 +227,9 @@
allow_followersonly: false, allow_followersonly: false,
allow_direct: false allow_direct: false
config :pleroma, :mrf_hellthread, threshold: 10 config :pleroma, :mrf_hellthread,
delist_threshold: 5,
reject_threshold: 10
config :pleroma, :mrf_simple, config :pleroma, :mrf_simple,
media_removal: [], media_removal: [],
@ -235,6 +238,8 @@
reject: [], reject: [],
accept: [] accept: []
config :pleroma, :rich_media, enabled: true
config :pleroma, :media_proxy, config :pleroma, :media_proxy,
enabled: false, enabled: false,
proxy_opts: [ proxy_opts: [

View file

@ -36,6 +36,7 @@
config :pleroma, :websub, Pleroma.Web.WebsubMock config :pleroma, :websub, Pleroma.Web.WebsubMock
config :pleroma, :ostatus, Pleroma.Web.OStatusMock config :pleroma, :ostatus, Pleroma.Web.OStatusMock
config :tesla, adapter: Tesla.Mock config :tesla, adapter: Tesla.Mock
config :pleroma, :rich_media, enabled: false
config :web_push_encryption, :vapid_details, config :web_push_encryption, :vapid_details,
subject: "mailto:administrator@example.com", subject: "mailto:administrator@example.com",

View file

@ -52,6 +52,7 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi
* `confirm` * `confirm`
* `captcha_solution`: optional, contains provider-specific captcha solution, * `captcha_solution`: optional, contains provider-specific captcha solution,
* `captcha_token`: optional, contains provider-specific captcha token * `captcha_token`: optional, contains provider-specific captcha token
* `token`: invite token required when the registerations aren't public.
* Response: JSON. Returns a user object on success, otherwise returns `{"error": "error_msg"}` * Response: JSON. Returns a user object on success, otherwise returns `{"error": "error_msg"}`
* Example response: * Example response:
``` ```

View file

@ -17,7 +17,7 @@ Note: `strip_exif` has been replaced by `Pleroma.Upload.Filter.Mogrify`.
## Pleroma.Upload.Filter.Mogrify ## Pleroma.Upload.Filter.Mogrify
* `args`: List of actions for the `mogrify` command like `"strip"` or `["strip", {"impode", "1"}]`. * `args`: List of actions for the `mogrify` command like `"strip"` or `["strip", "auto-orient", {"impode", "1"}]`.
## Pleroma.Upload.Filter.Dedupe ## Pleroma.Upload.Filter.Dedupe
@ -73,6 +73,7 @@ config :pleroma, Pleroma.Mailer,
* `invites_enabled`: Enable user invitations for admins (depends on `registrations_open: false`). * `invites_enabled`: Enable user invitations for admins (depends on `registrations_open: false`).
* `account_activation_required`: Require users to confirm their emails before signing in. * `account_activation_required`: Require users to confirm their emails before signing in.
* `federating`: Enable federation with other instances * `federating`: Enable federation with other instances
* `federation_reachability_timeout_days`: Timeout (in days) of each external federation target being unreachable prior to pausing federating to it.
* `allow_relay`: Enable Pleromas Relay, which makes it possible to follow a whole instance * `allow_relay`: Enable Pleromas Relay, which makes it possible to follow a whole instance
* `rewrite_policy`: Message Rewrite Policy, either one or a list. Here are the ones available by default: * `rewrite_policy`: Message Rewrite Policy, either one or a list. Here are the ones available by default:
* `Pleroma.Web.ActivityPub.MRF.NoOpPolicy`: Doesnt modify activities (default) * `Pleroma.Web.ActivityPub.MRF.NoOpPolicy`: Doesnt modify activities (default)
@ -124,7 +125,7 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i
* `theme`: Which theme to use, they are defined in ``styles.json`` * `theme`: Which theme to use, they are defined in ``styles.json``
* `logo`: URL of the logo, defaults to Pleromas logo * `logo`: URL of the logo, defaults to Pleromas logo
* `logo_mask`: Whenether to mask the logo * `logo_mask`: Whether to use only the logo's shape as a mask (true) or as a regular image (false)
* `logo_margin`: What margin to use around the logo * `logo_margin`: What margin to use around the logo
* `background`: URL of the background, unless viewing a user profile with a background that is set * `background`: URL of the background, unless viewing a user profile with a background that is set
* `redirect_root_no_login`: relative URL which indicates where to redirect when a user isnt logged in. * `redirect_root_no_login`: relative URL which indicates where to redirect when a user isnt logged in.
@ -148,7 +149,8 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i
* `allow_direct`: whether to allow direct messages * `allow_direct`: whether to allow direct messages
## :mrf_hellthread ## :mrf_hellthread
* `threshold`: Number of mentioned users after which the message gets discarded as spam * `delist_threshold`: Number of mentioned users after which the message gets delisted (the message can still be seen, but it will not show up in public timelines and mentioned users won't get notifications about it). Set to 0 to disable.
* `reject_threshold`: Number of mentioned users after which the messaged gets rejected. Set to 0 to disable.
## :media_proxy ## :media_proxy
* `enabled`: Enables proxying of remote media to the instances proxy * `enabled`: Enables proxying of remote media to the instances proxy
@ -252,6 +254,9 @@ This config contains two queues: `federator_incoming` and `federator_outgoing`.
* Pleroma.Web.Metadata.Providers.TwitterCard * Pleroma.Web.Metadata.Providers.TwitterCard
* `unfurl_nsfw`: If set to `true` nsfw attachments will be shown in previews * `unfurl_nsfw`: If set to `true` nsfw attachments will be shown in previews
## :rich_media
* `enabled`: if enabled the instance will parse metadata from attached links to generate link previews
## :hackney_pools ## :hackney_pools
Advanced. Tweaks Hackney (http client) connections pools. Advanced. Tweaks Hackney (http client) connections pools.

View file

@ -6,11 +6,13 @@ defmodule Pleroma.Application do
use Application use Application
import Supervisor.Spec import Supervisor.Spec
@name "Pleroma" @name Mix.Project.config()[:name]
@version Mix.Project.config()[:version] @version Mix.Project.config()[:version]
@repository Mix.Project.config()[:source_url]
def name, do: @name def name, do: @name
def version, do: @version def version, do: @version
def named_version(), do: @name <> " " <> @version def named_version(), do: @name <> " " <> @version
def repository, do: @repository
def user_agent() do def user_agent() do
info = "#{Pleroma.Web.base_url()} <#{Pleroma.Config.get([:instance, :email], "")}>" info = "#{Pleroma.Web.base_url()} <#{Pleroma.Config.get([:instance, :email], "")}>"

View file

@ -12,6 +12,13 @@ def check_frontend_config_mechanism() do
You are using the old configuration mechanism for the frontend. Please check config.md. You are using the old configuration mechanism for the frontend. Please check config.md.
""") """)
end end
if Pleroma.Config.get(:mrf_hellthread, :threshold) do
Logger.warn("""
!!!DEPRECATION WARNING!!!
You are using the old configuration mechanism for the hellthread filter. Please check config.md.
""")
end
end end
def warn do def warn do

36
lib/pleroma/instances.ex Normal file
View file

@ -0,0 +1,36 @@
defmodule Pleroma.Instances do
@moduledoc "Instances context."
@adapter Pleroma.Instances.Instance
defdelegate filter_reachable(urls_or_hosts), to: @adapter
defdelegate reachable?(url_or_host), to: @adapter
defdelegate set_reachable(url_or_host), to: @adapter
defdelegate set_unreachable(url_or_host, unreachable_since \\ nil), to: @adapter
def set_consistently_unreachable(url_or_host),
do: set_unreachable(url_or_host, reachability_datetime_threshold())
def reachability_datetime_threshold do
federation_reachability_timeout_days =
Pleroma.Config.get(:instance)[:federation_reachability_timeout_days] || 0
if federation_reachability_timeout_days > 0 do
NaiveDateTime.add(
NaiveDateTime.utc_now(),
-federation_reachability_timeout_days * 24 * 3600,
:second
)
else
~N[0000-01-01 00:00:00]
end
end
def host(url_or_host) when is_binary(url_or_host) do
if url_or_host =~ ~r/^http/i do
URI.parse(url_or_host).host
else
url_or_host
end
end
end

View file

@ -0,0 +1,113 @@
defmodule Pleroma.Instances.Instance do
@moduledoc "Instance."
alias Pleroma.Instances
alias Pleroma.Instances.Instance
use Ecto.Schema
import Ecto.{Query, Changeset}
alias Pleroma.Repo
schema "instances" do
field(:host, :string)
field(:unreachable_since, :naive_datetime)
timestamps()
end
defdelegate host(url_or_host), to: Instances
def changeset(struct, params \\ %{}) do
struct
|> cast(params, [:host, :unreachable_since])
|> validate_required([:host])
|> unique_constraint(:host)
end
def filter_reachable([]), do: %{}
def filter_reachable(urls_or_hosts) when is_list(urls_or_hosts) do
hosts =
urls_or_hosts
|> Enum.map(&(&1 && host(&1)))
|> Enum.filter(&(to_string(&1) != ""))
unreachable_since_by_host =
Repo.all(
from(i in Instance,
where: i.host in ^hosts,
select: {i.host, i.unreachable_since}
)
)
|> Map.new(& &1)
reachability_datetime_threshold = Instances.reachability_datetime_threshold()
for entry <- Enum.filter(urls_or_hosts, &is_binary/1) do
host = host(entry)
unreachable_since = unreachable_since_by_host[host]
if !unreachable_since ||
NaiveDateTime.compare(unreachable_since, reachability_datetime_threshold) == :gt do
{entry, unreachable_since}
end
end
|> Enum.filter(& &1)
|> Map.new(& &1)
end
def reachable?(url_or_host) when is_binary(url_or_host) do
!Repo.one(
from(i in Instance,
where:
i.host == ^host(url_or_host) and
i.unreachable_since <= ^Instances.reachability_datetime_threshold(),
select: true
)
)
end
def reachable?(_), do: true
def set_reachable(url_or_host) when is_binary(url_or_host) do
with host <- host(url_or_host),
%Instance{} = existing_record <- Repo.get_by(Instance, %{host: host}) do
{:ok, _instance} =
existing_record
|> changeset(%{unreachable_since: nil})
|> Repo.update()
end
end
def set_reachable(_), do: {:error, nil}
def set_unreachable(url_or_host, unreachable_since \\ nil)
def set_unreachable(url_or_host, unreachable_since) when is_binary(url_or_host) do
unreachable_since = unreachable_since || DateTime.utc_now()
host = host(url_or_host)
existing_record = Repo.get_by(Instance, %{host: host})
changes = %{unreachable_since: unreachable_since}
cond do
is_nil(existing_record) ->
%Instance{}
|> changeset(Map.put(changes, :host, host))
|> Repo.insert()
existing_record.unreachable_since &&
NaiveDateTime.compare(existing_record.unreachable_since, unreachable_since) != :gt ->
{:ok, existing_record}
true ->
existing_record
|> changeset(changes)
|> Repo.update()
end
end
def set_unreachable(_, _), do: {:error, nil}
end

View file

@ -31,8 +31,8 @@ def get_by_ap_id(ap_id) do
Repo.one(from(object in Object, where: fragment("(?)->>'id' = ?", object.data, ^ap_id))) Repo.one(from(object in Object, where: fragment("(?)->>'id' = ?", object.data, ^ap_id)))
end end
def normalize(obj) when is_map(obj), do: Object.get_by_ap_id(obj["id"]) def normalize(%{"id" => ap_id}), do: normalize(ap_id)
def normalize(ap_id) when is_binary(ap_id), do: Object.get_by_ap_id(ap_id) def normalize(ap_id) when is_binary(ap_id), do: get_cached_by_ap_id(ap_id)
def normalize(_), do: nil def normalize(_), do: nil
# Owned objects can only be mutated by their owner # Owned objects can only be mutated by their owner
@ -42,11 +42,6 @@ def authorize_mutation(%Object{data: %{"actor" => actor}}, %User{ap_id: ap_id}),
# Legacy objects can be mutated by anybody # Legacy objects can be mutated by anybody
def authorize_mutation(%Object{}, %User{}), do: true def authorize_mutation(%Object{}, %User{}), do: true
if Mix.env() == :test do
def get_cached_by_ap_id(ap_id) do
get_by_ap_id(ap_id)
end
else
def get_cached_by_ap_id(ap_id) do def get_cached_by_ap_id(ap_id) do
key = "object:#{ap_id}" key = "object:#{ap_id}"
@ -60,7 +55,6 @@ def get_cached_by_ap_id(ap_id) do
end end
end) end)
end end
end
def context_mapping(context) do def context_mapping(context) do
Object.change(%Object{}, %{data: %{"id" => context}}) Object.change(%Object{}, %{data: %{"id" => context}})
@ -90,4 +84,17 @@ def delete(%Object{data: %{"id" => id}} = object) do
{:ok, object} {:ok, object}
end end
end end
def set_cache(%Object{data: %{"id" => ap_id}} = object) do
Cachex.put(:object_cache, "object:#{ap_id}", object)
{:ok, object}
end
def update_and_set_cache(changeset) do
with {:ok, object} <- Repo.update(changeset) do
set_cache(object)
else
e -> e
end
end
end end

View file

@ -21,7 +21,7 @@ def file_path(path) do
end end
end end
@only ~w(index.html static emoji packs sounds images instance favicon.png) @only ~w(index.html static emoji packs sounds images instance favicon.png sw.js sw-pleroma.js)
def init(opts) do def init(opts) do
opts opts

View file

@ -124,10 +124,10 @@ defp get_opts(opts) do
:pleroma, Pleroma.Upload, [filters: [Pleroma.Upload.Filter.Mogrify]] :pleroma, Pleroma.Upload, [filters: [Pleroma.Upload.Filter.Mogrify]]
:pleroma, Pleroma.Upload.Filter.Mogrify, args: "strip" :pleroma, Pleroma.Upload.Filter.Mogrify, args: ["strip", "auto-orient"]
""") """)
Pleroma.Config.put([Pleroma.Upload.Filter.Mogrify], args: "strip") Pleroma.Config.put([Pleroma.Upload.Filter.Mogrify], args: ["strip", "auto-orient"])
Map.put(opts, :filters, opts.filters ++ [Pleroma.Upload.Filter.Mogrify]) Map.put(opts, :filters, opts.filters ++ [Pleroma.Upload.Filter.Mogrify])
else else
opts opts

View file

@ -39,6 +39,7 @@ defmodule Pleroma.User do
field(:follower_address, :string) field(:follower_address, :string)
field(:search_rank, :float, virtual: true) field(:search_rank, :float, virtual: true)
field(:tags, {:array, :string}, default: []) field(:tags, {:array, :string}, default: [])
field(:bookmarks, {:array, :string}, default: [])
field(:last_refreshed_at, :naive_datetime) field(:last_refreshed_at, :naive_datetime)
has_many(:notifications, Notification) has_many(:notifications, Notification)
embeds_one(:info, Pleroma.User.Info) embeds_one(:info, Pleroma.User.Info)
@ -314,7 +315,16 @@ def follow_all(follower, followeds) do
q = q =
from(u in User, from(u in User,
where: u.id == ^follower.id, where: u.id == ^follower.id,
update: [set: [following: fragment("array_cat(?, ?)", u.following, ^followed_addresses)]] update: [
set: [
following:
fragment(
"array(select distinct unnest (array_cat(?, ?)))",
u.following,
^followed_addresses
)
]
]
) )
{1, [follower]} = Repo.update_all(q, [], returning: true) {1, [follower]} = Repo.update_all(q, [], returning: true)
@ -1161,6 +1171,22 @@ defp update_tags(%User{} = user, new_tags) do
updated_user updated_user
end end
def bookmark(%User{} = user, status_id) do
bookmarks = Enum.uniq(user.bookmarks ++ [status_id])
update_bookmarks(user, bookmarks)
end
def unbookmark(%User{} = user, status_id) do
bookmarks = Enum.uniq(user.bookmarks -- [status_id])
update_bookmarks(user, bookmarks)
end
def update_bookmarks(%User{} = user, bookmarks) do
user
|> change(%{bookmarks: bookmarks})
|> update_and_set_cache
end
defp normalize_tags(tags) do defp normalize_tags(tags) do
[tags] [tags]
|> List.flatten() |> List.flatten()

View file

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only # SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ActivityPub do defmodule Pleroma.Web.ActivityPub.ActivityPub do
alias Pleroma.{Activity, Repo, Object, Upload, User, Notification} alias Pleroma.{Activity, Repo, Object, Upload, User, Notification, Instances}
alias Pleroma.Web.ActivityPub.{Transmogrifier, MRF} alias Pleroma.Web.ActivityPub.{Transmogrifier, MRF}
alias Pleroma.Web.WebFinger alias Pleroma.Web.WebFinger
alias Pleroma.Web.Federator alias Pleroma.Web.Federator
@ -734,7 +734,7 @@ def should_federate?(inbox, public) do
end end
def publish(actor, activity) do def publish(actor, activity) do
followers = remote_followers =
if actor.follower_address in activity.recipients do if actor.follower_address in activity.recipients do
{:ok, followers} = User.get_followers(actor) {:ok, followers} = User.get_followers(actor)
followers |> Enum.filter(&(!&1.local)) followers |> Enum.filter(&(!&1.local))
@ -747,24 +747,26 @@ def publish(actor, activity) do
{:ok, data} = Transmogrifier.prepare_outgoing(activity.data) {:ok, data} = Transmogrifier.prepare_outgoing(activity.data)
json = Jason.encode!(data) json = Jason.encode!(data)
(Pleroma.Web.Salmon.remote_users(activity) ++ followers) (Pleroma.Web.Salmon.remote_users(activity) ++ remote_followers)
|> Enum.filter(fn user -> User.ap_enabled?(user) end) |> Enum.filter(fn user -> User.ap_enabled?(user) end)
|> Enum.map(fn %{info: %{source_data: data}} -> |> Enum.map(fn %{info: %{source_data: data}} ->
(is_map(data["endpoints"]) && Map.get(data["endpoints"], "sharedInbox")) || data["inbox"] (is_map(data["endpoints"]) && Map.get(data["endpoints"], "sharedInbox")) || data["inbox"]
end) end)
|> Enum.uniq() |> Enum.uniq()
|> Enum.filter(fn inbox -> should_federate?(inbox, public) end) |> Enum.filter(fn inbox -> should_federate?(inbox, public) end)
|> Enum.each(fn inbox -> |> Instances.filter_reachable()
|> Enum.each(fn {inbox, unreachable_since} ->
Federator.publish_single_ap(%{ Federator.publish_single_ap(%{
inbox: inbox, inbox: inbox,
json: json, json: json,
actor: actor, actor: actor,
id: activity.data["id"] id: activity.data["id"],
unreachable_since: unreachable_since
}) })
end) end)
end end
def publish_one(%{inbox: inbox, json: json, actor: actor, id: id}) do def publish_one(%{inbox: inbox, json: json, actor: actor, id: id} = params) do
Logger.info("Federating #{id} to #{inbox}") Logger.info("Federating #{id} to #{inbox}")
host = URI.parse(inbox).host host = URI.parse(inbox).host
@ -777,6 +779,8 @@ def publish_one(%{inbox: inbox, json: json, actor: actor, id: id}) do
digest: digest digest: digest
}) })
with {:ok, %{status: code}} when code in 200..299 <-
result =
@httpoison.post( @httpoison.post(
inbox, inbox,
json, json,
@ -785,7 +789,16 @@ def publish_one(%{inbox: inbox, json: json, actor: actor, id: id}) do
{"signature", signature}, {"signature", signature},
{"digest", digest} {"digest", digest}
] ]
) ) do
if !Map.has_key?(params, :unreachable_since) || params[:unreachable_since],
do: Instances.set_reachable(inbox)
result
else
{_post_result, response} ->
unless params[:unreachable_since], do: Instances.set_unreachable(inbox)
{:error, response}
end
end end
# TODO: # TODO:

View file

@ -4,6 +4,7 @@
defmodule Pleroma.Web.ActivityPub.ActivityPubController do defmodule Pleroma.Web.ActivityPub.ActivityPubController do
use Pleroma.Web, :controller use Pleroma.Web, :controller
alias Pleroma.{Activity, User, Object} alias Pleroma.{Activity, User, Object}
alias Pleroma.Web.ActivityPub.{ObjectView, UserView} alias Pleroma.Web.ActivityPub.{ObjectView, UserView}
alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.ActivityPub
@ -17,6 +18,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
action_fallback(:errors) action_fallback(:errors)
plug(Pleroma.Web.FederatingPlug when action in [:inbox, :relay]) plug(Pleroma.Web.FederatingPlug when action in [:inbox, :relay])
plug(:set_requester_reachable when action in [:inbox])
plug(:relay_active? when action in [:relay]) plug(:relay_active? when action in [:relay])
def relay_active?(conn, _) do def relay_active?(conn, _) do
@ -289,4 +291,13 @@ def errors(conn, _e) do
|> put_status(500) |> put_status(500)
|> json("error") |> json("error")
end end
defp set_requester_reachable(%Plug.Conn{} = conn, _) do
with actor <- conn.params["actor"],
true <- is_binary(actor) do
Pleroma.Instances.set_reachable(actor)
end
conn
end
end end

View file

@ -3,20 +3,46 @@
# SPDX-License-Identifier: AGPL-3.0-only # SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.MRF.HellthreadPolicy do defmodule Pleroma.Web.ActivityPub.MRF.HellthreadPolicy do
alias Pleroma.User
@behaviour Pleroma.Web.ActivityPub.MRF @behaviour Pleroma.Web.ActivityPub.MRF
@impl true defp delist_message(message) do
def filter(%{"type" => "Create"} = object) do follower_collection = User.get_cached_by_ap_id(message["actor"]).follower_address
threshold = Pleroma.Config.get([:mrf_hellthread, :threshold])
recipients = (object["to"] || []) ++ (object["cc"] || [])
if length(recipients) > threshold do message
|> Map.put("to", [follower_collection])
|> Map.put("cc", ["https://www.w3.org/ns/activitystreams#Public"])
end
@impl true
def filter(%{"type" => "Create"} = message) do
delist_threshold = Pleroma.Config.get([:mrf_hellthread, :delist_threshold])
reject_threshold =
Pleroma.Config.get(
[:mrf_hellthread, :reject_threshold],
Pleroma.Config.get([:mrf_hellthread, :threshold])
)
recipients = (message["to"] || []) ++ (message["cc"] || [])
cond do
length(recipients) > reject_threshold and reject_threshold > 0 ->
{:reject, nil} {:reject, nil}
length(recipients) > delist_threshold and delist_threshold > 0 ->
if Enum.member?(message["to"], "https://www.w3.org/ns/activitystreams#Public") or
Enum.member?(message["cc"], "https://www.w3.org/ns/activitystreams#Public") do
{:ok, delist_message(message)}
else else
{:ok, object} {:ok, message}
end
true ->
{:ok, message}
end end
end end
@impl true @impl true
def filter(object), do: {:ok, object} def filter(message), do: {:ok, message}
end end

View file

@ -285,7 +285,7 @@ def update_element_in_object(property, element, object) do
|> Map.put("#{property}_count", length(element)) |> Map.put("#{property}_count", length(element))
|> Map.put("#{property}s", element), |> Map.put("#{property}s", element),
changeset <- Changeset.change(object, data: new_data), changeset <- Changeset.change(object, data: new_data),
{:ok, object} <- Repo.update(changeset), {:ok, object} <- Object.update_and_set_cache(changeset),
_ <- update_object_in_activities(object) do _ <- update_object_in_activities(object) do
{:ok, object} {:ok, object}
end end

View file

@ -25,7 +25,7 @@ defmodule Pleroma.Web.Endpoint do
at: "/", at: "/",
from: :pleroma, from: :pleroma,
only: only:
~w(index.html static finmoji emoji packs sounds images instance sw.js favicon.png schemas doc) ~w(index.html static finmoji emoji packs sounds images instance sw.js sw-pleroma.js favicon.png schemas doc)
) )
# Code reloading can be explicitly enabled under the # Code reloading can be explicitly enabled under the
@ -82,4 +82,8 @@ def load_from_system_env(config) do
port = System.get_env("PORT") || raise "expected the PORT environment variable to be set" port = System.get_env("PORT") || raise "expected the PORT environment variable to be set"
{:ok, Keyword.put(config, :http, [:inet6, port: port])} {:ok, Keyword.put(config, :http, [:inet6, port: port])}
end end
def websocket_url do
String.replace_leading(url(), "http", "ws")
end
end end

View file

@ -6,7 +6,7 @@ defmodule Pleroma.Web.Federator do
alias Pleroma.User alias Pleroma.User
alias Pleroma.Activity alias Pleroma.Activity
alias Pleroma.Jobs alias Pleroma.Jobs
alias Pleroma.Web.{WebFinger, Websub} alias Pleroma.Web.{WebFinger, Websub, Salmon}
alias Pleroma.Web.Federator.RetryQueue alias Pleroma.Web.Federator.RetryQueue
alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Web.ActivityPub.Relay alias Pleroma.Web.ActivityPub.Relay
@ -58,6 +58,10 @@ def refresh_subscriptions() do
Jobs.enqueue(:federator_out, __MODULE__, [:refresh_subscriptions]) Jobs.enqueue(:federator_out, __MODULE__, [:refresh_subscriptions])
end end
def publish_single_salmon(params) do
Jobs.enqueue(:federator_out, __MODULE__, [:publish_single_salmon, params])
end
# Job Worker Callbacks # Job Worker Callbacks
def perform(:refresh_subscriptions) do def perform(:refresh_subscriptions) do
@ -145,6 +149,10 @@ def perform(:incoming_ap_doc, params) do
end end
end end
def perform(:publish_single_salmon, params) do
Salmon.send_to_user(params)
end
def perform(:publish_single_ap, params) do def perform(:publish_single_ap, params) do
case ActivityPub.publish_one(params) do case ActivityPub.publish_one(params) do
{:ok, _} -> {:ok, _} ->

View file

@ -138,7 +138,7 @@ def masto_instance(conn, _params) do
version: "#{@mastodon_api_level} (compatible; #{Pleroma.Application.named_version()})", version: "#{@mastodon_api_level} (compatible; #{Pleroma.Application.named_version()})",
email: Keyword.get(instance, :email), email: Keyword.get(instance, :email),
urls: %{ urls: %{
streaming_api: String.replace(Pleroma.Web.Endpoint.static_url(), "http", "ws") streaming_api: Pleroma.Web.Endpoint.websocket_url()
}, },
stats: Stats.get_stats(), stats: Stats.get_stats(),
thumbnail: Web.base_url() <> "/instance/thumbnail.jpeg", thumbnail: Web.base_url() <> "/instance/thumbnail.jpeg",
@ -423,6 +423,28 @@ def unpin_status(%{assigns: %{user: user}} = conn, %{"id" => ap_id_or_id}) do
end end
end end
def bookmark_status(%{assigns: %{user: user}} = conn, %{"id" => id}) do
with %Activity{} = activity <- Repo.get(Activity, id),
%User{} = user <- User.get_by_nickname(user.nickname),
true <- ActivityPub.visible_for_user?(activity, user),
{:ok, user} <- User.bookmark(user, activity.data["object"]["id"]) do
conn
|> put_view(StatusView)
|> try_render("status.json", %{activity: activity, for: user, as: :activity})
end
end
def unbookmark_status(%{assigns: %{user: user}} = conn, %{"id" => id}) do
with %Activity{} = activity <- Repo.get(Activity, id),
%User{} = user <- User.get_by_nickname(user.nickname),
true <- ActivityPub.visible_for_user?(activity, user),
{:ok, user} <- User.unbookmark(user, activity.data["object"]["id"]) do
conn
|> put_view(StatusView)
|> try_render("status.json", %{activity: activity, for: user, as: :activity})
end
end
def notifications(%{assigns: %{user: user}} = conn, params) do def notifications(%{assigns: %{user: user}} = conn, params) do
notifications = Notification.for_user(user, params) notifications = Notification.for_user(user, params)
@ -859,6 +881,19 @@ def favourites(%{assigns: %{user: user}} = conn, params) do
|> render("index.json", %{activities: activities, for: user, as: :activity}) |> render("index.json", %{activities: activities, for: user, as: :activity})
end end
def bookmarks(%{assigns: %{user: user}} = conn, _) do
user = Repo.get(User, user.id)
activities =
user.bookmarks
|> Enum.map(fn id -> Activity.get_create_by_object_ap_id(id) end)
|> Enum.reverse()
conn
|> put_view(StatusView)
|> render("index.json", %{activities: activities, for: user, as: :activity})
end
def get_lists(%{assigns: %{user: user}} = conn, opts) do def get_lists(%{assigns: %{user: user}} = conn, opts) do
lists = Pleroma.List.for_user(user, opts) lists = Pleroma.List.for_user(user, opts)
res = ListView.render("lists.json", lists: lists) res = ListView.render("lists.json", lists: lists)
@ -870,7 +905,10 @@ def get_list(%{assigns: %{user: user}} = conn, %{"id" => id}) do
res = ListView.render("list.json", list: list) res = ListView.render("list.json", list: list)
json(conn, res) json(conn, res)
else else
_e -> json(conn, "error") _e ->
conn
|> put_status(404)
|> json(%{error: "Record not found"})
end end
end end

View file

@ -87,6 +87,7 @@ def render(
favourites_count: 0, favourites_count: 0,
reblogged: false, reblogged: false,
favourited: false, favourited: false,
bookmarked: false,
muted: false, muted: false,
pinned: pinned?(activity, user), pinned: pinned?(activity, user),
sensitive: false, sensitive: false,
@ -121,6 +122,7 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity}
repeated = opts[:for] && opts[:for].ap_id in (object["announcements"] || []) repeated = opts[:for] && opts[:for].ap_id in (object["announcements"] || [])
favorited = opts[:for] && opts[:for].ap_id in (object["likes"] || []) favorited = opts[:for] && opts[:for].ap_id in (object["likes"] || [])
bookmarked = opts[:for] && object["id"] in opts[:for].bookmarks
attachment_data = object["attachment"] || [] attachment_data = object["attachment"] || []
attachments = render_many(attachment_data, StatusView, "attachment.json", as: :attachment) attachments = render_many(attachment_data, StatusView, "attachment.json", as: :attachment)
@ -157,6 +159,7 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity}
favourites_count: like_count, favourites_count: like_count,
reblogged: present?(repeated), reblogged: present?(repeated),
favourited: present?(favorited), favourited: present?(favorited),
bookmarked: present?(bookmarked),
muted: false, muted: false,
pinned: pinned?(activity, user), pinned: pinned?(activity, user),
sensitive: sensitive, sensitive: sensitive,

View file

@ -19,6 +19,10 @@ def schemas(conn, _params) do
%{ %{
rel: "http://nodeinfo.diaspora.software/ns/schema/2.0", rel: "http://nodeinfo.diaspora.software/ns/schema/2.0",
href: Web.base_url() <> "/nodeinfo/2.0.json" href: Web.base_url() <> "/nodeinfo/2.0.json"
},
%{
rel: "http://nodeinfo.diaspora.software/ns/schema/2.1",
href: Web.base_url() <> "/nodeinfo/2.1.json"
} }
] ]
} }
@ -26,8 +30,9 @@ def schemas(conn, _params) do
json(conn, response) json(conn, response)
end end
# Schema definition: https://github.com/jhass/nodeinfo/blob/master/schemas/2.0/schema.json # returns a nodeinfo 2.0 map, since 2.1 just adds a repository field
def nodeinfo(conn, %{"version" => "2.0"}) do # under software.
def raw_nodeinfo() do
instance = Application.get_env(:pleroma, :instance) instance = Application.get_env(:pleroma, :instance)
media_proxy = Application.get_env(:pleroma, :media_proxy) media_proxy = Application.get_env(:pleroma, :media_proxy)
suggestions = Application.get_env(:pleroma, :suggestions) suggestions = Application.get_env(:pleroma, :suggestions)
@ -98,10 +103,10 @@ def nodeinfo(conn, %{"version" => "2.0"}) do
] ]
|> Enum.filter(& &1) |> Enum.filter(& &1)
response = %{ %{
version: "2.0", version: "2.0",
software: %{ software: %{
name: Pleroma.Application.name(), name: Pleroma.Application.name() |> String.downcase(),
version: Pleroma.Application.version() version: Pleroma.Application.version()
}, },
protocols: ["ostatus", "activitypub"], protocols: ["ostatus", "activitypub"],
@ -142,12 +147,37 @@ def nodeinfo(conn, %{"version" => "2.0"}) do
restrictedNicknames: Pleroma.Config.get([Pleroma.User, :restricted_nicknames]) restrictedNicknames: Pleroma.Config.get([Pleroma.User, :restricted_nicknames])
} }
} }
end
# Schema definition: https://github.com/jhass/nodeinfo/blob/master/schemas/2.0/schema.json
# and https://github.com/jhass/nodeinfo/blob/master/schemas/2.1/schema.json
def nodeinfo(conn, %{"version" => "2.0"}) do
conn conn
|> put_resp_header( |> put_resp_header(
"content-type", "content-type",
"application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0#; charset=utf-8" "application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0#; charset=utf-8"
) )
|> json(raw_nodeinfo())
end
def nodeinfo(conn, %{"version" => "2.1"}) do
raw_response = raw_nodeinfo()
updated_software =
raw_response
|> Map.get(:software)
|> Map.put(:repository, Pleroma.Application.repository())
response =
raw_response
|> Map.put(:software, updated_software)
|> Map.put(:version, "2.1")
conn
|> put_resp_header(
"content-type",
"application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.1#; charset=utf-8"
)
|> json(response) |> json(response)
end end

View file

@ -48,6 +48,9 @@ def remote_follow_path do
def handle_incoming(xml_string) do def handle_incoming(xml_string) do
with doc when doc != :error <- parse_document(xml_string) do with doc when doc != :error <- parse_document(xml_string) do
with {:ok, actor_user} <- find_make_or_update_user(doc),
do: Pleroma.Instances.set_reachable(actor_user.ap_id)
entries = :xmerl_xpath.string('//entry', doc) entries = :xmerl_xpath.string('//entry', doc)
activities = activities =

View file

@ -14,6 +14,7 @@ defmodule Pleroma.Web.OStatus.OStatusController do
alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.ActivityPub
plug(Pleroma.Web.FederatingPlug when action in [:salmon_incoming]) plug(Pleroma.Web.FederatingPlug when action in [:salmon_incoming])
action_fallback(:errors) action_fallback(:errors)
def feed_redirect(conn, %{"nickname" => nickname}) do def feed_redirect(conn, %{"nickname" => nickname}) do

View file

@ -7,7 +7,8 @@ defmodule Pleroma.Web.RichMedia.Helpers do
alias Pleroma.Web.RichMedia.Parser alias Pleroma.Web.RichMedia.Parser
def fetch_data_for_activity(%Activity{} = activity) do def fetch_data_for_activity(%Activity{} = activity) do
with %Object{} = object <- Object.normalize(activity.data["object"]), with true <- Pleroma.Config.get([:rich_media, :enabled]),
%Object{} = object <- Object.normalize(activity.data["object"]),
{:ok, page_url} <- HTML.extract_first_external_url(object, object.data["content"]), {:ok, page_url} <- HTML.extract_first_external_url(object, object.data["content"]),
{:ok, rich_media} <- Parser.parse(page_url) do {:ok, rich_media} <- Parser.parse(page_url) do
%{page_url: page_url, rich_media: rich_media} %{page_url: page_url, rich_media: rich_media}

View file

@ -30,7 +30,7 @@ defp parse_url(url) do
try do try do
{:ok, %Tesla.Env{body: html}} = Pleroma.HTTP.get(url, [], adapter: [pool: :media]) {:ok, %Tesla.Env{body: html}} = Pleroma.HTTP.get(url, [], adapter: [pool: :media])
html |> maybe_parse() |> get_parsed_data() html |> maybe_parse() |> clean_parsed_data() |> check_parsed_data()
rescue rescue
e -> e ->
{:error, "Parsing error: #{inspect(e)}"} {:error, "Parsing error: #{inspect(e)}"}
@ -46,11 +46,33 @@ defp maybe_parse(html) do
end) end)
end end
defp get_parsed_data(%{title: title} = data) when is_binary(title) and byte_size(title) > 0 do defp check_parsed_data(%{title: title} = data) when is_binary(title) and byte_size(title) > 0 do
{:ok, data} {:ok, data}
end end
defp get_parsed_data(data) do defp check_parsed_data(data) do
{:error, "Found metadata was invalid or incomplete: #{inspect(data)}"} {:error, "Found metadata was invalid or incomplete: #{inspect(data)}"}
end end
defp string_is_valid_unicode(data) when is_binary(data) do
data
|> :unicode.characters_to_binary()
|> clean_string()
end
defp string_is_valid_unicode(data), do: {:ok, data}
defp clean_string({:error, _, _}), do: {:error, "Invalid data"}
defp clean_string(data), do: {:ok, data}
defp clean_parsed_data(data) do
data
|> Enum.reject(fn {_, val} ->
case string_is_valid_unicode(val) do
{:ok, _} -> false
_ -> true
end
end)
|> Map.new()
end
end end

View file

@ -185,6 +185,7 @@ defmodule Pleroma.Web.Router do
get("/timelines/direct", MastodonAPIController, :dm_timeline) get("/timelines/direct", MastodonAPIController, :dm_timeline)
get("/favourites", MastodonAPIController, :favourites) get("/favourites", MastodonAPIController, :favourites)
get("/bookmarks", MastodonAPIController, :bookmarks)
post("/statuses", MastodonAPIController, :post_status) post("/statuses", MastodonAPIController, :post_status)
delete("/statuses/:id", MastodonAPIController, :delete_status) delete("/statuses/:id", MastodonAPIController, :delete_status)
@ -195,6 +196,8 @@ defmodule Pleroma.Web.Router do
post("/statuses/:id/unfavourite", MastodonAPIController, :unfav_status) post("/statuses/:id/unfavourite", MastodonAPIController, :unfav_status)
post("/statuses/:id/pin", MastodonAPIController, :pin_status) post("/statuses/:id/pin", MastodonAPIController, :pin_status)
post("/statuses/:id/unpin", MastodonAPIController, :unpin_status) post("/statuses/:id/unpin", MastodonAPIController, :unpin_status)
post("/statuses/:id/bookmark", MastodonAPIController, :bookmark_status)
post("/statuses/:id/unbookmark", MastodonAPIController, :unbookmark_status)
post("/notifications/clear", MastodonAPIController, :clear_notifications) post("/notifications/clear", MastodonAPIController, :clear_notifications)
post("/notifications/dismiss", MastodonAPIController, :dismiss_notification) post("/notifications/dismiss", MastodonAPIController, :dismiss_notification)

View file

@ -6,6 +6,7 @@ defmodule Pleroma.Web.Salmon do
@httpoison Application.get_env(:pleroma, :httpoison) @httpoison Application.get_env(:pleroma, :httpoison)
use Bitwise use Bitwise
alias Pleroma.Instances
alias Pleroma.Web.XML alias Pleroma.Web.XML
alias Pleroma.Web.OStatus.ActivityRepresenter alias Pleroma.Web.OStatus.ActivityRepresenter
alias Pleroma.User alias Pleroma.User
@ -161,25 +162,31 @@ def remote_users(%{data: %{"to" => to} = data}) do
|> Enum.filter(fn user -> user && !user.local end) |> Enum.filter(fn user -> user && !user.local end)
end end
# push an activity to remote accounts @doc "Pushes an activity to remote account."
# def send_to_user(%{recipient: %{info: %{salmon: salmon}}} = params),
defp send_to_user(%{info: %{salmon: salmon}}, feed, poster), do: send_to_user(Map.put(params, :recipient, salmon))
do: send_to_user(salmon, feed, poster)
defp send_to_user(url, feed, poster) when is_binary(url) do def send_to_user(%{recipient: url, feed: feed, poster: poster} = params) when is_binary(url) do
with {:ok, %{status: code}} <- with {:ok, %{status: code}} when code in 200..299 <-
poster.( poster.(
url, url,
feed, feed,
[{"Content-Type", "application/magic-envelope+xml"}] [{"Content-Type", "application/magic-envelope+xml"}]
) do ) do
if !Map.has_key?(params, :unreachable_since) || params[:unreachable_since],
do: Instances.set_reachable(url)
Logger.debug(fn -> "Pushed to #{url}, code #{code}" end) Logger.debug(fn -> "Pushed to #{url}, code #{code}" end)
:ok
else else
e -> Logger.debug(fn -> "Pushing Salmon to #{url} failed, #{inspect(e)}" end) e ->
unless params[:unreachable_since], do: Instances.set_reachable(url)
Logger.debug(fn -> "Pushing Salmon to #{url} failed, #{inspect(e)}" end)
:error
end end
end end
defp send_to_user(_, _, _), do: nil def send_to_user(_), do: :noop
@supported_activities [ @supported_activities [
"Create", "Create",
@ -209,12 +216,23 @@ def publish(%{info: %{keys: keys}} = user, %{data: %{"type" => type}} = activity
{:ok, private, _} = keys_from_pem(keys) {:ok, private, _} = keys_from_pem(keys)
{:ok, feed} = encode(private, feed) {:ok, feed} = encode(private, feed)
remote_users(activity) remote_users = remote_users(activity)
salmon_urls = Enum.map(remote_users, & &1.info.salmon)
reachable_urls_metadata = Instances.filter_reachable(salmon_urls)
reachable_urls = Map.keys(reachable_urls_metadata)
remote_users
|> Enum.filter(&(&1.info.salmon in reachable_urls))
|> Enum.each(fn remote_user -> |> Enum.each(fn remote_user ->
Task.start(fn ->
Logger.debug(fn -> "Sending Salmon to #{remote_user.ap_id}" end) Logger.debug(fn -> "Sending Salmon to #{remote_user.ap_id}" end)
send_to_user(remote_user, feed, poster)
end) Pleroma.Web.Federator.publish_single_salmon(%{
recipient: remote_user,
feed: feed,
poster: poster,
unreachable_since: reachable_urls_metadata[remote_user.info.salmon]
})
end) end)
end end
end end

View file

@ -1,7 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset=utf-8 /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimal-ui" />
<title> <title>
<%= Application.get_env(:pleroma, :instance)[:name] %> <%= Application.get_env(:pleroma, :instance)[:name] %>
</title> </title>

View file

@ -1,23 +1,28 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang='en'> <html lang='en'>
<head> <head>
<meta charset='utf-8'>
<meta content='width=device-width, initial-scale=1' name='viewport'>
<title> <title>
<%= Application.get_env(:pleroma, :instance)[:name] %> <%= Application.get_env(:pleroma, :instance)[:name] %>
</title> </title>
<meta charset='utf-8'>
<meta content='width=device-width, initial-scale=1' name='viewport'>
<link rel="icon" type="image/png" href="/favicon.png"/> <link rel="icon" type="image/png" href="/favicon.png"/>
<link rel="stylesheet" media="all" href="/packs/common.css" /> <script crossorigin='anonymous' src="/packs/locales.js"></script>
<link rel="stylesheet" media="all" href="/packs/default.css" /> <script crossorigin='anonymous' src="/packs/locales/glitch/en.js"></script>
<script src="/packs/common.js"></script> <link rel='preload' as='script' crossorigin='anonymous' href='/packs/features/getting_started.js'>
<script src="/packs/locale_en.js"></script> <link rel='preload' as='script' crossorigin='anonymous' href='/packs/features/compose.js'>
<link as='script' crossorigin='anonymous' href='/packs/features/getting_started.js' rel='preload'> <link rel='preload' as='script' crossorigin='anonymous' href='/packs/features/home_timeline.js'>
<link as='script' crossorigin='anonymous' href='/packs/features/compose.js' rel='preload'> <link rel='preload' as='script' crossorigin='anonymous' href='/packs/features/notifications.js'>
<link as='script' crossorigin='anonymous' href='/packs/features/home_timeline.js' rel='preload'>
<link as='script' crossorigin='anonymous' href='/packs/features/notifications.js' rel='preload'>
<script id='initial-state' type='application/json'><%= raw @initial_state %></script> <script id='initial-state' type='application/json'><%= raw @initial_state %></script>
<script src="/packs/application.js"></script>
<script src="/packs/core/common.js"></script>
<link rel="stylesheet" media="all" href="/packs/core/common.css" />
<script src="/packs/flavours/glitch/common.js"></script>
<link rel="stylesheet" media="all" href="/packs/flavours/glitch/common.css" />
<script src="/packs/flavours/glitch/home.js"></script>
</head> </head>
<body class='app-body no-reduce-motion system-font'> <body class='app-body no-reduce-motion system-font'>
<div class='app-holder' data-props='{&quot;locale&quot;:&quot;en&quot;}' id='mastodon'> <div class='app-holder' data-props='{&quot;locale&quot;:&quot;en&quot;}' id='mastodon'>

View file

@ -5,6 +5,7 @@
defmodule Pleroma.Web.Websub do defmodule Pleroma.Web.Websub do
alias Ecto.Changeset alias Ecto.Changeset
alias Pleroma.Repo alias Pleroma.Repo
alias Pleroma.Instances
alias Pleroma.Web.Websub.{WebsubServerSubscription, WebsubClientSubscription} alias Pleroma.Web.Websub.{WebsubServerSubscription, WebsubClientSubscription}
alias Pleroma.Web.OStatus.FeedRepresenter alias Pleroma.Web.OStatus.FeedRepresenter
alias Pleroma.Web.{XML, Endpoint, OStatus, Federator} alias Pleroma.Web.{XML, Endpoint, OStatus, Federator}
@ -53,28 +54,34 @@ def verify(subscription, getter \\ &@httpoison.get/3) do
] ]
def publish(topic, user, %{data: %{"type" => type}} = activity) def publish(topic, user, %{data: %{"type" => type}} = activity)
when type in @supported_activities do when type in @supported_activities do
# TODO: Only send to still valid subscriptions.
query =
from(
sub in WebsubServerSubscription,
where: sub.topic == ^topic and sub.state == "active",
where: fragment("? > NOW()", sub.valid_until)
)
subscriptions = Repo.all(query)
Enum.each(subscriptions, fn sub ->
response = response =
user user
|> FeedRepresenter.to_simple_form([activity], [user]) |> FeedRepresenter.to_simple_form([activity], [user])
|> :xmerl.export_simple(:xmerl_xml) |> :xmerl.export_simple(:xmerl_xml)
|> to_string |> to_string
query =
from(
sub in WebsubServerSubscription,
where: sub.topic == ^topic and sub.state == "active",
where: fragment("? > (NOW() at time zone 'UTC')", sub.valid_until)
)
subscriptions = Repo.all(query)
callbacks = Enum.map(subscriptions, & &1.callback)
reachable_callbacks_metadata = Instances.filter_reachable(callbacks)
reachable_callbacks = Map.keys(reachable_callbacks_metadata)
subscriptions
|> Enum.filter(&(&1.callback in reachable_callbacks))
|> Enum.each(fn sub ->
data = %{ data = %{
xml: response, xml: response,
topic: topic, topic: topic,
callback: sub.callback, callback: sub.callback,
secret: sub.secret secret: sub.secret,
unreachable_since: reachable_callbacks_metadata[sub.callback]
} }
Federator.publish_single_websub(data) Federator.publish_single_websub(data)
@ -263,11 +270,11 @@ def refresh_subscriptions(delta \\ 60 * 60 * 24) do
end) end)
end end
def publish_one(%{xml: xml, topic: topic, callback: callback, secret: secret}) do def publish_one(%{xml: xml, topic: topic, callback: callback, secret: secret} = params) do
signature = sign(secret || "", xml) signature = sign(secret || "", xml)
Logger.info(fn -> "Pushing #{topic} to #{callback}" end) Logger.info(fn -> "Pushing #{topic} to #{callback}" end)
with {:ok, %{status: code}} <- with {:ok, %{status: code}} when code in 200..299 <-
@httpoison.post( @httpoison.post(
callback, callback,
xml, xml,
@ -276,12 +283,16 @@ def publish_one(%{xml: xml, topic: topic, callback: callback, secret: secret}) d
{"X-Hub-Signature", "sha1=#{signature}"} {"X-Hub-Signature", "sha1=#{signature}"}
] ]
) do ) do
if !Map.has_key?(params, :unreachable_since) || params[:unreachable_since],
do: Instances.set_reachable(callback)
Logger.info(fn -> "Pushed to #{callback}, code #{code}" end) Logger.info(fn -> "Pushed to #{callback}, code #{code}" end)
{:ok, code} {:ok, code}
else else
e -> {_post_result, response} ->
Logger.debug(fn -> "Couldn't push to #{callback}, #{inspect(e)}" end) unless params[:unreachable_since], do: Instances.set_reachable(callback)
{:error, e} Logger.debug(fn -> "Couldn't push to #{callback}, #{inspect(response)}" end)
{:error, response}
end end
end end
end end

View file

@ -4,9 +4,11 @@
defmodule Pleroma.Web.Websub.WebsubController do defmodule Pleroma.Web.Websub.WebsubController do
use Pleroma.Web, :controller use Pleroma.Web, :controller
alias Pleroma.{Repo, User} alias Pleroma.{Repo, User}
alias Pleroma.Web.{Websub, Federator} alias Pleroma.Web.{Websub, Federator}
alias Pleroma.Web.Websub.WebsubClientSubscription alias Pleroma.Web.Websub.WebsubClientSubscription
require Logger require Logger
plug( plug(

View file

@ -0,0 +1,9 @@
defmodule Pleroma.Repo.Migrations.AddBookmarksToUsers do
use Ecto.Migration
def change do
alter table(:users) do
add :bookmarks, {:array, :string}, null: false, default: []
end
end
end

View file

@ -0,0 +1,15 @@
defmodule Pleroma.Repo.Migrations.CreateInstances do
use Ecto.Migration
def change do
create table(:instances) do
add :host, :string
add :unreachable_since, :naive_datetime
timestamps()
end
create unique_index(:instances, [:host])
create index(:instances, [:unreachable_since])
end
end

View file

@ -1,2 +0,0 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[92],{388:function(t,e,n){"use strict";n.r(e);var o,i,c,a,r,l=n(0),s=n.n(l),d=n(6),u=n.n(d),p=n(3),h=n.n(p),f=n(7),m=n.n(f),b=n(1),g=n.n(b),v=n(28),y=n.n(v),O=n(12),j=n(101),M=n(29),k=n(4),C=n(8),L=n(88),w=n(19),P=n(62),_=n(60),I=n(63),A=Object(k.f)({title:{id:"standalone.public_title",defaultMessage:"A look inside..."}}),E=Object(O.connect)()(o=Object(k.g)(o=function(t){function e(){var n,o,i;u()(this,e);for(var c=arguments.length,a=Array(c),r=0;r<c;r++)a[r]=arguments[r];return n=o=h()(this,t.call.apply(t,[this].concat(a))),o.handleHeaderClick=function(){o.column.scrollTop()},o.setRef=function(t){o.column=t},o.handleLoadMore=function(t){o.props.dispatch(Object(w.r)({maxId:t}))},i=n,h()(o,i)}return m()(e,t),e.prototype.componentDidMount=function(){var t=this.props.dispatch;t(Object(w.r)()),this.disconnect=t(Object(I.e)())},e.prototype.componentWillUnmount=function(){this.disconnect&&(this.disconnect(),this.disconnect=null)},e.prototype.render=function(){var t=this.props.intl;return g.a.createElement(P.a,{ref:this.setRef,label:t.formatMessage(A.title)},s()(_.a,{icon:"globe",title:t.formatMessage(A.title),onClick:this.handleHeaderClick}),s()(L.a,{timelineId:"public",onLoadMore:this.handleLoadMore,scrollKey:"standalone_public_timeline",trackScroll:!1}))},e}(g.a.PureComponent))||o)||o,H=Object(k.f)({title:{id:"standalone.public_title",defaultMessage:"A look inside..."}}),R=Object(O.connect)()(i=Object(k.g)(i=function(t){function e(){var n,o,i;u()(this,e);for(var c=arguments.length,a=Array(c),r=0;r<c;r++)a[r]=arguments[r];return n=o=h()(this,t.call.apply(t,[this].concat(a))),o.handleHeaderClick=function(){o.column.scrollTop()},o.setRef=function(t){o.column=t},o.handleLoadMore=function(t){o.props.dispatch(Object(w.m)({maxId:t}))},i=n,h()(o,i)}return m()(e,t),e.prototype.componentDidMount=function(){var t=this.props.dispatch;t(Object(w.m)()),this.disconnect=t(Object(I.a)())},e.prototype.componentWillUnmount=function(){this.disconnect&&(this.disconnect(),this.disconnect=null)},e.prototype.render=function(){var t=this.props.intl;return g.a.createElement(P.a,{ref:this.setRef,label:t.formatMessage(H.title)},s()(_.a,{icon:"users",title:t.formatMessage(H.title),onClick:this.handleHeaderClick}),s()(L.a,{timelineId:"community",onLoadMore:this.handleLoadMore,scrollKey:"standalone_public_timeline",trackScroll:!1}))},e}(g.a.PureComponent))||i)||i,T=Object(O.connect)()(c=function(t){function e(){var n,o,i;u()(this,e);for(var c=arguments.length,a=Array(c),r=0;r<c;r++)a[r]=arguments[r];return n=o=h()(this,t.call.apply(t,[this].concat(a))),o.handleHeaderClick=function(){o.column.scrollTop()},o.setRef=function(t){o.column=t},o.handleLoadMore=function(t){o.props.dispatch(Object(w.o)(o.props.hashtag,{maxId:t}))},i=n,h()(o,i)}return m()(e,t),e.prototype.componentDidMount=function(){var t=this.props,e=t.dispatch,n=t.hashtag;e(Object(w.o)(n)),this.disconnect=e(Object(I.c)(n))},e.prototype.componentWillUnmount=function(){this.disconnect&&(this.disconnect(),this.disconnect=null)},e.prototype.render=function(){var t=this.props.hashtag;return g.a.createElement(P.a,{ref:this.setRef},s()(_.a,{icon:"hashtag",title:t,onClick:this.handleHeaderClick}),s()(L.a,{trackScroll:!1,scrollKey:"standalone_hashtag_timeline",timelineId:"hashtag:"+t,onLoadMore:this.handleLoadMore}))},e}(g.a.PureComponent))||c,D=n(99),S=n(10);n.d(e,"default",function(){return W});var x=Object(C.getLocale)(),J=x.localeData,K=x.messages;Object(k.e)(J);var U=Object(j.a)();S.c&&U.dispatch(Object(M.b)(S.c));var W=(r=a=function(t){function e(){return u()(this,e),h()(this,t.apply(this,arguments))}return m()(e,t),e.prototype.render=function(){var t=this.props,e=t.locale,n=t.hashtag,o=t.showPublicTimeline,i=void 0;return i=n?s()(T,{hashtag:n}):o?s()(E,{}):s()(R,{}),s()(k.d,{locale:e,messages:K},void 0,s()(O.Provider,{store:U},void 0,s()(b.Fragment,{},void 0,i,y.a.createPortal(s()(D.a,{}),document.getElementById("modal-container")))))},e}(g.a.PureComponent),a.defaultProps={showPublicTimeline:S.c.settings.known_fediverse},r)},692:function(t,e,n){"use strict";n.r(e);var o=n(67),i=n(66);function c(){var t=n(388).default,e=n(1),o=n(28),i=document.getElementById("mastodon-timeline");if(null!==i){var c=JSON.parse(i.getAttribute("data-props"));o.render(e.createElement(t,c),i)}}Object(i.a)(),Object(o.a)().then(function(){(0,n(80).default)(c)}).catch(function(t){console.error(t)})}},[[692,0]]]);
//# sourceMappingURL=about.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,2 +0,0 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[91],{458:function(e,c,t){"use strict";t.r(c);var o=t(58);function n(e){var c=e.detail[0],t=document.querySelector('[data-id="'+c.id+'"]');t&&t.parentNode.removeChild(t)}[].forEach.call(document.querySelectorAll(".trash-button"),function(e){e.addEventListener("ajax:success",n)});var l='.batch-checkbox input[type="checkbox"]';Object(o.delegate)(document,"#batch_checkbox_all","change",function(e){var c=e.target;[].forEach.call(document.querySelectorAll(l),function(e){e.checked=c.checked})}),Object(o.delegate)(document,l,"change",function(){var e=document.querySelector("#batch_checkbox_all");e&&(e.checked=[].every.call(document.querySelectorAll(l),function(e){return e.checked}),e.indeterminate=!e.checked&&[].some.call(document.querySelectorAll(l),function(e){return e.checked}))}),Object(o.delegate)(document,".media-spoiler-show-button","click",function(){[].forEach.call(document.querySelectorAll("button.media-spoiler"),function(e){e.click()})}),Object(o.delegate)(document,".media-spoiler-hide-button","click",function(){[].forEach.call(document.querySelectorAll(".spoiler-button.spoiler-button--visible button"),function(e){e.click()})}),Object(o.delegate)(document,"#domain_block_severity","change",function(e){var c=e.target,t=document.querySelector(".input.with_label.domain_block_reject_media");t&&(t.style.display="suspend"===c.value?"none":"block")})}},[[458,0]]]);
//# sourceMappingURL=admin.js.map

View file

@ -1 +0,0 @@
{"version":3,"sources":["webpack:///./app/javascript/packs/admin.js"],"names":["handleDeleteStatus","event","data","detail","element","document","querySelector","id","parentNode","removeChild","forEach","call","querySelectorAll","content","addEventListener","batchCheckboxClassName","Object","rails_ujs__WEBPACK_IMPORTED_MODULE_0__","_ref","target","checked","checkAllElement","every","indeterminate","some","click","_ref2","rejectMediaDiv","style","display","value"],"mappings":"8GAEA,SAASA,EAAmBC,GAAO,IAC1BC,EAAQD,EAAME,OADY,GAE3BC,EAAUC,SAASC,cAAT,aAAoCJ,EAAKK,GAAzC,MACZH,GACFA,EAAQI,WAAWC,YAAYL,MAIhCM,QAAQC,KAAKN,SAASO,iBAAiB,iBAAkB,SAACC,GAC3DA,EAAQC,iBAAiB,eAAgBd,KAG3C,IAAMe,EAAyB,yCAE/BC,OAAAC,EAAA,SAAAD,CAASX,SAAU,sBAAuB,SAAU,SAAAa,GAAgB,IAAbC,EAAaD,EAAbC,UAClDT,QAAQC,KAAKN,SAASO,iBAAiBG,GAAyB,SAACF,GAClEA,EAAQO,QAAUD,EAAOC,YAI7BJ,OAAAC,EAAA,SAAAD,CAASX,SAAUU,EAAwB,SAAU,WACnD,IAAMM,EAAkBhB,SAASC,cAAc,uBAC3Ce,IACFA,EAAgBD,WAAaE,MAAMX,KAAKN,SAASO,iBAAiBG,GAAyB,SAACF,GAAD,OAAaA,EAAQO,UAChHC,EAAgBE,eAAiBF,EAAgBD,YAAcI,KAAKb,KAAKN,SAASO,iBAAiBG,GAAyB,SAACF,GAAD,OAAaA,EAAQO,aAIrJJ,OAAAC,EAAA,SAAAD,CAASX,SAAU,6BAA8B,QAAS,cACrDK,QAAQC,KAAKN,SAASO,iBAAiB,wBAAyB,SAACR,GAClEA,EAAQqB,YAIZT,OAAAC,EAAA,SAAAD,CAASX,SAAU,6BAA8B,QAAS,cACrDK,QAAQC,KAAKN,SAASO,iBAAiB,kDAAmD,SAACR,GAC5FA,EAAQqB,YAIZT,OAAAC,EAAA,SAAAD,CAASX,SAAU,yBAA0B,SAAU,SAAAqB,GAAgB,IAAbP,EAAaO,EAAbP,OAClDQ,EAAiBtB,SAASC,cAAc,+CAC1CqB,IACFA,EAAeC,MAAMC,QAA4B,YAAjBV,EAAOW,MAAuB,OAAS","file":"admin.js","sourcesContent":["import { delegate } from 'rails-ujs';\n\nfunction handleDeleteStatus(event) {\n const [data] = event.detail;\n const element = document.querySelector(`[data-id=\"${data.id}\"]`);\n if (element) {\n element.parentNode.removeChild(element);\n }\n}\n\n[].forEach.call(document.querySelectorAll('.trash-button'), (content) => {\n content.addEventListener('ajax:success', handleDeleteStatus);\n});\n\nconst batchCheckboxClassName = '.batch-checkbox input[type=\"checkbox\"]';\n\ndelegate(document, '#batch_checkbox_all', 'change', ({ target }) => {\n [].forEach.call(document.querySelectorAll(batchCheckboxClassName), (content) => {\n content.checked = target.checked;\n });\n});\n\ndelegate(document, batchCheckboxClassName, 'change', () => {\n const checkAllElement = document.querySelector('#batch_checkbox_all');\n if (checkAllElement) {\n checkAllElement.checked = [].every.call(document.querySelectorAll(batchCheckboxClassName), (content) => content.checked);\n checkAllElement.indeterminate = !checkAllElement.checked && [].some.call(document.querySelectorAll(batchCheckboxClassName), (content) => content.checked);\n }\n});\n\ndelegate(document, '.media-spoiler-show-button', 'click', () => {\n [].forEach.call(document.querySelectorAll('button.media-spoiler'), (element) => {\n element.click();\n });\n});\n\ndelegate(document, '.media-spoiler-hide-button', 'click', () => {\n [].forEach.call(document.querySelectorAll('.spoiler-button.spoiler-button--visible button'), (element) => {\n element.click();\n });\n});\n\ndelegate(document, '#domain_block_severity', 'change', ({ target }) => {\n const rejectMediaDiv = document.querySelector('.input.with_label.domain_block_reject_media');\n if (rejectMediaDiv) {\n rejectMediaDiv.style.display = (target.value === 'suspend') ? 'none' : 'block';\n }\n});\n"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,2 +0,0 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{396:function(n,w,o){}},[[396,0]]]);
//# sourceMappingURL=contrast.js.map

View file

@ -1 +0,0 @@
{"version":3,"sources":[],"names":[],"mappings":"","file":"contrast.js","sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,2 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{819:function(e,t){window.addEventListener("message",function(e){var t=e.data||{};function n(){window.parent.postMessage({type:"setHeight",id:t.id,height:document.getElementsByTagName("html")[0].scrollHeight},"*")}window.parent&&"setHeight"===t.type&&(["interactive","complete"].includes(document.readyState)?n():document.addEventListener("DOMContentLoaded",n))})}},[[819,0]]]);
//# sourceMappingURL=embed.js.map

View file

@ -0,0 +1 @@
{"version":3,"sources":["webpack:///app/javascript/seagate/sources/git/hacktivis.me/git/mastofe/app/javascript/core/embed.js"],"names":["window","addEventListener","e","data","setEmbedHeight","parent","postMessage","type","id","height","document","getElementsByTagName","scrollHeight","includes","readyState"],"mappings":"2EAEAA,OAAOC,iBAAiB,UAAW,SAAAC,GACjC,IAAMC,EAAOD,EAAEC,MAAQ,GAMvB,SAASC,IACPJ,OAAOK,OAAOC,YAAY,CACxBC,KAAM,YACNC,GAAIL,EAAKK,GACTC,OAAQC,SAASC,qBAAqB,QAAQ,GAAGC,cAChD,KATAZ,OAAOK,QAAwB,cAAdF,EAAKI,OAYvB,CAAC,cAAe,YAAYM,SAASH,SAASI,YAChDV,IAEAM,SAAST,iBAAiB,mBAAoBG","file":"core/embed.js","sourcesContent":["// This file will be loaded on embed pages, regardless of theme.\n\nwindow.addEventListener('message', e => {\n const data = e.data || {};\n\n if (!window.parent || data.type !== 'setHeight') {\n return;\n }\n\n function setEmbedHeight () {\n window.parent.postMessage({\n type: 'setHeight',\n id: data.id,\n height: document.getElementsByTagName('html')[0].scrollHeight,\n }, '*');\n };\n\n if (['interactive', 'complete'].includes(document.readyState)) {\n setEmbedHeight();\n } else {\n document.addEventListener('DOMContentLoaded', setEmbedHeight);\n }\n});\n"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,2 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{820:function(n,o,w){"use strict";w.r(o);w(821)},821:function(n,o,w){}},[[820,0]]]);
//# sourceMappingURL=mailer.js.map

View file

@ -0,0 +1 @@
{"version":3,"sources":["webpack:///app/javascript/seagate/sources/git/hacktivis.me/git/mastofe/app/javascript/core/mailer.js"],"names":["__webpack_require__","r","__webpack_exports__"],"mappings":"0FAAAA,EAAAC,EAAAC,GAAAF,EAAA","file":"core/mailer.js","sourcesContent":["import 'styles/mailer.scss';\n"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,2 +0,0 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{398:function(n,w,o){}},[[398,0]]]);
//# sourceMappingURL=default.js.map

View file

@ -1 +0,0 @@
{"version":3,"sources":[],"names":[],"mappings":"","file":"default.js","sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{704:function(a,t,o){"use strict";o.r(t);var e,n,s,r,i,c,d,l=o(0),p=o.n(l),u=o(6),h=o.n(u),m=o(3),f=o.n(m),g=o(7),v=o.n(g),I=(o(1),o(12)),y=o(17),b=o.n(y),L=o(2),_=o.n(L),M=o(13),k=o(19),S=o(194),w=o(193),O=o(196),j=o(18),T=o(32),N=o(71),R=o(10),q=(n=e=function(a){function t(){var o,e,n;h()(this,t);for(var s=arguments.length,r=Array(s),i=0;i<s;i++)r[i]=arguments[i];return o=e=f()(this,a.call.apply(a,[this].concat(r))),e.state={visible:!e.props.media.getIn(["status","sensitive"])||R.f},e.handleClick=function(){return!e.state.visible&&(e.setState({visible:!0}),!0)},n=o,f()(e,n)}return v()(t,a),t.prototype.render=function(){var a=this.props.media,t=this.state.visible,o=a.get("status"),e=100*(a.getIn(["meta","focus","x"])/2+.5),n=100*(a.getIn(["meta","focus","y"])/-2+.5),s={},r=void 0,i=void 0;return"gifv"===a.get("type")&&(r=p()("span",{className:"media-gallery__gifv__label"},void 0,"GIF")),t?(s.backgroundImage="url("+a.get("preview_url")+")",s.backgroundPosition=e+"% "+n+"%"):i=p()("span",{className:"account-gallery__item__icons"},void 0,p()("i",{className:"fa fa-eye-slash"})),p()("div",{className:"account-gallery__item"},void 0,p()(N.a,{to:"/statuses/"+o.get("id"),href:o.get("url"),style:s,onInterceptClick:this.handleClick},void 0,i,r))},t}(j.a),e.propTypes={media:b.a.map.isRequired},n),x=o(694),C=o(123),A=o(211);o.d(t,"default",function(){return U});var B=(r=s=function(a){function t(){var o,e,n;h()(this,t);for(var s=arguments.length,r=Array(s),i=0;i<s;i++)r[i]=arguments[i];return o=e=f()(this,a.call.apply(a,[this].concat(r))),e.handleLoadMore=function(){e.props.onLoadMore(e.props.maxId)},n=o,f()(e,n)}return v()(t,a),t.prototype.render=function(){return p()(A.a,{disabled:this.props.disabled,onLoadMore:this.handleLoadMore})},t}(j.a),s.propTypes={shouldUpdateScroll:_.a.func,maxId:_.a.string,onLoadMore:_.a.func.isRequired},r),U=Object(I.connect)(function(a,t){return{medias:Object(T.a)(a,t.params.accountId),isLoading:a.getIn(["timelines","account:"+t.params.accountId+":media","isLoading"]),hasMore:a.getIn(["timelines","account:"+t.params.accountId+":media","hasMore"])}})((d=c=function(a){function t(){var o,e,n;h()(this,t);for(var s=arguments.length,r=Array(s),i=0;i<s;i++)r[i]=arguments[i];return o=e=f()(this,a.call.apply(a,[this].concat(r))),e.handleScrollToBottom=function(){e.props.hasMore&&e.handleLoadMore(e.props.medias.last().getIn(["status","id"]))},e.handleScroll=function(a){var t=a.target,o=t.scrollTop;150>t.scrollHeight-o-t.clientHeight&&!e.props.isLoading&&e.handleScrollToBottom()},e.handleLoadMore=function(a){e.props.dispatch(Object(k.k)(e.props.params.accountId,{maxId:a}))},e.handleLoadOlder=function(a){a.preventDefault(),e.handleScrollToBottom()},n=o,f()(e,n)}return v()(t,a),t.prototype.componentDidMount=function(){this.props.dispatch(Object(M.w)(this.props.params.accountId)),this.props.dispatch(Object(k.k)(this.props.params.accountId))},t.prototype.componentWillReceiveProps=function(a){a.params.accountId!==this.props.params.accountId&&a.params.accountId&&(this.props.dispatch(Object(M.w)(a.params.accountId)),this.props.dispatch(Object(k.k)(this.props.params.accountId)))},t.prototype.render=function(){var a=this.props,t=a.medias,o=a.shouldUpdateScroll,e=a.isLoading,n=a.hasMore,s=null;return!t&&e?p()(w.a,{},void 0,p()(S.a,{})):(!e&&t.size>0&&n&&(s=p()(A.a,{onClick:this.handleLoadOlder})),p()(w.a,{},void 0,p()(O.a,{}),p()(C.a,{scrollKey:"account_gallery",shouldUpdateScroll:o},void 0,p()("div",{className:"scrollable",onScroll:this.handleScroll},void 0,p()(x.a,{accountId:this.props.params.accountId}),p()("div",{className:"account-gallery__container"},void 0,t.map(function(a,o){return null===a?p()(B,{maxId:o>0?t.getIn(o-1,"id"):null},"more:"+t.getIn(o+1,"id")):p()(q,{media:a},a.get("id"))}),s)))))},t}(j.a),c.propTypes={params:_.a.object.isRequired,dispatch:_.a.func.isRequired,medias:b.a.list.isRequired,isLoading:_.a.bool,hasMore:_.a.bool},i=d))||i}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[12],{721:function(a,e,t){"use strict";t.r(e);var r=t(1),o=t(6),s=t(0),n=t(2),c=(t(3),t(20)),i=t(26),l=t.n(i),d=t(5),p=t.n(d),u=t(27),b=t(36),h=t(289),O=t(640),j=t(642),m=t(24),f=t(154),v=t(407),g=t(23),I=function(c){function a(){for(var a,e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return a=c.call.apply(c,[this].concat(t))||this,Object(n.a)(Object(s.a)(Object(s.a)(a)),"state",{visible:"hide_all"!==g.f&&!a.props.media.getIn(["status","sensitive"])||"show_all"===g.f}),Object(n.a)(Object(s.a)(Object(s.a)(a)),"handleClick",function(){return!a.state.visible&&(a.setState({visible:!0}),!0)}),a}return Object(o.a)(a,c),a.prototype.render=function(){var a,e,t=this.props.media,o=this.state.visible,c=t.get("status"),s=100*(t.getIn(["meta","focus","x"])/2+.5),n=100*(t.getIn(["meta","focus","y"])/-2+.5),i={};return"gifv"===t.get("type")&&(a=Object(r.a)("span",{className:"media-gallery__gifv__label"},void 0,"GIF")),o?(i.backgroundImage="url("+t.get("preview_url")+")",i.backgroundPosition=s+"% "+n+"%"):e=Object(r.a)("span",{className:"account-gallery__item__icons"},void 0,Object(r.a)("i",{className:"fa fa-eye-slash"})),Object(r.a)("div",{className:"account-gallery__item"},void 0,Object(r.a)(v.a,{to:"/statuses/"+c.get("id"),href:c.get("url"),style:i,onInterceptClick:this.handleClick},void 0,e,a))},a}(m.a);Object(n.a)(I,"propTypes",{media:l.a.map.isRequired});var y,_,L,M=t(902),w=t(295),S=t(652);t.d(e,"default",function(){return N});var k=function(c){function a(){for(var a,e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return a=c.call.apply(c,[this].concat(t))||this,Object(n.a)(Object(s.a)(Object(s.a)(a)),"handleLoadMore",function(){a.props.onLoadMore(a.props.maxId)}),a}return Object(o.a)(a,c),a.prototype.render=function(){return Object(r.a)(S.a,{disabled:this.props.disabled,onClick:this.handleLoadMore})},a}(m.a);Object(n.a)(k,"propTypes",{shouldUpdateScroll:p.a.func,maxId:p.a.string,onLoadMore:p.a.func.isRequired});var N=Object(c.connect)(function(a,e){return{medias:Object(f.a)(a,e.params.accountId),isLoading:a.getIn(["timelines","account:"+e.params.accountId+":media","isLoading"]),hasMore:a.getIn(["timelines","account:"+e.params.accountId+":media","hasMore"])}})((L=_=function(c){function a(){for(var o,a=arguments.length,e=new Array(a),t=0;t<a;t++)e[t]=arguments[t];return o=c.call.apply(c,[this].concat(e))||this,Object(n.a)(Object(s.a)(Object(s.a)(o)),"handleScrollToBottom",function(){o.props.hasMore&&o.handleLoadMore(0<o.props.medias.size?o.props.medias.last().getIn(["status","id"]):void 0)}),Object(n.a)(Object(s.a)(Object(s.a)(o)),"handleScroll",function(a){var e=a.target,t=e.scrollTop;e.scrollHeight-t-e.clientHeight<150&&!o.props.isLoading&&o.handleScrollToBottom()}),Object(n.a)(Object(s.a)(Object(s.a)(o)),"handleLoadMore",function(a){o.props.dispatch(Object(b.m)(o.props.params.accountId,{maxId:a}))}),Object(n.a)(Object(s.a)(Object(s.a)(o)),"handleLoadOlder",function(a){a.preventDefault(),o.handleScrollToBottom()}),o}Object(o.a)(a,c);var e=a.prototype;return e.componentDidMount=function(){this.props.dispatch(Object(u.A)(this.props.params.accountId)),this.props.dispatch(Object(b.m)(this.props.params.accountId))},e.componentWillReceiveProps=function(a){a.params.accountId!==this.props.params.accountId&&a.params.accountId&&(this.props.dispatch(Object(u.A)(a.params.accountId)),this.props.dispatch(Object(b.m)(this.props.params.accountId)))},e.render=function(){var t=this,a=this.props,o=a.medias,e=a.shouldUpdateScroll,c=a.isLoading,s=a.hasMore,n=null;return!o&&c?Object(r.a)(O.a,{},void 0,Object(r.a)(h.a,{})):(!s||c&&0===o.size||(n=Object(r.a)(S.a,{visible:!c,onClick:this.handleLoadOlder})),Object(r.a)(O.a,{},void 0,Object(r.a)(j.a,{}),Object(r.a)(w.a,{scrollKey:"account_gallery",shouldUpdateScroll:e},void 0,Object(r.a)("div",{className:"scrollable scrollable--flex",onScroll:this.handleScroll},void 0,Object(r.a)(M.a,{accountId:this.props.params.accountId}),Object(r.a)("div",{role:"feed",className:"account-gallery__container"},void 0,o.map(function(a,e){return null===a?Object(r.a)(k,{maxId:0<e?o.getIn(e-1,"id"):null,onLoadMore:t.handleLoadMore},"more:"+o.getIn(e+1,"id")):Object(r.a)(I,{media:a},a.get("id"))}),n),c&&0===o.size&&Object(r.a)("div",{className:"scrollable__append"},void 0,Object(r.a)(h.a,{}))))))},a}(m.a),Object(n.a)(_,"propTypes",{params:p.a.object.isRequired,dispatch:p.a.func.isRequired,medias:l.a.list.isRequired,isLoading:p.a.bool,hasMore:p.a.bool}),y=L))||y}}]);
//# sourceMappingURL=account_gallery.js.map //# sourceMappingURL=account_gallery.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{726:function(t,s,a){"use strict";a.r(s),a.d(s,"default",function(){return U});var e,i,o,p=a(0),n=a.n(p),c=a(6),r=a.n(c),d=a(3),u=a.n(d),h=a(7),l=a.n(h),I=(a(1),a(12)),m=a(17),w=a.n(m),b=a(2),f=a.n(b),j=a(13),R=a(19),L=a(200),O=a(194),g=a(193),v=a(694),M=a(196),y=a(5),S=a(18),U=Object(I.connect)(function(t,s){var a=s.params.accountId,e=s.withReplies,i=void 0!==e&&e,o=i?a+":with_replies":a;return{statusIds:t.getIn(["timelines","account:"+o,"items"],Object(y.List)()),featuredStatusIds:i?Object(y.List)():t.getIn(["timelines","account:"+a+":pinned","items"],Object(y.List)()),isLoading:t.getIn(["timelines","account:"+o,"isLoading"]),hasMore:t.getIn(["timelines","account:"+o,"hasMore"])}})((o=i=function(t){function s(){var a,e,i;r()(this,s);for(var o=arguments.length,p=Array(o),n=0;n<o;n++)p[n]=arguments[n];return a=e=u()(this,t.call.apply(t,[this].concat(p))),e.handleLoadMore=function(t){e.props.dispatch(Object(R.l)(e.props.params.accountId,{maxId:t,withReplies:e.props.withReplies}))},i=a,u()(e,i)}return l()(s,t),s.prototype.componentWillMount=function(){var t=this.props,s=t.params.accountId,a=t.withReplies;this.props.dispatch(Object(j.w)(s)),a||this.props.dispatch(Object(R.j)(s)),this.props.dispatch(Object(R.l)(s,{withReplies:a}))},s.prototype.componentWillReceiveProps=function(t){(t.params.accountId!==this.props.params.accountId&&t.params.accountId||t.withReplies!==this.props.withReplies)&&(this.props.dispatch(Object(j.w)(t.params.accountId)),t.withReplies||this.props.dispatch(Object(R.j)(t.params.accountId)),this.props.dispatch(Object(R.l)(t.params.accountId,{withReplies:t.params.withReplies})))},s.prototype.render=function(){var t=this.props,s=t.shouldUpdateScroll,a=t.statusIds,e=t.featuredStatusIds,i=t.isLoading,o=t.hasMore;return!a&&i?n()(g.a,{},void 0,n()(O.a,{})):n()(g.a,{},void 0,n()(M.a,{}),n()(L.a,{prepend:n()(v.a,{accountId:this.props.params.accountId}),scrollKey:"account_timeline",statusIds:a,featuredStatusIds:e,isLoading:i,hasMore:o,onLoadMore:this.handleLoadMore,shouldUpdateScroll:s}))},s}(S.a),i.propTypes={params:f.a.object.isRequired,dispatch:f.a.func.isRequired,shouldUpdateScroll:f.a.func,statusIds:w.a.list,featuredStatusIds:w.a.list,isLoading:f.a.bool,hasMore:f.a.bool,withReplies:f.a.bool},e=o))||e}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[13],{687:function(t,e,a){"use strict";a.r(e),a.d(e,"default",function(){return v});var s,i,o,c=a(1),n=a(6),p=a(0),r=a(2),d=(a(3),a(20)),u=a(26),l=a.n(u),h=a(5),b=a.n(h),m=a(27),j=a(36),I=a(647),O=a(289),w=a(640),f=a(902),R=a(642),g=a(4),L=a(24),M=a(7),v=Object(d.connect)(function(t,e){var a=e.params.accountId,s=e.withReplies,i=void 0!==s&&s,o=i?a+":with_replies":a;return{statusIds:t.getIn(["timelines","account:"+o,"items"],Object(g.List)()),featuredStatusIds:i?Object(g.List)():t.getIn(["timelines","account:"+a+":pinned","items"],Object(g.List)()),isLoading:t.getIn(["timelines","account:"+o,"isLoading"]),hasMore:t.getIn(["timelines","account:"+o,"hasMore"])}})((o=i=function(i){function t(){for(var e,t=arguments.length,a=new Array(t),s=0;s<t;s++)a[s]=arguments[s];return e=i.call.apply(i,[this].concat(a))||this,Object(r.a)(Object(p.a)(Object(p.a)(e)),"handleLoadMore",function(t){e.props.dispatch(Object(j.n)(e.props.params.accountId,{maxId:t,withReplies:e.props.withReplies}))}),e}Object(n.a)(t,i);var e=t.prototype;return e.componentWillMount=function(){var t=this.props,e=t.params.accountId,a=t.withReplies;this.props.dispatch(Object(m.A)(e)),a||this.props.dispatch(Object(j.l)(e)),this.props.dispatch(Object(j.n)(e,{withReplies:a}))},e.componentWillReceiveProps=function(t){(t.params.accountId!==this.props.params.accountId&&t.params.accountId||t.withReplies!==this.props.withReplies)&&(this.props.dispatch(Object(m.A)(t.params.accountId)),t.withReplies||this.props.dispatch(Object(j.l)(t.params.accountId)),this.props.dispatch(Object(j.n)(t.params.accountId,{withReplies:t.params.withReplies})))},e.render=function(){var t=this.props,e=t.shouldUpdateScroll,a=t.statusIds,s=t.featuredStatusIds,i=t.isLoading,o=t.hasMore;return!a&&i?Object(c.a)(w.a,{},void 0,Object(c.a)(O.a,{})):Object(c.a)(w.a,{},void 0,Object(c.a)(R.a,{}),Object(c.a)(I.a,{prepend:Object(c.a)(f.a,{accountId:this.props.params.accountId}),alwaysPrepend:!0,scrollKey:"account_timeline",statusIds:a,featuredStatusIds:s,isLoading:i,hasMore:o,onLoadMore:this.handleLoadMore,shouldUpdateScroll:e,emptyMessage:Object(c.a)(M.b,{id:"empty_column.account_timeline",defaultMessage:"No toots here!"})}))},t}(L.a),Object(r.a)(i,"propTypes",{params:b.a.object.isRequired,dispatch:b.a.func.isRequired,shouldUpdateScroll:b.a.func,statusIds:l.a.list,featuredStatusIds:l.a.list,isLoading:b.a.bool,hasMore:b.a.bool,withReplies:b.a.bool}),s=o))||s}}]);
//# sourceMappingURL=account_timeline.js.map //# sourceMappingURL=account_timeline.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{719:function(e,n,t){"use strict";t.r(n),t.d(n,"default",function(){return U});var o,a,c,s=t(0),r=t.n(s),i=t(6),d=t.n(i),u=t(3),l=t.n(u),p=t(7),h=t.n(p),f=t(38),b=t.n(f),g=(t(1),t(12)),y=t(4),m=t(18),v=t(17),k=t.n(v),M=t(2),j=t.n(M),w=t(194),O=t(193),I=t(197),q=t(693),L=t(190),R=t(195),S=Object(y.f)({heading:{id:"column.blocks",defaultMessage:"Blocked users"}}),U=Object(g.connect)(function(e){return{accountIds:e.getIn(["user_lists","blocks","items"])}})(o=Object(y.g)((c=a=function(e){function n(){var t,o,a;d()(this,n);for(var c=arguments.length,s=Array(c),r=0;r<c;r++)s[r]=arguments[r];return t=o=l()(this,e.call.apply(e,[this].concat(s))),o.handleLoadMore=b()(function(){o.props.dispatch(Object(L.c)())},300,{leading:!0}),a=t,l()(o,a)}return h()(n,e),n.prototype.componentWillMount=function(){this.props.dispatch(Object(L.d)())},n.prototype.render=function(){var e=this.props,n=e.intl,t=e.accountIds,o=e.shouldUpdateScroll;if(!t)return r()(O.a,{},void 0,r()(w.a,{}));var a=r()(y.b,{id:"empty_column.blocks",defaultMessage:"You haven't blocked any users yet."});return r()(O.a,{icon:"ban",heading:n.formatMessage(S.heading)},void 0,r()(I.a,{}),r()(R.a,{scrollKey:"blocks",onLoadMore:this.handleLoadMore,shouldUpdateScroll:o,emptyMessage:a},void 0,t.map(function(e){return r()(q.a,{id:e},e)})))},n}(m.a),a.propTypes={params:j.a.object.isRequired,dispatch:j.a.func.isRequired,shouldUpdateScroll:j.a.func,accountIds:k.a.list,intl:j.a.object.isRequired},o=c))||o)||o}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[14],{694:function(e,t,a){"use strict";a.r(t),a.d(t,"default",function(){return q});var c,n,o,s=a(1),r=a(6),i=a(0),d=a(2),u=a(53),l=a.n(u),p=(a(3),a(20)),b=a(7),h=a(24),j=a(26),f=a.n(j),O=a(5),g=a.n(O),m=a(289),v=a(640),y=a(644),k=a(887),M=a(388),w=a(641),I=Object(b.f)({heading:{id:"column.blocks",defaultMessage:"Blocked users"}}),q=Object(p.connect)(function(e){return{accountIds:e.getIn(["user_lists","blocks","items"])}})(c=Object(b.g)((o=n=function(n){function e(){for(var e,t=arguments.length,a=new Array(t),c=0;c<t;c++)a[c]=arguments[c];return e=n.call.apply(n,[this].concat(a))||this,Object(d.a)(Object(i.a)(Object(i.a)(e)),"handleLoadMore",l()(function(){e.props.dispatch(Object(M.c)())},300,{leading:!0})),e}Object(r.a)(e,n);var t=e.prototype;return t.componentWillMount=function(){this.props.dispatch(Object(M.d)())},t.render=function(){var e=this.props,t=e.intl,a=e.accountIds,c=e.shouldUpdateScroll;if(!a)return Object(s.a)(v.a,{},void 0,Object(s.a)(m.a,{}));var n=Object(s.a)(b.b,{id:"empty_column.blocks",defaultMessage:"You haven't blocked any users yet."});return Object(s.a)(v.a,{icon:"ban",heading:t.formatMessage(I.heading)},void 0,Object(s.a)(y.a,{}),Object(s.a)(w.a,{scrollKey:"blocks",onLoadMore:this.handleLoadMore,shouldUpdateScroll:c,emptyMessage:n},void 0,a.map(function(e){return Object(s.a)(k.a,{id:e},e)})))},e}(h.a),Object(d.a)(n,"propTypes",{params:g.a.object.isRequired,dispatch:g.a.func.isRequired,shouldUpdateScroll:g.a.func,accountIds:f.a.list,intl:g.a.object.isRequired}),c=o))||c)||c}}]);
//# sourceMappingURL=blocks.js.map //# sourceMappingURL=blocks.js.map

View file

@ -1 +1 @@
{"version":3,"sources":["webpack:///./app/javascript/mastodon/features/blocks/index.js"],"names":["messages","Object","react_intl__WEBPACK_IMPORTED_MODULE_7__","heading","id","defaultMessage","Blocks","react_redux__WEBPACK_IMPORTED_MODULE_6__","state","accountIds","getIn","handleLoadMore","lodash_debounce__WEBPACK_IMPORTED_MODULE_4___default","_this","props","dispatch","_actions_blocks__WEBPACK_IMPORTED_MODULE_15__","leading","componentWillMount","this","render","_props","intl","shouldUpdateScroll","babel_runtime_helpers_jsx__WEBPACK_IMPORTED_MODULE_0___default","_ui_components_column__WEBPACK_IMPORTED_MODULE_12__","_components_loading_indicator__WEBPACK_IMPORTED_MODULE_11__","emptyMessage","icon","formatMessage","_components_column_back_button_slim__WEBPACK_IMPORTED_MODULE_13__","_components_scrollable_list__WEBPACK_IMPORTED_MODULE_16__","scrollKey","onLoadMore","map","_containers_account_container__WEBPACK_IMPORTED_MODULE_14__","react_immutable_pure_component__WEBPACK_IMPORTED_MODULE_8__","propTypes","params","prop_types__WEBPACK_IMPORTED_MODULE_10___default","a","object","isRequired","func","react_immutable_proptypes__WEBPACK_IMPORTED_MODULE_9___default","list"],"mappings":"uVAcMA,EAAWC,OAAAC,EAAA,EAAAD,EACfE,SAAAC,GAAA,gBAAAC,eAAA,mBASmBC,EAFpBL,OAAAM,EAAA,QAAAN,CAJuB,SAAAO,GAAA,OACtBC,WAAYD,EAAME,OAAO,aAAc,SAAU,eAIlDT,OAAAC,EAAA,EAAAD,iLAeCU,eAAiBC,IAAS,WACxBC,EAAKC,MAAMC,SAASd,OAAAe,EAAA,EAAAf,KACnB,KAAOgB,SAAS,6CANnBC,8BACEC,KAAKL,MAAMC,SAASd,OAAAe,EAAA,EAAAf,iBAOtBmB,kBAAU,IAAAC,EACyCF,KAAKL,MAA9CQ,EADAD,EACAC,KAAMb,EADNY,EACMZ,WAAYc,EADlBF,EACkBE,mBAE1B,IAAKd,EACH,OAAAe,IACGC,EAAA,UADH,EAAAD,IAEKE,EAAA,OAKP,IAAMC,EAAAH,IAAgBtB,EAAA,GAAhBE,GAAoC,sBAApCC,eAAyE,uCAE/E,OAAAmB,IACGC,EAAA,GADHG,KACe,MADfzB,QAC8BmB,EAAKO,cAAc7B,EAASG,eAD1D,EAAAqB,IAEKM,EAAA,MAFLN,IAGKO,EAAA,GAHLC,UAIgB,SAJhBC,WAKkBd,KAAKR,eALvBY,mBAM0BA,EAN1BI,aAOoBA,QAPpB,EASOlB,EAAWyB,IAAI,SAAA9B,GAAA,OAAAoB,IACbW,EAAA,GADa/B,GACiBA,GAARA,WAzCCgC,EAAA,KAE3BC,WACLC,OAAQC,EAAAC,EAAUC,OAAOC,WACzB3B,SAAUwB,EAAAC,EAAUG,KAAKD,WACzBnB,mBAAoBgB,EAAAC,EAAUG,KAC9BlC,WAAYmC,EAAAJ,EAAmBK,KAC/BvB,KAAMiB,EAAAC,EAAUC,OAAOC","file":"features/blocks.js","sourcesContent":["import React from 'react';\nimport { connect } from 'react-redux';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { debounce } from 'lodash';\nimport PropTypes from 'prop-types';\nimport LoadingIndicator from '../../components/loading_indicator';\nimport Column from '../ui/components/column';\nimport ColumnBackButtonSlim from '../../components/column_back_button_slim';\nimport AccountContainer from '../../containers/account_container';\nimport { fetchBlocks, expandBlocks } from '../../actions/blocks';\nimport ScrollableList from '../../components/scrollable_list';\n\nconst messages = defineMessages({\n heading: { id: 'column.blocks', defaultMessage: 'Blocked users' },\n});\n\nconst mapStateToProps = state => ({\n accountIds: state.getIn(['user_lists', 'blocks', 'items']),\n});\n\n@connect(mapStateToProps)\n@injectIntl\nexport default class Blocks extends ImmutablePureComponent {\n\n static propTypes = {\n params: PropTypes.object.isRequired,\n dispatch: PropTypes.func.isRequired,\n shouldUpdateScroll: PropTypes.func,\n accountIds: ImmutablePropTypes.list,\n intl: PropTypes.object.isRequired,\n };\n\n componentWillMount () {\n this.props.dispatch(fetchBlocks());\n }\n\n handleLoadMore = debounce(() => {\n this.props.dispatch(expandBlocks());\n }, 300, { leading: true });\n\n render () {\n const { intl, accountIds, shouldUpdateScroll } = this.props;\n\n if (!accountIds) {\n return (\n <Column>\n <LoadingIndicator />\n </Column>\n );\n }\n\n const emptyMessage = <FormattedMessage id='empty_column.blocks' defaultMessage=\"You haven't blocked any users yet.\" />;\n\n return (\n <Column icon='ban' heading={intl.formatMessage(messages.heading)}>\n <ColumnBackButtonSlim />\n <ScrollableList\n scrollKey='blocks'\n onLoadMore={this.handleLoadMore}\n shouldUpdateScroll={shouldUpdateScroll}\n emptyMessage={emptyMessage}\n >\n {accountIds.map(id =>\n <AccountContainer key={id} id={id} />\n )}\n </ScrollableList>\n </Column>\n );\n }\n\n}\n"],"sourceRoot":""} {"version":3,"sources":["webpack:///app/javascript/seagate/sources/git/hacktivis.me/git/mastofe/app/javascript/mastodon/features/blocks/index.js"],"names":["messages","defineMessages","heading","id","defaultMessage","Blocks","connect","state","accountIds","getIn","injectIntl","lodash_debounce__WEBPACK_IMPORTED_MODULE_4___default","_this","props","dispatch","expandBlocks","leading","componentWillMount","this","fetchBlocks","render","_this$props","intl","shouldUpdateScroll","Object","_babel_runtime_helpers_esm_jsx__WEBPACK_IMPORTED_MODULE_0__","_ui_components_column__WEBPACK_IMPORTED_MODULE_12__","_components_loading_indicator__WEBPACK_IMPORTED_MODULE_11__","emptyMessage","react_intl__WEBPACK_IMPORTED_MODULE_7__","icon","formatMessage","_components_column_back_button_slim__WEBPACK_IMPORTED_MODULE_13__","_components_scrollable_list__WEBPACK_IMPORTED_MODULE_16__","scrollKey","onLoadMore","handleLoadMore","map","_containers_account_container__WEBPACK_IMPORTED_MODULE_14__","ImmutablePureComponent","params","PropTypes","object","isRequired","func","ImmutablePropTypes","list"],"mappings":"oTAcMA,EAAWC,YAAe,CAC9BC,QAAO,CAAAC,GAAA,gBAAAC,eAAA,mBASHC,EAFUC,kBAJQ,SAAAC,GAAK,MAAK,CAChCC,WAAYD,EAAME,MAAM,CAAC,aAAc,SAAU,eAIlDC,6NAekBC,IAAS,WACxBC,EAAKC,MAAMC,SAASC,gBACnB,IAAK,CAAEC,SAAS,mDANnBC,mBAAA,WACEC,KAAKL,MAAMC,SAASK,kBAOtBC,OAAA,WAAU,IAAAC,EACyCH,KAAKL,MAA9CS,EADAD,EACAC,KAAMd,EADNa,EACMb,WAAYe,EADlBF,EACkBE,mBAE1B,IAAKf,EACH,OACEgB,OAAAC,EAAA,EAAAD,CAACE,EAAA,EAAD,UACEF,OAAAC,EAAA,EAAAD,CAACG,EAAA,EAAD,KAKN,IAAMC,EAAeJ,OAAAC,EAAA,EAAAD,CAACK,EAAA,EAAD,CAAkB1B,GAAG,sBAAsBC,eAAe,uCAE/E,OACEoB,OAAAC,EAAA,EAAAD,CAACE,EAAA,EAAD,CAAQI,KAAK,MAAM5B,QAASoB,EAAKS,cAAc/B,EAASE,eAAxD,EACEsB,OAAAC,EAAA,EAAAD,CAACQ,EAAA,EAAD,IACAR,OAAAC,EAAA,EAAAD,CAACS,EAAA,EAAD,CACEC,UAAU,SACVC,WAAYjB,KAAKkB,eACjBb,mBAAoBA,EACpBK,aAAcA,QAJhB,EAMGpB,EAAW6B,IAAI,SAAAlC,GAAE,OAChBqB,OAAAC,EAAA,EAAAD,CAACc,EAAA,EAAD,CAA2BnC,GAAIA,GAARA,WAzCdoC,+BAEA,CACjBC,OAAQC,IAAUC,OAAOC,WACzB7B,SAAU2B,IAAUG,KAAKD,WACzBpB,mBAAoBkB,IAAUG,KAC9BpC,WAAYqC,IAAmBC,KAC/BxB,KAAMmB,IAAUC,OAAOC","file":"features/blocks.js","sourcesContent":["import React from 'react';\nimport { connect } from 'react-redux';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { debounce } from 'lodash';\nimport PropTypes from 'prop-types';\nimport LoadingIndicator from '../../components/loading_indicator';\nimport Column from '../ui/components/column';\nimport ColumnBackButtonSlim from '../../components/column_back_button_slim';\nimport AccountContainer from '../../containers/account_container';\nimport { fetchBlocks, expandBlocks } from '../../actions/blocks';\nimport ScrollableList from '../../components/scrollable_list';\n\nconst messages = defineMessages({\n heading: { id: 'column.blocks', defaultMessage: 'Blocked users' },\n});\n\nconst mapStateToProps = state => ({\n accountIds: state.getIn(['user_lists', 'blocks', 'items']),\n});\n\nexport default @connect(mapStateToProps)\n@injectIntl\nclass Blocks extends ImmutablePureComponent {\n\n static propTypes = {\n params: PropTypes.object.isRequired,\n dispatch: PropTypes.func.isRequired,\n shouldUpdateScroll: PropTypes.func,\n accountIds: ImmutablePropTypes.list,\n intl: PropTypes.object.isRequired,\n };\n\n componentWillMount () {\n this.props.dispatch(fetchBlocks());\n }\n\n handleLoadMore = debounce(() => {\n this.props.dispatch(expandBlocks());\n }, 300, { leading: true });\n\n render () {\n const { intl, accountIds, shouldUpdateScroll } = this.props;\n\n if (!accountIds) {\n return (\n <Column>\n <LoadingIndicator />\n </Column>\n );\n }\n\n const emptyMessage = <FormattedMessage id='empty_column.blocks' defaultMessage=\"You haven't blocked any users yet.\" />;\n\n return (\n <Column icon='ban' heading={intl.formatMessage(messages.heading)}>\n <ColumnBackButtonSlim />\n <ScrollableList\n scrollKey='blocks'\n onLoadMore={this.handleLoadMore}\n shouldUpdateScroll={shouldUpdateScroll}\n emptyMessage={emptyMessage}\n >\n {accountIds.map(id =>\n <AccountContainer key={id} id={id} />\n )}\n </ScrollableList>\n </Column>\n );\n }\n\n}\n"],"sourceRoot":""}

View file

@ -1,2 +1,2 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{702:function(n,e,t){"use strict";t.r(e);var o,i,c,a=t(0),l=t.n(a),d=t(6),s=t.n(d),r=t(3),u=t.n(r),m=t(7),p=t.n(m),h=t(1),y=t.n(h),f=t(12),M=t(4),g=t(2),b=t.n(g),v=t(88),I=t(62),j=t(60),O=t(19),C=t(113),U=t(699),k=t(33),w=Object(f.connect)(function(n,e){var t=e.columnId,o=n.getIn(["settings","columns"]),i=o.findIndex(function(n){return n.get("uuid")===t});return{settings:t&&i>=0?o.get(i).get("params"):n.getIn(["settings","community"])}},function(n,e){var t=e.columnId;return{onChange:function(e,o){n(t?Object(C.f)(t,e,o):Object(k.c)(["community"].concat(e),o))}}})(U.a),P=t(63);t.d(e,"default",function(){return L});var x=Object(M.f)({title:{id:"column.community",defaultMessage:"Local timeline"}}),L=Object(f.connect)(function(n,e){var t=e.onlyMedia,o=e.columnId,i=o,c=n.getIn(["settings","columns"]),a=c.findIndex(function(n){return n.get("uuid")===i});return{hasUnread:n.getIn(["timelines","community"+(t?":media":""),"unread"])>0,onlyMedia:o&&a>=0?c.get(a).getIn(["params","other","onlyMedia"]):n.getIn(["settings","community","other","onlyMedia"])}})(o=Object(M.g)((c=i=function(n){function e(){var t,o,i;s()(this,e);for(var c=arguments.length,a=Array(c),l=0;l<c;l++)a[l]=arguments[l];return t=o=u()(this,n.call.apply(n,[this].concat(a))),o.handlePin=function(){var n=o.props,e=n.columnId,t=n.dispatch,i=n.onlyMedia;t(e?Object(C.h)(e):Object(C.e)("COMMUNITY",{other:{onlyMedia:i}}))},o.handleMove=function(n){var e=o.props,t=e.columnId;(0,e.dispatch)(Object(C.g)(t,n))},o.handleHeaderClick=function(){o.column.scrollTop()},o.setRef=function(n){o.column=n},o.handleLoadMore=function(n){var e=o.props,t=e.dispatch,i=e.onlyMedia;t(Object(O.m)({maxId:n,onlyMedia:i}))},i=t,u()(o,i)}return p()(e,n),e.prototype.componentDidMount=function(){var n=this.props,e=n.dispatch,t=n.onlyMedia;e(Object(O.m)({onlyMedia:t})),this.disconnect=e(Object(P.a)({onlyMedia:t}))},e.prototype.componentDidUpdate=function(n){if(n.onlyMedia!==this.props.onlyMedia){var e=this.props,t=e.dispatch,o=e.onlyMedia;this.disconnect(),t(Object(O.m)({onlyMedia:o})),this.disconnect=t(Object(P.a)({onlyMedia:o}))}},e.prototype.componentWillUnmount=function(){this.disconnect&&(this.disconnect(),this.disconnect=null)},e.prototype.render=function(){var n=this.props,e=n.intl,t=n.shouldUpdateScroll,o=n.hasUnread,i=n.columnId,c=n.multiColumn,a=n.onlyMedia,d=!!i;return y.a.createElement(I.a,{ref:this.setRef,label:e.formatMessage(x.title)},l()(j.a,{icon:"users",active:o,title:e.formatMessage(x.title),onPin:this.handlePin,onMove:this.handleMove,onClick:this.handleHeaderClick,pinned:d,multiColumn:c},void 0,l()(w,{columnId:i})),l()(v.a,{trackScroll:!d,scrollKey:"community_timeline-"+i,timelineId:"community"+(a?":media":""),onLoadMore:this.handleLoadMore,emptyMessage:l()(M.b,{id:"empty_column.community",defaultMessage:"The local timeline is empty. Write something publicly to get the ball rolling!"}),shouldUpdateScroll:t}))},e}(y.a.PureComponent),i.contextTypes={router:b.a.object},i.defaultProps={onlyMedia:!1},o=c))||o)||o}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[15],{723:function(e,t,n){"use strict";n.r(t);var o,c,i,d=n(1),a=n(6),l=n(0),s=n(2),r=n(3),u=n.n(r),m=n(20),p=n(7),h=n(5),b=n.n(h),j=n(626),O=n(430),y=n(428),f=n(36),M=n(203),g=n(966),v=n(83),I=Object(m.connect)(function(e,t){var n=t.columnId,o=e.getIn(["settings","columns"]),c=o.findIndex(function(e){return e.get("uuid")===n});return{settings:n&&0<=c?o.get(c).get("params"):e.getIn(["settings","community"])}},function(n,e){var o=e.columnId;return{onChange:function(e,t){n(o?Object(M.f)(o,e,t):Object(v.c)(["community"].concat(e),t))}}})(g.a),C=n(399);n.d(t,"default",function(){return U});var w=Object(p.f)({title:{id:"column.community",defaultMessage:"Local timeline"}}),U=Object(m.connect)(function(e,t){var n=t.onlyMedia,o=t.columnId,c=o,i=e.getIn(["settings","columns"]),a=i.findIndex(function(e){return e.get("uuid")===c});return{hasUnread:0<e.getIn(["timelines","community"+(n?":media":""),"unread"]),onlyMedia:o&&0<=a?i.get(a).getIn(["params","other","onlyMedia"]):e.getIn(["settings","community","other","onlyMedia"])}})(o=Object(p.g)((i=c=function(o){function e(){for(var c,e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c=o.call.apply(o,[this].concat(t))||this,Object(s.a)(Object(l.a)(Object(l.a)(c)),"handlePin",function(){var e=c.props,t=e.columnId,n=e.dispatch,o=e.onlyMedia;n(t?Object(M.h)(t):Object(M.e)("COMMUNITY",{other:{onlyMedia:o}}))}),Object(s.a)(Object(l.a)(Object(l.a)(c)),"handleMove",function(e){var t=c.props,n=t.columnId;(0,t.dispatch)(Object(M.g)(n,e))}),Object(s.a)(Object(l.a)(Object(l.a)(c)),"handleHeaderClick",function(){c.column.scrollTop()}),Object(s.a)(Object(l.a)(Object(l.a)(c)),"setRef",function(e){c.column=e}),Object(s.a)(Object(l.a)(Object(l.a)(c)),"handleLoadMore",function(e){var t=c.props,n=t.dispatch,o=t.onlyMedia;n(Object(f.o)({maxId:e,onlyMedia:o}))}),c}Object(a.a)(e,o);var t=e.prototype;return t.componentDidMount=function(){var e=this.props,t=e.dispatch,n=e.onlyMedia;t(Object(f.o)({onlyMedia:n})),this.disconnect=t(Object(C.a)({onlyMedia:n}))},t.componentDidUpdate=function(e){if(e.onlyMedia!==this.props.onlyMedia){var t=this.props,n=t.dispatch,o=t.onlyMedia;this.disconnect(),n(Object(f.o)({onlyMedia:o})),this.disconnect=n(Object(C.a)({onlyMedia:o}))}},t.componentWillUnmount=function(){this.disconnect&&(this.disconnect(),this.disconnect=null)},t.render=function(){var e=this.props,t=e.intl,n=e.shouldUpdateScroll,o=e.hasUnread,c=e.columnId,i=e.multiColumn,a=e.onlyMedia,l=!!c;return u.a.createElement(O.a,{ref:this.setRef,label:t.formatMessage(w.title)},Object(d.a)(y.a,{icon:"users",active:o,title:t.formatMessage(w.title),onPin:this.handlePin,onMove:this.handleMove,onClick:this.handleHeaderClick,pinned:l,multiColumn:i},void 0,Object(d.a)(I,{columnId:c})),Object(d.a)(j.a,{trackScroll:!l,scrollKey:"community_timeline-"+c,timelineId:"community"+(a?":media":""),onLoadMore:this.handleLoadMore,emptyMessage:Object(d.a)(p.b,{id:"empty_column.community",defaultMessage:"The local timeline is empty. Write something publicly to get the ball rolling!"}),shouldUpdateScroll:n}))},e}(u.a.PureComponent),Object(s.a)(c,"contextTypes",{router:b.a.object}),Object(s.a)(c,"defaultProps",{onlyMedia:!1}),o=i))||o)||o}}]);
//# sourceMappingURL=community_timeline.js.map //# sourceMappingURL=community_timeline.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{708:function(n,o,e){"use strict";e.r(o);var a,i,t,r,c,s,d=e(0),l=e.n(d),u=e(6),m=e.n(u),f=e(3),p=e.n(f),b=e(7),h=e.n(b),g=e(38),k=e.n(g),v=(e(1),e(12)),y=e(4),_=e(18),j=e(2),M=e.n(j),O=e(17),w=e.n(O),D=e(194),U=e(193),C=e(197),R=e(758),q=e.n(R),N=e(51),S=e(20),T=Object(y.f)({unblockDomain:{id:"account.unblock_domain",defaultMessage:"Unhide {domain}"}}),A=Object(y.g)((t=i=function(n){function o(){var e,a,i;m()(this,o);for(var t=arguments.length,r=Array(t),c=0;c<t;c++)r[c]=arguments[c];return e=a=p()(this,n.call.apply(n,[this].concat(r))),a.handleDomainUnblock=function(){a.props.onUnblockDomain(a.props.domain)},i=e,p()(a,i)}return h()(o,n),o.prototype.render=function(){var n=this.props,o=n.domain,e=n.intl;return l()("div",{className:"domain"},void 0,l()("div",{className:"domain__wrapper"},void 0,l()("span",{className:"domain__domain-name"},void 0,l()("strong",{},void 0,o)),l()("div",{className:"domain__buttons"},void 0,l()(S.a,{active:!0,icon:"unlock-alt",title:e.formatMessage(T.unblockDomain,{domain:o}),onClick:this.handleDomainUnblock}))))},o}(_.a),i.propTypes={domain:M.a.string,onUnblockDomain:M.a.func.isRequired,intl:M.a.object.isRequired},a=t))||a,I=e(21),L=Object(y.f)({blockDomainConfirm:{id:"confirmations.domain_block.confirm",defaultMessage:"Hide entire domain"}}),H=Object(y.g)(Object(v.connect)(function(){return function(n,o){return q()(o),{}}},function(n,o){var e=o.intl;return{onBlockDomain:function(o){n(Object(I.d)("CONFIRM",{message:l()(y.b,{id:"confirmations.domain_block.message",defaultMessage:"Are you really, really sure you want to block the entire {domain}? In most cases a few targeted blocks or mutes are sufficient and preferable.",values:{domain:l()("strong",{},void 0,o)}}),confirm:e.formatMessage(L.blockDomainConfirm),onConfirm:function(){return n(Object(N.e)(o))}}))},onUnblockDomain:function(o){n(Object(N.h)(o))}}})(A)),J=e(195);e.d(o,"default",function(){return E});var B=Object(y.f)({heading:{id:"column.domain_blocks",defaultMessage:"Hidden domains"},unblockDomain:{id:"account.unblock_domain",defaultMessage:"Unhide {domain}"}}),E=Object(v.connect)(function(n){return{domains:n.getIn(["domain_lists","blocks","items"])}})(r=Object(y.g)((s=c=function(n){function o(){var e,a,i;m()(this,o);for(var t=arguments.length,r=Array(t),c=0;c<t;c++)r[c]=arguments[c];return e=a=p()(this,n.call.apply(n,[this].concat(r))),a.handleLoadMore=k()(function(){a.props.dispatch(Object(N.f)())},300,{leading:!0}),i=e,p()(a,i)}return h()(o,n),o.prototype.componentWillMount=function(){this.props.dispatch(Object(N.g)())},o.prototype.render=function(){var n=this.props,o=n.intl,e=n.domains,a=n.shouldUpdateScroll;if(!e)return l()(U.a,{},void 0,l()(D.a,{}));var i=l()(y.b,{id:"empty_column.domain_blocks",defaultMessage:"There are no hidden domains yet."});return l()(U.a,{icon:"minus-circle",heading:o.formatMessage(B.heading)},void 0,l()(C.a,{}),l()(J.a,{scrollKey:"domain_blocks",onLoadMore:this.handleLoadMore,shouldUpdateScroll:a,emptyMessage:i},void 0,e.map(function(n){return l()(H,{domain:n},n)})))},o}(_.a),c.propTypes={params:M.a.object.isRequired,dispatch:M.a.func.isRequired,shouldUpdateScroll:M.a.func,domains:w.a.orderedSet,intl:M.a.object.isRequired},r=s))||r)||r},758:function(n,o,e){"use strict";o.__esModule=!0,o.default=function(n){if(null==n)throw new TypeError("Cannot destructure undefined")}}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[18],{720:function(n,e,a){"use strict";a.r(e);var o,t,i,c,r,d,s=a(1),l=a(6),u=a(0),b=a(2),m=a(53),f=a.n(m),p=(a(3),a(20)),j=a(7),O=a(24),h=a(5),g=a.n(h),k=a(26),v=a.n(k),y=a(289),M=a(640),_=a(644),w=a(161),D=a(63),U=Object(j.f)({unblockDomain:{id:"account.unblock_domain",defaultMessage:"Unhide {domain}"}}),R=Object(j.g)((i=t=function(t){function n(){for(var n,e=arguments.length,a=new Array(e),o=0;o<e;o++)a[o]=arguments[o];return n=t.call.apply(t,[this].concat(a))||this,Object(b.a)(Object(u.a)(Object(u.a)(n)),"handleDomainUnblock",function(){n.props.onUnblockDomain(n.props.domain)}),n}return Object(l.a)(n,t),n.prototype.render=function(){var n=this.props,e=n.domain,a=n.intl;return Object(s.a)("div",{className:"domain"},void 0,Object(s.a)("div",{className:"domain__wrapper"},void 0,Object(s.a)("span",{className:"domain__domain-name"},void 0,Object(s.a)("strong",{},void 0,e)),Object(s.a)("div",{className:"domain__buttons"},void 0,Object(s.a)(D.a,{active:!0,icon:"unlock-alt",title:a.formatMessage(U.unblockDomain,{domain:e}),onClick:this.handleDomainUnblock}))))},n}(O.a),Object(b.a)(t,"propTypes",{domain:g.a.string,onUnblockDomain:g.a.func.isRequired,intl:g.a.object.isRequired}),o=i))||o,q=a(49),C=Object(j.f)({blockDomainConfirm:{id:"confirmations.domain_block.confirm",defaultMessage:"Hide entire domain"}}),N=Object(j.g)(Object(p.connect)(function(){return function(){return{}}},function(e,n){var a=n.intl;return{onBlockDomain:function(n){e(Object(q.d)("CONFIRM",{message:Object(s.a)(j.b,{id:"confirmations.domain_block.message",defaultMessage:"Are you really, really sure you want to block the entire {domain}? In most cases a few targeted blocks or mutes are sufficient and preferable.",values:{domain:Object(s.a)("strong",{},void 0,n)}}),confirm:a.formatMessage(C.blockDomainConfirm),onConfirm:function(){return e(Object(w.e)(n))}}))},onUnblockDomain:function(n){e(Object(w.h)(n))}}})(R)),S=a(641);a.d(e,"default",function(){return I});var A=Object(j.f)({heading:{id:"column.domain_blocks",defaultMessage:"Hidden domains"},unblockDomain:{id:"account.unblock_domain",defaultMessage:"Unhide {domain}"}}),I=Object(p.connect)(function(n){return{domains:n.getIn(["domain_lists","blocks","items"])}})(c=Object(j.g)((d=r=function(t){function n(){for(var n,e=arguments.length,a=new Array(e),o=0;o<e;o++)a[o]=arguments[o];return n=t.call.apply(t,[this].concat(a))||this,Object(b.a)(Object(u.a)(Object(u.a)(n)),"handleLoadMore",f()(function(){n.props.dispatch(Object(w.f)())},300,{leading:!0})),n}Object(l.a)(n,t);var e=n.prototype;return e.componentWillMount=function(){this.props.dispatch(Object(w.g)())},e.render=function(){var n=this.props,e=n.intl,a=n.domains,o=n.shouldUpdateScroll;if(!a)return Object(s.a)(M.a,{},void 0,Object(s.a)(y.a,{}));var t=Object(s.a)(j.b,{id:"empty_column.domain_blocks",defaultMessage:"There are no hidden domains yet."});return Object(s.a)(M.a,{icon:"minus-circle",heading:e.formatMessage(A.heading)},void 0,Object(s.a)(_.a,{}),Object(s.a)(S.a,{scrollKey:"domain_blocks",onLoadMore:this.handleLoadMore,shouldUpdateScroll:o,emptyMessage:t},void 0,a.map(function(n){return Object(s.a)(N,{domain:n},n)})))},n}(O.a),Object(b.a)(r,"propTypes",{params:g.a.object.isRequired,dispatch:g.a.func.isRequired,shouldUpdateScroll:g.a.func,domains:v.a.orderedSet,intl:g.a.object.isRequired}),c=d))||c)||c}}]);
//# sourceMappingURL=domain_blocks.js.map //# sourceMappingURL=domain_blocks.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{720:function(t,e,o){"use strict";o.r(e),o.d(e,"default",function(){return U});var n,s,a,i=o(0),u=o.n(i),r=o(6),l=o.n(r),c=o(3),d=o.n(c),h=o(7),p=o.n(h),f=o(38),g=o.n(f),m=o(1),v=o.n(m),b=o(12),M=o(2),I=o.n(M),y=o(17),j=o.n(y),w=o(86),O=o(193),L=o(60),k=o(113),C=o(200),R=o(4),_=o(18),S=Object(R.f)({heading:{id:"column.favourites",defaultMessage:"Favourites"}}),U=Object(b.connect)(function(t){return{statusIds:t.getIn(["status_lists","favourites","items"]),isLoading:t.getIn(["status_lists","favourites","isLoading"],!0),hasMore:!!t.getIn(["status_lists","favourites","next"])}})(n=Object(R.g)((a=s=function(t){function e(){var o,n,s;l()(this,e);for(var a=arguments.length,i=Array(a),u=0;u<a;u++)i[u]=arguments[u];return o=n=d()(this,t.call.apply(t,[this].concat(i))),n.handlePin=function(){var t=n.props,e=t.columnId,o=t.dispatch;o(e?Object(k.h)(e):Object(k.e)("FAVOURITES",{}))},n.handleMove=function(t){var e=n.props,o=e.columnId;(0,e.dispatch)(Object(k.g)(o,t))},n.handleHeaderClick=function(){n.column.scrollTop()},n.setRef=function(t){n.column=t},n.handleLoadMore=g()(function(){n.props.dispatch(Object(w.g)())},300,{leading:!0}),s=o,d()(n,s)}return p()(e,t),e.prototype.componentWillMount=function(){this.props.dispatch(Object(w.h)())},e.prototype.render=function(){var t=this.props,e=t.intl,o=t.shouldUpdateScroll,n=t.statusIds,s=t.columnId,a=t.multiColumn,i=t.hasMore,r=t.isLoading,l=!!s,c=u()(R.b,{id:"empty_column.favourited_statuses",defaultMessage:"You don't have any favourite toots yet. When you favourite one, it will show up here."});return v.a.createElement(O.a,{ref:this.setRef,label:e.formatMessage(S.heading)},u()(L.a,{icon:"star",title:e.formatMessage(S.heading),onPin:this.handlePin,onMove:this.handleMove,onClick:this.handleHeaderClick,pinned:l,multiColumn:a,showBackButton:!0}),u()(C.a,{trackScroll:!l,statusIds:n,scrollKey:"favourited_statuses-"+s,hasMore:i,isLoading:r,onLoadMore:this.handleLoadMore,shouldUpdateScroll:o,emptyMessage:c}))},e}(_.a),s.propTypes={dispatch:I.a.func.isRequired,shouldUpdateScroll:I.a.func,statusIds:j.a.list.isRequired,intl:I.a.object.isRequired,columnId:I.a.string,multiColumn:I.a.bool,hasMore:I.a.bool,isLoading:I.a.bool},n=a))||n)||n}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[19],{693:function(t,e,a){"use strict";a.r(e),a.d(e,"default",function(){return C});var o,n,s,r=a(1),i=a(6),c=a(0),u=a(2),l=a(53),d=a.n(l),h=a(3),b=a.n(h),p=a(20),f=a(5),j=a.n(f),O=a(26),g=a.n(O),m=a(162),v=a(640),M=a(428),I=a(203),w=a(647),y=a(7),L=a(24),k=Object(y.f)({heading:{id:"column.favourites",defaultMessage:"Favourites"}}),C=Object(p.connect)(function(t){return{statusIds:t.getIn(["status_lists","favourites","items"]),isLoading:t.getIn(["status_lists","favourites","isLoading"],!0),hasMore:!!t.getIn(["status_lists","favourites","next"])}})(o=Object(y.g)((s=n=function(n){function t(){for(var o,t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];return o=n.call.apply(n,[this].concat(e))||this,Object(u.a)(Object(c.a)(Object(c.a)(o)),"handlePin",function(){var t=o.props,e=t.columnId,a=t.dispatch;a(e?Object(I.h)(e):Object(I.e)("FAVOURITES",{}))}),Object(u.a)(Object(c.a)(Object(c.a)(o)),"handleMove",function(t){var e=o.props,a=e.columnId;(0,e.dispatch)(Object(I.g)(a,t))}),Object(u.a)(Object(c.a)(Object(c.a)(o)),"handleHeaderClick",function(){o.column.scrollTop()}),Object(u.a)(Object(c.a)(Object(c.a)(o)),"setRef",function(t){o.column=t}),Object(u.a)(Object(c.a)(Object(c.a)(o)),"handleLoadMore",d()(function(){o.props.dispatch(Object(m.g)())},300,{leading:!0})),o}Object(i.a)(t,n);var e=t.prototype;return e.componentWillMount=function(){this.props.dispatch(Object(m.h)())},e.render=function(){var t=this.props,e=t.intl,a=t.shouldUpdateScroll,o=t.statusIds,n=t.columnId,s=t.multiColumn,i=t.hasMore,c=t.isLoading,u=!!n,l=Object(r.a)(y.b,{id:"empty_column.favourited_statuses",defaultMessage:"You don't have any favourite toots yet. When you favourite one, it will show up here."});return b.a.createElement(v.a,{ref:this.setRef,label:e.formatMessage(k.heading)},Object(r.a)(M.a,{icon:"star",title:e.formatMessage(k.heading),onPin:this.handlePin,onMove:this.handleMove,onClick:this.handleHeaderClick,pinned:u,multiColumn:s,showBackButton:!0}),Object(r.a)(w.a,{trackScroll:!u,statusIds:o,scrollKey:"favourited_statuses-"+n,hasMore:i,isLoading:c,onLoadMore:this.handleLoadMore,shouldUpdateScroll:a,emptyMessage:l}))},t}(L.a),Object(u.a)(n,"propTypes",{dispatch:j.a.func.isRequired,shouldUpdateScroll:j.a.func,statusIds:g.a.list.isRequired,intl:j.a.object.isRequired,columnId:j.a.string,multiColumn:j.a.bool,hasMore:j.a.bool,isLoading:j.a.bool}),o=s))||o)||o}}]);
//# sourceMappingURL=favourited_statuses.js.map //# sourceMappingURL=favourited_statuses.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{722:function(t,s,o){"use strict";o.r(s),o.d(s,"default",function(){return U});var e,a,n,r=o(0),p=o.n(r),i=o(6),u=o.n(i),c=o(3),d=o.n(c),l=o(7),h=o.n(l),f=(o(1),o(12)),m=o(18),v=o(2),y=o.n(v),I=o(17),w=o.n(I),b=o(194),j=o(26),g=o(4),M=o(693),O=o(193),R=o(196),S=o(195),U=Object(f.connect)(function(t,s){return{accountIds:t.getIn(["user_lists","favourited_by",s.params.statusId])}})((n=a=function(t){function s(){return u()(this,s),d()(this,t.apply(this,arguments))}return h()(s,t),s.prototype.componentWillMount=function(){this.props.dispatch(Object(j.l)(this.props.params.statusId))},s.prototype.componentWillReceiveProps=function(t){t.params.statusId!==this.props.params.statusId&&t.params.statusId&&this.props.dispatch(Object(j.l)(t.params.statusId))},s.prototype.render=function(){var t=this.props,s=t.shouldUpdateScroll,o=t.accountIds;if(!o)return p()(O.a,{},void 0,p()(b.a,{}));var e=p()(g.b,{id:"empty_column.favourites",defaultMessage:"No one has favourited this toot yet. When someone does, they will show up here."});return p()(O.a,{},void 0,p()(R.a,{}),p()(S.a,{scrollKey:"favourites",shouldUpdateScroll:s,emptyMessage:e},void 0,o.map(function(t){return p()(M.a,{id:t,withNote:!1},t)})))},s}(m.a),a.propTypes={params:y.a.object.isRequired,dispatch:y.a.func.isRequired,shouldUpdateScroll:y.a.func,accountIds:w.a.list},e=n))||e}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[20],{691:function(t,a,e){"use strict";e.r(a),e.d(a,"default",function(){return y});var s,o,n,r=e(1),c=e(6),i=e(2),u=(e(3),e(20)),p=e(24),d=e(5),l=e.n(d),h=e(26),f=e.n(h),b=e(289),m=e(55),j=e(7),v=e(887),O=e(640),I=e(642),w=e(641),y=Object(u.connect)(function(t,a){return{accountIds:t.getIn(["user_lists","favourited_by",a.params.statusId])}})((n=o=function(t){function a(){return t.apply(this,arguments)||this}Object(c.a)(a,t);var e=a.prototype;return e.componentWillMount=function(){this.props.dispatch(Object(m.l)(this.props.params.statusId))},e.componentWillReceiveProps=function(t){t.params.statusId!==this.props.params.statusId&&t.params.statusId&&this.props.dispatch(Object(m.l)(t.params.statusId))},e.render=function(){var t=this.props,a=t.shouldUpdateScroll,e=t.accountIds;if(!e)return Object(r.a)(O.a,{},void 0,Object(r.a)(b.a,{}));var s=Object(r.a)(j.b,{id:"empty_column.favourites",defaultMessage:"No one has favourited this toot yet. When someone does, they will show up here."});return Object(r.a)(O.a,{},void 0,Object(r.a)(I.a,{}),Object(r.a)(w.a,{scrollKey:"favourites",shouldUpdateScroll:a,emptyMessage:s},void 0,e.map(function(t){return Object(r.a)(v.a,{id:t,withNote:!1},t)})))},a}(p.a),Object(i.a)(o,"propTypes",{params:l.a.object.isRequired,dispatch:l.a.func.isRequired,shouldUpdateScroll:l.a.func,accountIds:f.a.list}),s=n))||s}}]);
//# sourceMappingURL=favourites.js.map //# sourceMappingURL=favourites.js.map

View file

@ -1 +1 @@
{"version":3,"sources":["webpack:///./app/javascript/mastodon/features/favourites/index.js"],"names":["Favourites","Object","react_redux__WEBPACK_IMPORTED_MODULE_5__","state","props","accountIds","getIn","params","statusId","componentWillMount","this","dispatch","_actions_interactions__WEBPACK_IMPORTED_MODULE_10__","componentWillReceiveProps","nextProps","render","_props","shouldUpdateScroll","babel_runtime_helpers_jsx__WEBPACK_IMPORTED_MODULE_0___default","_ui_components_column__WEBPACK_IMPORTED_MODULE_13__","_components_loading_indicator__WEBPACK_IMPORTED_MODULE_9__","emptyMessage","react_intl__WEBPACK_IMPORTED_MODULE_11__","id","defaultMessage","_components_column_back_button__WEBPACK_IMPORTED_MODULE_14__","_components_scrollable_list__WEBPACK_IMPORTED_MODULE_15__","scrollKey","map","_containers_account_container__WEBPACK_IMPORTED_MODULE_12__","withNote","react_immutable_pure_component__WEBPACK_IMPORTED_MODULE_6__","propTypes","prop_types__WEBPACK_IMPORTED_MODULE_7___default","a","object","isRequired","func","react_immutable_proptypes__WEBPACK_IMPORTED_MODULE_8___default","list"],"mappings":"sUAkBqBA,EADpBC,OAAAC,EAAA,QAAAD,CAJuB,SAACE,EAAOC,GAAR,OACtBC,WAAYF,EAAMG,OAAO,aAAc,gBAAiBF,EAAMG,OAAOC,6HAarEC,8BACEC,KAAKN,MAAMO,SAASV,OAAAW,EAAA,EAAAX,CAAgBS,KAAKN,MAAMG,OAAOC,wBAGxDK,mCAA2BC,GACrBA,EAAUP,OAAOC,WAAaE,KAAKN,MAAMG,OAAOC,UAAYM,EAAUP,OAAOC,UAC/EE,KAAKN,MAAMO,SAASV,OAAAW,EAAA,EAAAX,CAAgBa,EAAUP,OAAOC,wBAIzDO,kBAAU,IAAAC,EACmCN,KAAKN,MAAxCa,EADAD,EACAC,mBAAoBZ,EADpBW,EACoBX,WAE5B,IAAKA,EACH,OAAAa,IACGC,EAAA,UADH,EAAAD,IAEKE,EAAA,OAKP,IAAMC,EAAAH,IAAgBI,EAAA,GAAhBC,GAAoC,0BAApCC,eAA6E,oFAEnF,OAAAN,IACGC,EAAA,UADH,EAAAD,IAEKO,EAAA,MAFLP,IAIKQ,EAAA,GAJLC,UAKgB,aALhBV,mBAM0BA,EAN1BI,aAOoBA,QAPpB,EASOhB,EAAWuB,IAAI,SAAAL,GAAA,OAAAL,IACbW,EAAA,GADaN,GACiBA,EADjBO,UAC+B,GAAtBP,WA1CKQ,EAAA,KAE/BC,WACLzB,OAAQ0B,EAAAC,EAAUC,OAAOC,WACzBzB,SAAUsB,EAAAC,EAAUG,KAAKD,WACzBnB,mBAAoBgB,EAAAC,EAAUG,KAC9BhC,WAAYiC,EAAAJ,EAAmBK","file":"features/favourites.js","sourcesContent":["import React from 'react';\nimport { connect } from 'react-redux';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport LoadingIndicator from '../../components/loading_indicator';\nimport { fetchFavourites } from '../../actions/interactions';\nimport { FormattedMessage } from 'react-intl';\nimport AccountContainer from '../../containers/account_container';\nimport Column from '../ui/components/column';\nimport ColumnBackButton from '../../components/column_back_button';\nimport ScrollableList from '../../components/scrollable_list';\n\nconst mapStateToProps = (state, props) => ({\n accountIds: state.getIn(['user_lists', 'favourited_by', props.params.statusId]),\n});\n\n@connect(mapStateToProps)\nexport default class Favourites extends ImmutablePureComponent {\n\n static propTypes = {\n params: PropTypes.object.isRequired,\n dispatch: PropTypes.func.isRequired,\n shouldUpdateScroll: PropTypes.func,\n accountIds: ImmutablePropTypes.list,\n };\n\n componentWillMount () {\n this.props.dispatch(fetchFavourites(this.props.params.statusId));\n }\n\n componentWillReceiveProps (nextProps) {\n if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) {\n this.props.dispatch(fetchFavourites(nextProps.params.statusId));\n }\n }\n\n render () {\n const { shouldUpdateScroll, accountIds } = this.props;\n\n if (!accountIds) {\n return (\n <Column>\n <LoadingIndicator />\n </Column>\n );\n }\n\n const emptyMessage = <FormattedMessage id='empty_column.favourites' defaultMessage='No one has favourited this toot yet. When someone does, they will show up here.' />;\n\n return (\n <Column>\n <ColumnBackButton />\n\n <ScrollableList\n scrollKey='favourites'\n shouldUpdateScroll={shouldUpdateScroll}\n emptyMessage={emptyMessage}\n >\n {accountIds.map(id =>\n <AccountContainer key={id} id={id} withNote={false} />\n )}\n </ScrollableList>\n </Column>\n );\n }\n\n}\n"],"sourceRoot":""} {"version":3,"sources":["webpack:///app/javascript/seagate/sources/git/hacktivis.me/git/mastofe/app/javascript/mastodon/features/favourites/index.js"],"names":["Favourites","connect","state","props","accountIds","getIn","params","statusId","componentWillMount","this","dispatch","fetchFavourites","componentWillReceiveProps","nextProps","render","_this$props","shouldUpdateScroll","Object","_babel_runtime_helpers_esm_jsx__WEBPACK_IMPORTED_MODULE_0__","_ui_components_column__WEBPACK_IMPORTED_MODULE_12__","_components_loading_indicator__WEBPACK_IMPORTED_MODULE_8__","emptyMessage","react_intl__WEBPACK_IMPORTED_MODULE_10__","id","defaultMessage","_components_column_back_button__WEBPACK_IMPORTED_MODULE_13__","_components_scrollable_list__WEBPACK_IMPORTED_MODULE_14__","scrollKey","map","_containers_account_container__WEBPACK_IMPORTED_MODULE_11__","withNote","ImmutablePureComponent","PropTypes","object","isRequired","func","ImmutablePropTypes","list"],"mappings":"2RAkBMA,EADUC,kBAJQ,SAACC,EAAOC,GAAR,MAAmB,CACzCC,WAAYF,EAAMG,MAAM,CAAC,aAAc,gBAAiBF,EAAMG,OAAOC,6HAarEC,mBAAA,WACEC,KAAKN,MAAMO,SAASC,YAAgBF,KAAKN,MAAMG,OAAOC,cAGxDK,0BAAA,SAA2BC,GACrBA,EAAUP,OAAOC,WAAaE,KAAKN,MAAMG,OAAOC,UAAYM,EAAUP,OAAOC,UAC/EE,KAAKN,MAAMO,SAASC,YAAgBE,EAAUP,OAAOC,cAIzDO,OAAA,WAAU,IAAAC,EACmCN,KAAKN,MAAxCa,EADAD,EACAC,mBAAoBZ,EADpBW,EACoBX,WAE5B,IAAKA,EACH,OACEa,OAAAC,EAAA,EAAAD,CAACE,EAAA,EAAD,UACEF,OAAAC,EAAA,EAAAD,CAACG,EAAA,EAAD,KAKN,IAAMC,EAAeJ,OAAAC,EAAA,EAAAD,CAACK,EAAA,EAAD,CAAkBC,GAAG,0BAA0BC,eAAe,oFAEnF,OACEP,OAAAC,EAAA,EAAAD,CAACE,EAAA,EAAD,UACEF,OAAAC,EAAA,EAAAD,CAACQ,EAAA,EAAD,IAEAR,OAAAC,EAAA,EAAAD,CAACS,EAAA,EAAD,CACEC,UAAU,aACVX,mBAAoBA,EACpBK,aAAcA,QAHhB,EAKGjB,EAAWwB,IAAI,SAAAL,GAAE,OAChBN,OAAAC,EAAA,EAAAD,CAACY,EAAA,EAAD,CAA2BN,GAAIA,EAAIO,UAAU,GAAtBP,WA1CVQ,+BAEJ,CACjBzB,OAAQ0B,IAAUC,OAAOC,WACzBxB,SAAUsB,IAAUG,KAAKD,WACzBlB,mBAAoBgB,IAAUG,KAC9B/B,WAAYgC,IAAmBC","file":"features/favourites.js","sourcesContent":["import React from 'react';\nimport { connect } from 'react-redux';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport LoadingIndicator from '../../components/loading_indicator';\nimport { fetchFavourites } from '../../actions/interactions';\nimport { FormattedMessage } from 'react-intl';\nimport AccountContainer from '../../containers/account_container';\nimport Column from '../ui/components/column';\nimport ColumnBackButton from '../../components/column_back_button';\nimport ScrollableList from '../../components/scrollable_list';\n\nconst mapStateToProps = (state, props) => ({\n accountIds: state.getIn(['user_lists', 'favourited_by', props.params.statusId]),\n});\n\nexport default @connect(mapStateToProps)\nclass Favourites extends ImmutablePureComponent {\n\n static propTypes = {\n params: PropTypes.object.isRequired,\n dispatch: PropTypes.func.isRequired,\n shouldUpdateScroll: PropTypes.func,\n accountIds: ImmutablePropTypes.list,\n };\n\n componentWillMount () {\n this.props.dispatch(fetchFavourites(this.props.params.statusId));\n }\n\n componentWillReceiveProps (nextProps) {\n if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) {\n this.props.dispatch(fetchFavourites(nextProps.params.statusId));\n }\n }\n\n render () {\n const { shouldUpdateScroll, accountIds } = this.props;\n\n if (!accountIds) {\n return (\n <Column>\n <LoadingIndicator />\n </Column>\n );\n }\n\n const emptyMessage = <FormattedMessage id='empty_column.favourites' defaultMessage='No one has favourited this toot yet. When someone does, they will show up here.' />;\n\n return (\n <Column>\n <ColumnBackButton />\n\n <ScrollableList\n scrollKey='favourites'\n shouldUpdateScroll={shouldUpdateScroll}\n emptyMessage={emptyMessage}\n >\n {accountIds.map(id =>\n <AccountContainer key={id} id={id} withNote={false} />\n )}\n </ScrollableList>\n </Column>\n );\n }\n\n}\n"],"sourceRoot":""}

View file

@ -1,2 +1,2 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{709:function(e,t,o){"use strict";o.r(t);var n,a,c,i,r,s,u=o(0),l=o.n(u),d=o(6),p=o.n(d),f=o(3),h=o.n(f),v=o(7),_=o.n(v),m=o(38),j=o.n(m),g=(o(1),o(12)),b=o(4),w=o(18),y=o(2),q=o.n(y),M=o(17),z=o.n(M),O=o(194),R=o(193),N=o(197),k=o(32),A=o(71),I=o(40),L=o(39),S=o(20),T=Object(b.f)({authorize:{id:"follow_request.authorize",defaultMessage:"Authorize"},reject:{id:"follow_request.reject",defaultMessage:"Reject"}}),U=Object(b.g)((c=a=function(e){function t(){return p()(this,t),h()(this,e.apply(this,arguments))}return _()(t,e),t.prototype.render=function(){var e=this.props,t=e.intl,o=e.account,n=e.onAuthorize,a=e.onReject,c={__html:o.get("note_emojified")};return l()("div",{className:"account-authorize__wrapper"},void 0,l()("div",{className:"account-authorize"},void 0,l()(A.a,{href:o.get("url"),to:"/accounts/"+o.get("id"),className:"detailed-status__display-name"},void 0,l()("div",{className:"account-authorize__avatar"},void 0,l()(I.a,{account:o,size:48})),l()(L.a,{account:o})),l()("div",{className:"account__header__content",dangerouslySetInnerHTML:c})),l()("div",{className:"account--panel"},void 0,l()("div",{className:"account--panel__button"},void 0,l()(S.a,{title:t.formatMessage(T.authorize),icon:"check",onClick:n})),l()("div",{className:"account--panel__button"},void 0,l()(S.a,{title:t.formatMessage(T.reject),icon:"times",onClick:a}))))},t}(w.a),a.propTypes={account:z.a.map.isRequired,onAuthorize:q.a.func.isRequired,onReject:q.a.func.isRequired,intl:q.a.object.isRequired},n=c))||n,C=o(13),J=Object(g.connect)(function(){var e=Object(k.d)();return function(t,o){return{account:e(t,o.id)}}},function(e,t){var o=t.id;return{onAuthorize:function(){e(Object(C.r)(o))},onReject:function(){e(Object(C.E)(o))}}})(U),W=o(195);o.d(t,"default",function(){return E});var x=Object(b.f)({heading:{id:"column.follow_requests",defaultMessage:"Follow requests"}}),E=Object(g.connect)(function(e){return{accountIds:e.getIn(["user_lists","follow_requests","items"])}})(i=Object(b.g)((s=r=function(e){function t(){var o,n,a;p()(this,t);for(var c=arguments.length,i=Array(c),r=0;r<c;r++)i[r]=arguments[r];return o=n=h()(this,e.call.apply(e,[this].concat(i))),n.handleLoadMore=j()(function(){n.props.dispatch(Object(C.t)())},300,{leading:!0}),a=o,h()(n,a)}return _()(t,e),t.prototype.componentWillMount=function(){this.props.dispatch(Object(C.x)())},t.prototype.render=function(){var e=this.props,t=e.intl,o=e.shouldUpdateScroll,n=e.accountIds;if(!n)return l()(R.a,{},void 0,l()(O.a,{}));var a=l()(b.b,{id:"empty_column.follow_requests",defaultMessage:"You don't have any follow requests yet. When you receive one, it will show up here."});return l()(R.a,{icon:"users",heading:t.formatMessage(x.heading)},void 0,l()(N.a,{}),l()(W.a,{scrollKey:"follow_requests",onLoadMore:this.handleLoadMore,shouldUpdateScroll:o,emptyMessage:a},void 0,n.map(function(e){return l()(J,{id:e},e)})))},t}(w.a),r.propTypes={params:q.a.object.isRequired,dispatch:q.a.func.isRequired,shouldUpdateScroll:q.a.func,accountIds:z.a.list,intl:q.a.object.isRequired},i=s))||i)||i}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[21],{719:function(e,t,a){"use strict";a.r(t);var c,o,n,i,r,s,u=a(1),l=a(6),d=a(0),j=a(2),p=a(53),b=a.n(p),f=(a(3),a(20)),h=a(7),O=a(24),v=a(5),_=a.n(v),m=a(26),g=a.n(m),w=a(289),q=a(640),y=a(644),M=a(154),z=a(407),R=a(140),N=a(141),I=a(63),k=Object(h.f)({authorize:{id:"follow_request.authorize",defaultMessage:"Authorize"},reject:{id:"follow_request.reject",defaultMessage:"Reject"}}),A=Object(h.g)((n=o=function(e){function t(){return e.apply(this,arguments)||this}return Object(l.a)(t,e),t.prototype.render=function(){var e=this.props,t=e.intl,a=e.account,c=e.onAuthorize,o=e.onReject,n={__html:a.get("note_emojified")};return Object(u.a)("div",{className:"account-authorize__wrapper"},void 0,Object(u.a)("div",{className:"account-authorize"},void 0,Object(u.a)(z.a,{href:a.get("url"),to:"/accounts/"+a.get("id"),className:"detailed-status__display-name"},void 0,Object(u.a)("div",{className:"account-authorize__avatar"},void 0,Object(u.a)(R.a,{account:a,size:48})),Object(u.a)(N.a,{account:a})),Object(u.a)("div",{className:"account__header__content",dangerouslySetInnerHTML:n})),Object(u.a)("div",{className:"account--panel"},void 0,Object(u.a)("div",{className:"account--panel__button"},void 0,Object(u.a)(I.a,{title:t.formatMessage(k.authorize),icon:"check",onClick:c})),Object(u.a)("div",{className:"account--panel__button"},void 0,Object(u.a)(I.a,{title:t.formatMessage(k.reject),icon:"times",onClick:o}))))},t}(O.a),Object(j.a)(o,"propTypes",{account:g.a.map.isRequired,onAuthorize:_.a.func.isRequired,onReject:_.a.func.isRequired,intl:_.a.object.isRequired}),c=n))||c,L=a(27),S=Object(f.connect)(function(){var a=Object(M.d)();return function(e,t){return{account:a(e,t.id)}}},function(e,t){var a=t.id;return{onAuthorize:function(){e(Object(L.v)(a))},onReject:function(){e(Object(L.I)(a))}}})(A),T=a(641);a.d(t,"default",function(){return C});var U=Object(h.f)({heading:{id:"column.follow_requests",defaultMessage:"Follow requests"}}),C=Object(f.connect)(function(e){return{accountIds:e.getIn(["user_lists","follow_requests","items"])}})(i=Object(h.g)((s=r=function(o){function e(){for(var e,t=arguments.length,a=new Array(t),c=0;c<t;c++)a[c]=arguments[c];return e=o.call.apply(o,[this].concat(a))||this,Object(j.a)(Object(d.a)(Object(d.a)(e)),"handleLoadMore",b()(function(){e.props.dispatch(Object(L.x)())},300,{leading:!0})),e}Object(l.a)(e,o);var t=e.prototype;return t.componentWillMount=function(){this.props.dispatch(Object(L.B)())},t.render=function(){var e=this.props,t=e.intl,a=e.shouldUpdateScroll,c=e.accountIds;if(!c)return Object(u.a)(q.a,{},void 0,Object(u.a)(w.a,{}));var o=Object(u.a)(h.b,{id:"empty_column.follow_requests",defaultMessage:"You don't have any follow requests yet. When you receive one, it will show up here."});return Object(u.a)(q.a,{icon:"users",heading:t.formatMessage(U.heading)},void 0,Object(u.a)(y.a,{}),Object(u.a)(T.a,{scrollKey:"follow_requests",onLoadMore:this.handleLoadMore,shouldUpdateScroll:a,emptyMessage:o},void 0,c.map(function(e){return Object(u.a)(S,{id:e},e)})))},e}(O.a),Object(j.a)(r,"propTypes",{params:_.a.object.isRequired,dispatch:_.a.func.isRequired,shouldUpdateScroll:_.a.func,accountIds:g.a.list,intl:_.a.object.isRequired}),i=s))||i)||i}}]);
//# sourceMappingURL=follow_requests.js.map //# sourceMappingURL=follow_requests.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{725:function(o,a,t){"use strict";t.r(a),t.d(a,"default",function(){return q});var s,r,n,e=t(0),c=t.n(e),p=t(6),i=t.n(p),d=t(3),u=t.n(d),l=t(7),h=t.n(l),f=t(38),m=t.n(f),w=(t(1),t(12)),I=t(18),y=t(2),b=t.n(y),M=t(17),v=t.n(M),j=t(194),g=t(13),O=t(4),S=t(693),L=t(193),R=t(694),U=t(196),k=t(195),q=Object(w.connect)(function(o,a){return{accountIds:o.getIn(["user_lists","followers",a.params.accountId,"items"]),hasMore:!!o.getIn(["user_lists","followers",a.params.accountId,"next"])}})((n=r=function(o){function a(){var t,s,r;i()(this,a);for(var n=arguments.length,e=Array(n),c=0;c<n;c++)e[c]=arguments[c];return t=s=u()(this,o.call.apply(o,[this].concat(e))),s.handleLoadMore=m()(function(){s.props.dispatch(Object(g.u)(s.props.params.accountId))},300,{leading:!0}),r=t,u()(s,r)}return h()(a,o),a.prototype.componentWillMount=function(){this.props.dispatch(Object(g.w)(this.props.params.accountId)),this.props.dispatch(Object(g.y)(this.props.params.accountId))},a.prototype.componentWillReceiveProps=function(o){o.params.accountId!==this.props.params.accountId&&o.params.accountId&&(this.props.dispatch(Object(g.w)(o.params.accountId)),this.props.dispatch(Object(g.y)(o.params.accountId)))},a.prototype.render=function(){var o=this.props,a=o.shouldUpdateScroll,t=o.accountIds,s=o.hasMore;if(!t)return c()(L.a,{},void 0,c()(j.a,{}));var r=c()(O.b,{id:"account.followers.empty",defaultMessage:"No one follows this user yet."});return c()(L.a,{},void 0,c()(U.a,{}),c()(k.a,{scrollKey:"followers",hasMore:s,onLoadMore:this.handleLoadMore,shouldUpdateScroll:a,prepend:c()(R.a,{accountId:this.props.params.accountId,hideTabs:!0}),alwaysPrepend:!0,alwaysShowScrollbar:!0,emptyMessage:r},void 0,t.map(function(o){return c()(S.a,{id:o,withNote:!1},o)})))},a}(I.a),r.propTypes={params:b.a.object.isRequired,dispatch:b.a.func.isRequired,shouldUpdateScroll:b.a.func,accountIds:v.a.list,hasMore:b.a.bool},s=n))||s}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[22],{688:function(a,t,o){"use strict";o.r(t),o.d(t,"default",function(){return L});var e,c,s,r=o(1),n=o(6),p=o(0),i=o(2),d=o(53),u=o.n(d),l=(o(3),o(20)),h=o(24),b=o(5),f=o.n(b),j=o(26),O=o.n(j),m=o(289),I=o(27),w=o(7),y=o(887),M=o(640),v=o(902),g=o(642),A=o(641),L=Object(l.connect)(function(a,t){return{accountIds:a.getIn(["user_lists","followers",t.params.accountId,"items"]),hasMore:!!a.getIn(["user_lists","followers",t.params.accountId,"next"])}})((s=c=function(c){function a(){for(var a,t=arguments.length,o=new Array(t),e=0;e<t;e++)o[e]=arguments[e];return a=c.call.apply(c,[this].concat(o))||this,Object(i.a)(Object(p.a)(Object(p.a)(a)),"handleLoadMore",u()(function(){a.props.dispatch(Object(I.y)(a.props.params.accountId))},300,{leading:!0})),a}Object(n.a)(a,c);var t=a.prototype;return t.componentWillMount=function(){this.props.dispatch(Object(I.A)(this.props.params.accountId)),this.props.dispatch(Object(I.C)(this.props.params.accountId))},t.componentWillReceiveProps=function(a){a.params.accountId!==this.props.params.accountId&&a.params.accountId&&(this.props.dispatch(Object(I.A)(a.params.accountId)),this.props.dispatch(Object(I.C)(a.params.accountId)))},t.render=function(){var a=this.props,t=a.shouldUpdateScroll,o=a.accountIds,e=a.hasMore;if(!o)return Object(r.a)(M.a,{},void 0,Object(r.a)(m.a,{}));var c=Object(r.a)(w.b,{id:"account.followers.empty",defaultMessage:"No one follows this user yet."});return Object(r.a)(M.a,{},void 0,Object(r.a)(g.a,{}),Object(r.a)(A.a,{scrollKey:"followers",hasMore:e,onLoadMore:this.handleLoadMore,shouldUpdateScroll:t,prepend:Object(r.a)(v.a,{accountId:this.props.params.accountId,hideTabs:!0}),alwaysPrepend:!0,emptyMessage:c},void 0,o.map(function(a){return Object(r.a)(y.a,{id:a,withNote:!1},a)})))},a}(h.a),Object(i.a)(c,"propTypes",{params:f.a.object.isRequired,dispatch:f.a.func.isRequired,shouldUpdateScroll:f.a.func,accountIds:O.a.list,hasMore:f.a.bool}),e=s))||e}}]);
//# sourceMappingURL=followers.js.map //# sourceMappingURL=followers.js.map

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show more