commit
e84fee5b86
@ -0,0 +1,24 @@
|
|||||||
|
# Managing emails
|
||||||
|
|
||||||
|
{! backend/administration/CLI_tasks/general_cli_task_info.include !}
|
||||||
|
|
||||||
|
## Send test email (instance email by default)
|
||||||
|
|
||||||
|
```sh tab="OTP"
|
||||||
|
./bin/pleroma_ctl email test [--to <destination email address>]
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh tab="From Source"
|
||||||
|
mix pleroma.email test [--to <destination email address>]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```sh tab="OTP"
|
||||||
|
./bin/pleroma_ctl email test --to root@example.org
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh tab="From Source"
|
||||||
|
mix pleroma.email test --to root@example.org
|
||||||
|
```
|
@ -1,31 +0,0 @@
|
|||||||
# How to activate user recommendation (Who to follow panel)
|
|
||||||
![who-to-follow-panel-small](/uploads/9de1b1300436c32461d272945f1bc23e/who-to-follow-panel-small.png)
|
|
||||||
|
|
||||||
To show the *who to follow* panel, edit `config/prod.secret.exs` in the Pleroma backend. Following code activates the *who to follow* panel:
|
|
||||||
|
|
||||||
```elixir
|
|
||||||
config :pleroma, :suggestions,
|
|
||||||
enabled: true,
|
|
||||||
third_party_engine:
|
|
||||||
"http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
|
|
||||||
timeout: 300_000,
|
|
||||||
limit: 40,
|
|
||||||
web: "https://vinayaka.distsn.org"
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
`config/config.exs` already includes this code, but `enabled:` is `false`.
|
|
||||||
|
|
||||||
`/api/v1/suggestions` is also provided when *who to follow* panel is enabled.
|
|
||||||
|
|
||||||
For advanced customization, following code shows the newcomers of the fediverse at the *who to follow* panel:
|
|
||||||
|
|
||||||
```elixir
|
|
||||||
config :pleroma, :suggestions,
|
|
||||||
enabled: true,
|
|
||||||
third_party_engine:
|
|
||||||
"http://vinayaka.distsn.org/cgi-bin/vinayaka-user-new-suggestions-api.cgi?{{host}}+{{user}}",
|
|
||||||
timeout: 60_000,
|
|
||||||
limit: 40,
|
|
||||||
web: "https://vinayaka.distsn.org/user-new.html"
|
|
||||||
```
|
|
@ -0,0 +1,25 @@
|
|||||||
|
defmodule Mix.Tasks.Pleroma.Email do
|
||||||
|
use Mix.Task
|
||||||
|
|
||||||
|
@shortdoc "Simple Email test"
|
||||||
|
@moduledoc File.read!("docs/administration/CLI_tasks/email.md")
|
||||||
|
|
||||||
|
def run(["test" | args]) do
|
||||||
|
Mix.Pleroma.start_pleroma()
|
||||||
|
|
||||||
|
{options, [], []} =
|
||||||
|
OptionParser.parse(
|
||||||
|
args,
|
||||||
|
strict: [
|
||||||
|
to: :string
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
email = Pleroma.Emails.AdminEmail.test_email(options[:to])
|
||||||
|
{:ok, _} = Pleroma.Emails.Mailer.deliver(email)
|
||||||
|
|
||||||
|
Mix.shell().info(
|
||||||
|
"Test email has been sent to #{inspect(email.to)} from #{inspect(email.from)}"
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,41 @@
|
|||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Web.Feed.TagController do
|
||||||
|
use Pleroma.Web, :controller
|
||||||
|
|
||||||
|
alias Pleroma.Config
|
||||||
|
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||||
|
alias Pleroma.Web.Feed.FeedView
|
||||||
|
|
||||||
|
import Pleroma.Web.ControllerHelper, only: [put_in_if_exist: 3]
|
||||||
|
|
||||||
|
def feed(conn, %{"tag" => raw_tag} = params) do
|
||||||
|
{format, tag} = parse_tag(raw_tag)
|
||||||
|
|
||||||
|
activities =
|
||||||
|
%{"type" => ["Create"], "tag" => tag}
|
||||||
|
|> put_in_if_exist("max_id", params["max_id"])
|
||||||
|
|> ActivityPub.fetch_public_activities()
|
||||||
|
|
||||||
|
conn
|
||||||
|
|> put_resp_content_type("application/atom+xml")
|
||||||
|
|> put_view(FeedView)
|
||||||
|
|> render("tag.#{format}",
|
||||||
|
activities: activities,
|
||||||
|
tag: tag,
|
||||||
|
feed_config: Config.get([:feed])
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
@spec parse_tag(binary() | any()) :: {format :: String.t(), tag :: String.t()}
|
||||||
|
defp parse_tag(raw_tag) when is_binary(raw_tag) do
|
||||||
|
case Enum.reverse(String.split(raw_tag, ".")) do
|
||||||
|
[format | tag] when format in ["atom", "rss"] -> {format, Enum.join(tag, ".")}
|
||||||
|
_ -> {"rss", raw_tag}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defp parse_tag(raw_tag), do: {"rss", raw_tag}
|
||||||
|
end
|
@ -0,0 +1,51 @@
|
|||||||
|
<entry>
|
||||||
|
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
|
||||||
|
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
||||||
|
|
||||||
|
<%= render @view_module, "_tag_author.atom", assigns %>
|
||||||
|
|
||||||
|
<id><%= @data["id"] %></id>
|
||||||
|
<title><%= activity_title(@object, Keyword.get(@feed_config, :post_title, %{})) %></title>
|
||||||
|
<content type="html"><%= activity_content(@object) %></content>
|
||||||
|
|
||||||
|
<%= if @activity.local do %>
|
||||||
|
<link type="application/atom+xml" href='<%= @data["id"] %>' rel="self"/>
|
||||||
|
<link type="text/html" href='<%= @data["id"] %>' rel="alternate"/>
|
||||||
|
<% else %>
|
||||||
|
<link type="text/html" href='<%= @data["external_url"] %>' rel="alternate"/>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<published><%= @data["published"] %></published>
|
||||||
|
<updated><%= @data["published"] %></updated>
|
||||||
|
|
||||||
|
<ostatus:conversation ref="<%= activity_context(@activity) %>">
|
||||||
|
<%= activity_context(@activity) %>
|
||||||
|
</ostatus:conversation>
|
||||||
|
<link href="<%= activity_context(@activity) %>" rel="ostatus:conversation"/>
|
||||||
|
|
||||||
|
<%= if @data["summary"] do %>
|
||||||
|
<summary><%= @data["summary"] %></summary>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= for id <- @activity.recipients do %>
|
||||||
|
<%= if id == Pleroma.Constants.as_public() do %>
|
||||||
|
<link rel="mentioned"
|
||||||
|
ostatus:object-type="http://activitystrea.ms/schema/1.0/collection"
|
||||||
|
href="http://activityschema.org/collection/public"/>
|
||||||
|
<% else %>
|
||||||
|
<%= unless Regex.match?(~r/^#{Pleroma.Web.base_url()}.+followers$/, id) do %>
|
||||||
|
<link rel="mentioned"
|
||||||
|
ostatus:object-type="http://activitystrea.ms/schema/1.0/person"
|
||||||
|
href="<%= id %>" />
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= for tag <- @data["tag"] || [] do %>
|
||||||
|
<category term="<%= tag %>"></category>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= for {emoji, file} <- @data["emoji"] || %{} do %>
|
||||||
|
<link name="<%= emoji %>" rel="emoji" href="<%= file %>"/>
|
||||||
|
<% end %>
|
||||||
|
</entry>
|
@ -0,0 +1,15 @@
|
|||||||
|
<item>
|
||||||
|
<title><%= activity_title(@object, Keyword.get(@feed_config, :post_title, %{})) %></title>
|
||||||
|
|
||||||
|
|
||||||
|
<guid isPermalink="true"><%= activity_context(@activity) %></guid>
|
||||||
|
<link><%= activity_context(@activity) %></link>
|
||||||
|
<pubDate><%= pub_date(@data["published"]) %></pubDate>
|
||||||
|
|
||||||
|
<description><%= activity_content(@object) %></description>
|
||||||
|
<%= for attachment <- @data["attachment"] || [] do %>
|
||||||
|
<enclosure url="<%= attachment_href(attachment) %>" type="<%= attachment_type(attachment) %>"/>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</item>
|
||||||
|
|
@ -0,0 +1,18 @@
|
|||||||
|
<author>
|
||||||
|
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
|
||||||
|
<id><%= @actor.ap_id %></id>
|
||||||
|
<uri><%= @actor.ap_id %></uri>
|
||||||
|
<name><%= @actor.nickname %></name>
|
||||||
|
<summary><%= escape(@actor.bio) %></summary>
|
||||||
|
<link rel="avatar" href="<%= User.avatar_url(@actor) %>"/>
|
||||||
|
<%= if User.banner_url(@actor) do %>
|
||||||
|
<link rel="header" href="<%= User.banner_url(@actor) %>"/>
|
||||||
|
<% end %>
|
||||||
|
<%= if @actor.local do %>
|
||||||
|
<ap_enabled>true</ap_enabled>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<poco:preferredUsername><%= @actor.nickname %></poco:preferredUsername>
|
||||||
|
<poco:displayName><%= @actor.name %></poco:displayName>
|
||||||
|
<poco:note><%= escape(@actor.bio) %></poco:note>
|
||||||
|
</author>
|
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom"
|
||||||
|
xmlns:thr="http://purl.org/syndication/thread/1.0"
|
||||||
|
xmlns:georss="http://www.georss.org/georss"
|
||||||
|
xmlns:activity="http://activitystrea.ms/spec/1.0/"
|
||||||
|
xmlns:media="http://purl.org/syndication/atommedia"
|
||||||
|
xmlns:poco="http://portablecontacts.net/spec/1.0"
|
||||||
|
xmlns:ostatus="http://ostatus.org/schema/1.0"
|
||||||
|
xmlns:statusnet="http://status.net/schema/api/1/">
|
||||||
|
|
||||||
|
<id><%= '#{tag_feed_url(@conn, :feed, @tag)}.rss' %></id>
|
||||||
|
<title>#<%= @tag %></title>
|
||||||
|
|
||||||
|
<subtitle>These are public toots tagged with #<%= @tag %>. You can interact with them if you have an account anywhere in the fediverse.</subtitle>
|
||||||
|
<logo><%= feed_logo() %></logo>
|
||||||
|
<updated><%= most_recent_update(@activities) %></updated>
|
||||||
|
<link rel="self" href="<%= '#{tag_feed_url(@conn, :feed, @tag)}.atom' %>" type="application/atom+xml"/>
|
||||||
|
<%= for activity <- @activities do %>
|
||||||
|
<%= render @view_module, "_tag_activity.atom", Map.merge(assigns, prepare_activity(activity, actor: true)) %>
|
||||||
|
<% end %>
|
||||||
|
</feed>
|
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<rss version="2.0" xmlns:webfeeds="http://webfeeds.org/rss/1.0">
|
||||||
|
<channel>
|
||||||
|
|
||||||
|
|
||||||
|
<title>#<%= @tag %></title>
|
||||||
|
<description>These are public toots tagged with #<%= @tag %>. You can interact with them if you have an account anywhere in the fediverse.</description>
|
||||||
|
<link><%= '#{tag_feed_url(@conn, :feed, @tag)}.rss' %></link>
|
||||||
|
<webfeeds:logo><%= feed_logo() %></webfeeds:logo>
|
||||||
|
<webfeeds:accentColor>2b90d9</webfeeds:accentColor>
|
||||||
|
<%= for activity <- @activities do %>
|
||||||
|
<%= render @view_module, "_tag_activity.xml", Map.merge(assigns, prepare_activity(activity)) %>
|
||||||
|
<% end %>
|
||||||
|
</channel>
|
||||||
|
</rss>
|
@ -1 +1 @@
|
|||||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,user-scalable=no"><title>Pleroma</title><!--server-generated-meta--><link rel=icon type=image/png href=/favicon.png><link href=/static/css/vendors~app.b2603a50868c68a1c192.css rel=stylesheet><link href=/static/css/app.ae04505b31bb0ee2765e.css rel=stylesheet><link href=/static/fontello.1579102213354.css rel=stylesheet></head><body class=hidden><noscript>To use Pleroma, please enable JavaScript.</noscript><div id=app></div><script type=text/javascript src=/static/js/vendors~app.86bc6d5e06d2e17976c5.js></script><script type=text/javascript src=/static/js/app.a43640742dacfb13b6b0.js></script></body></html>
|
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,user-scalable=no"><title>Pleroma</title><!--server-generated-meta--><link rel=icon type=image/png href=/favicon.png><link href=/static/css/vendors~app.b2603a50868c68a1c192.css rel=stylesheet><link href=/static/css/app.ae04505b31bb0ee2765e.css rel=stylesheet><link href=/static/fontello.1580232989700.css rel=stylesheet></head><body class=hidden><noscript>To use Pleroma, please enable JavaScript.</noscript><div id=app></div><script type=text/javascript src=/static/js/vendors~app.9ab182239f3a2abee89f.js></script><script type=text/javascript src=/static/js/app.9cfed8f3d06c299128ea.js></script></body></html>
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,136 @@
|
|||||||
|
@font-face {
|
||||||
|
font-family: "Icons";
|
||||||
|
src: url("./font/fontello.1580232989700.eot");
|
||||||
|
src: url("./font/fontello.1580232989700.eot") format("embedded-opentype"),
|
||||||
|
url("./font/fontello.1580232989700.woff2") format("woff2"),
|
||||||
|
url("./font/fontello.1580232989700.woff") format("woff"),
|
||||||
|
url("./font/fontello.1580232989700.ttf") format("truetype"),
|
||||||
|
url("./font/fontello.1580232989700.svg") format("svg");
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
[class^="icon-"]::before,
|
||||||
|
[class*=" icon-"]::before {
|
||||||
|
font-family: "Icons";
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: normal;
|
||||||
|
speak: none;
|
||||||
|
display: inline-block;
|
||||||
|
text-decoration: inherit;
|
||||||
|
width: 1em;
|
||||||
|
margin-right: .2em;
|
||||||
|
text-align: center;
|
||||||
|
font-variant: normal;
|
||||||
|
text-transform: none;
|
||||||
|
line-height: 1em;
|
||||||
|
margin-left: .2em;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-spin4::before { content: "\e834"; }
|
||||||
|
|
||||||
|
.icon-cancel::before { content: "\e800"; }
|
||||||
|
|
||||||
|
.icon-upload::before { content: "\e801"; }
|
||||||
|
|
||||||
|
.icon-spin3::before { content: "\e832"; }
|
||||||
|
|
||||||
|
.icon-reply::before { content: "\f112"; }
|
||||||
|
|
||||||
|
.icon-star::before { content: "\e802"; }
|
||||||
|
|
||||||
|
.icon-star-empty::before { content: "\e803"; }
|
||||||
|
|
||||||
|
.icon-retweet::before { content: "\e804"; }
|
||||||
|
|
||||||
|
.icon-eye-off::before { content: "\e805"; }
|
||||||
|
|
||||||
|
.icon-binoculars::before { content: "\f1e5"; }
|
||||||
|
|
||||||
|
.icon-cog::before { content: "\e807"; }
|
||||||
|
|
||||||
|
.icon-user-plus::before { content: "\f234"; }
|
||||||
|
|
||||||
|
.icon-menu::before { content: "\f0c9"; }
|
||||||
|
|
||||||
|
.icon-logout::before { content: "\e808"; }
|
||||||
|
|
||||||
|
.icon-down-open::before { content: "\e809"; }
|
||||||
|
|
||||||
|
.icon-attach::before { content: "\e80a"; }
|
||||||
|
|
||||||
|
.icon-link-ext::before { content: "\f08e"; }
|
||||||
|
|
||||||
|
.icon-link-ext-alt::before { content: "\f08f"; }
|
||||||
|
|
||||||
|
.icon-picture::before { content: "\e80b"; }
|
||||||
|
|
||||||
|
.icon-video::before { content: "\e80c"; }
|
||||||
|
|
||||||
|
.icon-right-open::before { content: "\e80d"; }
|
||||||
|
|
||||||
|
.icon-left-open::before { content: "\e80e"; }
|
||||||
|
|
||||||
|
.icon-up-open::before { content: "\e80f"; }
|
||||||
|
|
||||||
|
.icon-comment-empty::before { content: "\f0e5"; }
|
||||||
|
|
||||||
|
.icon-mail-alt::before { content: "\f0e0"; }
|
||||||
|
|
||||||
|
.icon-lock::before { content: "\e811"; }
|
||||||
|
|
||||||
|
.icon-lock-open-alt::before { content: "\f13e"; }
|
||||||
|
|
||||||
|
.icon-globe::before { content: "\e812"; }
|
||||||
|
|
||||||
|
.icon-brush::before { content: "\e813"; }
|
||||||
|
|
||||||
|
.icon-search::before { content: "\e806"; }
|
||||||
|
|
||||||
|
.icon-adjust::before { content: "\e816"; }
|
||||||
|
|
||||||
|
.icon-thumbs-up-alt::before { content: "\f164"; }
|
||||||
|
|
||||||
|
.icon-attention::before { content: "\e814"; }
|
||||||
|
|
||||||
|
.icon-plus-squared::before { content: "\f0fe"; }
|
||||||
|
|
||||||
|
.icon-plus::before { content: "\e815"; }
|
||||||
|
|
||||||
|
.icon-edit::before { content: "\e817"; }
|
||||||
|
|
||||||
|
.icon-play-circled::before { content: "\f144"; }
|
||||||
|
|
||||||
|
.icon-pencil::before { content: "\e818"; }
|
||||||
|
|
||||||
|
.icon-chart-bar::before { content: "\e81b"; }
|
||||||
|
|
||||||
|
.icon-smile::before { content: "\f118"; }
|
||||||
|
|
||||||
|
.icon-bell-alt::before { content: "\f0f3"; }
|
||||||
|
|
||||||
|
.icon-wrench::before { content: "\e81a"; }
|
||||||
|
|
||||||
|
.icon-pin::before { content: "\e819"; }
|
||||||
|
|
||||||
|
.icon-ellipsis::before { content: "\f141"; }
|
||||||
|
|
||||||
|
.icon-bell-ringing-o::before { content: "\e810"; }
|
||||||
|
|
||||||
|
.icon-zoom-in::before { content: "\e81c"; }
|
||||||
|
|
||||||
|
.icon-gauge::before { content: "\f0e4"; }
|
||||||
|
|
||||||
|
.icon-users::before { content: "\e81d"; }
|
||||||
|
|
||||||
|
.icon-info-circled::before { content: "\e81f"; }
|
||||||
|
|
||||||
|
.icon-home-2::before { content: "\e821"; }
|
||||||
|
|
||||||
|
.icon-chat::before { content: "\e81e"; }
|
||||||
|
|
||||||
|
.icon-login::before { content: "\e820"; }
|
||||||
|
|
||||||
|
.icon-arrow-curved::before { content: "\e822"; }
|
@ -1,2 +1,2 @@
|
|||||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{567:function(t,e,i){var c=i(568);"string"==typeof c&&(c=[[t.i,c,""]]),c.locals&&(t.exports=c.locals);(0,i(3).default)("cc6cdea4",c,!0,{})},568:function(t,e,i){(t.exports=i(2)(!1)).push([t.i,".sticker-picker{width:100%}.sticker-picker .contents{min-height:250px}.sticker-picker .contents .sticker-picker-content{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0 4px}.sticker-picker .contents .sticker-picker-content .sticker{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;margin:4px;width:56px;height:56px}.sticker-picker .contents .sticker-picker-content .sticker img{height:100%}.sticker-picker .contents .sticker-picker-content .sticker img:hover{filter:drop-shadow(0 0 5px var(--link,#d8a070))}",""])},569:function(t,e,i){"use strict";i.r(e);var c=i(88),n={components:{TabSwitcher:i(49).a},data:function(){return{meta:{stickers:[]},path:""}},computed:{pack:function(){return this.$store.state.instance.stickers||[]}},methods:{clear:function(){this.meta={stickers:[]}},pick:function(t,e){var i=this,n=this.$store;fetch(t).then(function(t){t.blob().then(function(t){var a=new File([t],e,{mimetype:"image/png"}),s=new FormData;s.append("file",a),c.a.uploadMedia({store:n,formData:s}).then(function(t){i.$emit("uploaded",t),i.clear()},function(t){console.warn("Can't attach sticker"),console.warn(t),i.$emit("upload-failed","default")})})})}}},a=i(0);var s=function(t){i(567)},r=Object(a.a)(n,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"sticker-picker"},[i("tab-switcher",{staticClass:"tab-switcher",attrs:{"render-only-focused":!0,"scrollable-tabs":""}},t._l(t.pack,function(e){return i("div",{key:e.path,staticClass:"sticker-picker-content",attrs:{"image-tooltip":e.meta.title,image:e.path+e.meta.tabIcon}},t._l(e.meta.stickers,function(c){return i("div",{key:c,staticClass:"sticker",on:{click:function(i){i.stopPropagation(),i.preventDefault(),t.pick(e.path+c,e.meta.title)}}},[i("img",{attrs:{src:e.path+c}})])}),0)}),0)],1)},[],!1,s,null,null);e.default=r.exports}}]);
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{575:function(t,e,i){var c=i(576);"string"==typeof c&&(c=[[t.i,c,""]]),c.locals&&(t.exports=c.locals);(0,i(3).default)("cc6cdea4",c,!0,{})},576:function(t,e,i){(t.exports=i(2)(!1)).push([t.i,".sticker-picker{width:100%}.sticker-picker .contents{min-height:250px}.sticker-picker .contents .sticker-picker-content{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0 4px}.sticker-picker .contents .sticker-picker-content .sticker{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;margin:4px;width:56px;height:56px}.sticker-picker .contents .sticker-picker-content .sticker img{height:100%}.sticker-picker .contents .sticker-picker-content .sticker img:hover{filter:drop-shadow(0 0 5px var(--link,#d8a070))}",""])},577:function(t,e,i){"use strict";i.r(e);var c=i(88),n={components:{TabSwitcher:i(51).a},data:function(){return{meta:{stickers:[]},path:""}},computed:{pack:function(){return this.$store.state.instance.stickers||[]}},methods:{clear:function(){this.meta={stickers:[]}},pick:function(t,e){var i=this,n=this.$store;fetch(t).then(function(t){t.blob().then(function(t){var a=new File([t],e,{mimetype:"image/png"}),s=new FormData;s.append("file",a),c.a.uploadMedia({store:n,formData:s}).then(function(t){i.$emit("uploaded",t),i.clear()},function(t){console.warn("Can't attach sticker"),console.warn(t),i.$emit("upload-failed","default")})})})}}},a=i(0);var s=function(t){i(575)},r=Object(a.a)(n,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"sticker-picker"},[i("tab-switcher",{staticClass:"tab-switcher",attrs:{"render-only-focused":!0,"scrollable-tabs":""}},t._l(t.pack,function(e){return i("div",{key:e.path,staticClass:"sticker-picker-content",attrs:{"image-tooltip":e.meta.title,image:e.path+e.meta.tabIcon}},t._l(e.meta.stickers,function(c){return i("div",{key:c,staticClass:"sticker",on:{click:function(i){i.stopPropagation(),i.preventDefault(),t.pick(e.path+c,e.meta.title)}}},[i("img",{attrs:{src:e.path+c}})])}),0)}),0)],1)},[],!1,s,null,null);e.default=r.exports}}]);
|
||||||
//# sourceMappingURL=2.8896ea39a0ea8016391a.js.map
|
//# sourceMappingURL=2.59b096781ddca107175d.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
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
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"type": "EmojiReaction",
|
||||||
|
"signature": {
|
||||||
|
"type": "RsaSignature2017",
|
||||||
|
"signatureValue": "fdxMfQSMwbC6wP6sh6neS/vM5879K67yQkHTbiT5Npr5wAac0y6+o3Ij+41tN3rL6wfuGTosSBTHOtta6R4GCOOhCaCSLMZKypnp1VltCzLDoyrZELnYQIC8gpUXVmIycZbREk22qWUe/w7DAFaKK4UscBlHDzeDVcA0K3Se5Sluqi9/Zh+ldAnEzj/rSEPDjrtvf5wGNf3fHxbKSRKFt90JvKK6hS+vxKUhlRFDf6/SMETw+EhwJSNW4d10yMUakqUWsFv4Acq5LW7l+HpYMvlYY1FZhNde1+uonnCyuQDyvzkff8zwtEJmAXC4RivO/VVLa17SmqheJZfI8oluVg==",
|
||||||
|
"creator": "http://mastodon.example.org/users/admin#main-key",
|
||||||
|
"created": "2018-02-17T18:57:49Z"
|
||||||
|
},
|
||||||
|
"object": "http://localtesting.pleroma.lol/objects/eb92579d-3417-42a8-8652-2492c2d4f454",
|
||||||
|
"content": "~",
|
||||||
|
"nickname": "lain",
|
||||||
|
"id": "http://mastodon.example.org/users/admin#reactions/2",
|
||||||
|
"actor": "http://mastodon.example.org/users/admin",
|
||||||
|
"@context": [
|
||||||
|
"https://www.w3.org/ns/activitystreams",
|
||||||
|
"https://w3id.org/security/v1",
|
||||||
|
{
|
||||||
|
"toot": "http://joinmastodon.org/ns#",
|
||||||
|
"sensitive": "as:sensitive",
|
||||||
|
"ostatus": "http://ostatus.org#",
|
||||||
|
"movedTo": "as:movedTo",
|
||||||
|
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
||||||
|
"inReplyToAtomUri": "ostatus:inReplyToAtomUri",
|
||||||
|
"conversation": "ostatus:conversation",
|
||||||
|
"atomUri": "ostatus:atomUri",
|
||||||
|
"Hashtag": "as:Hashtag",
|
||||||
|
"Emoji": "toot:Emoji"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"type": "EmojiReaction",
|
||||||
|
"signature": {
|
||||||
|
"type": "RsaSignature2017",
|
||||||
|
"signatureValue": "fdxMfQSMwbC6wP6sh6neS/vM5879K67yQkHTbiT5Npr5wAac0y6+o3Ij+41tN3rL6wfuGTosSBTHOtta6R4GCOOhCaCSLMZKypnp1VltCzLDoyrZELnYQIC8gpUXVmIycZbREk22qWUe/w7DAFaKK4UscBlHDzeDVcA0K3Se5Sluqi9/Zh+ldAnEzj/rSEPDjrtvf5wGNf3fHxbKSRKFt90JvKK6hS+vxKUhlRFDf6/SMETw+EhwJSNW4d10yMUakqUWsFv4Acq5LW7l+HpYMvlYY1FZhNde1+uonnCyuQDyvzkff8zwtEJmAXC4RivO/VVLa17SmqheJZfI8oluVg==",
|
||||||
|
"creator": "http://mastodon.example.org/users/admin#main-key",
|
||||||
|
"created": "2018-02-17T18:57:49Z"
|
||||||
|
},
|
||||||
|
"object": "http://localtesting.pleroma.lol/objects/eb92579d-3417-42a8-8652-2492c2d4f454",
|
||||||
|
"content": "👌👌",
|
||||||
|
"nickname": "lain",
|
||||||
|
"id": "http://mastodon.example.org/users/admin#reactions/2",
|
||||||
|
"actor": "http://mastodon.example.org/users/admin",
|
||||||
|
"@context": [
|
||||||
|
"https://www.w3.org/ns/activitystreams",
|
||||||
|
"https://w3id.org/security/v1",
|
||||||
|
{
|
||||||
|
"toot": "http://joinmastodon.org/ns#",
|
||||||
|
"sensitive": "as:sensitive",
|
||||||
|
"ostatus": "http://ostatus.org#",
|
||||||
|
"movedTo": "as:movedTo",
|
||||||
|
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
||||||
|
"inReplyToAtomUri": "ostatus:inReplyToAtomUri",
|
||||||
|
"conversation": "ostatus:conversation",
|
||||||
|
"atomUri": "ostatus:atomUri",
|
||||||
|
"Hashtag": "as:Hashtag",
|
||||||
|
"Emoji": "toot:Emoji"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,52 @@
|
|||||||
|
defmodule Mix.Tasks.Pleroma.EmailTest do
|
||||||
|
use Pleroma.DataCase
|
||||||
|
|
||||||
|
import Swoosh.TestAssertions
|
||||||
|
|
||||||
|
alias Pleroma.Config
|
||||||
|
alias Pleroma.Tests.ObanHelpers
|
||||||
|
|
||||||
|
setup_all do
|
||||||
|
Mix.shell(Mix.Shell.Process)
|
||||||
|
|
||||||
|
on_exit(fn ->
|
||||||
|
Mix.shell(Mix.Shell.IO)
|
||||||
|
end)
|
||||||
|
|
||||||
|
:ok
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "pleroma.email test" do
|
||||||
|
test "Sends test email with no given address" do
|
||||||
|
mail_to = Config.get([:instance, :email])
|
||||||
|
|
||||||
|
:ok = Mix.Tasks.Pleroma.Email.run(["test"])
|
||||||
|
|
||||||
|
ObanHelpers.perform_all()
|
||||||
|
|
||||||
|
assert_receive {:mix_shell, :info, [message]}
|
||||||
|
assert message =~ "Test email has been sent"
|
||||||
|
|
||||||
|
assert_email_sent(
|
||||||
|
to: mail_to,
|
||||||
|
html_body: ~r/a test email was requested./i
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
test "Sends test email with given address" do
|
||||||
|
mail_to = "hewwo@example.com"
|
||||||
|
|
||||||
|
:ok = Mix.Tasks.Pleroma.Email.run(["test", "--to", mail_to])
|
||||||
|
|
||||||
|
ObanHelpers.perform_all()
|
||||||
|
|
||||||
|
assert_receive {:mix_shell, :info, [message]}
|
||||||
|
assert message =~ "Test email has been sent"
|
||||||
|
|
||||||
|
assert_email_sent(
|
||||||
|
to: mail_to,
|
||||||
|
html_body: ~r/a test email was requested./i
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,154 @@
|
|||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Web.Feed.TagControllerTest do
|
||||||
|
use Pleroma.Web.ConnCase
|
||||||
|
|
||||||
|
import Pleroma.Factory
|
||||||
|
import SweetXml
|
||||||
|
|
||||||
|
alias Pleroma.Web.Feed.FeedView
|
||||||
|
|
||||||
|
clear_config([:feed])
|
||||||
|
|
||||||
|
test "gets a feed (ATOM)", %{conn: conn} do
|
||||||
|
Pleroma.Config.put(
|
||||||
|
[:feed, :post_title],
|
||||||
|
%{max_length: 25, omission: "..."}
|
||||||
|
)
|
||||||
|
|
||||||
|
user = insert(:user)
|
||||||
|
{:ok, activity1} = Pleroma.Web.CommonAPI.post(user, %{"status" => "yeah #PleromaArt"})
|
||||||
|
|
||||||
|
object = Pleroma.Object.normalize(activity1)
|
||||||
|
|
||||||
|
object_data =
|
||||||
|
Map.put(object.data, "attachment", [
|
||||||
|
%{
|
||||||
|
"url" => [
|
||||||
|
%{
|
||||||
|
"href" =>
|
||||||
|
"https://peertube.moe/static/webseed/df5f464b-be8d-46fb-ad81-2d4c2d1630e3-480.mp4",
|
||||||
|
"mediaType" => "video/mp4",
|
||||||
|
"type" => "Link"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
object
|
||||||
|
|> Ecto.Changeset.change(data: object_data)
|
||||||
|
|> Pleroma.Repo.update()
|
||||||
|
|
||||||
|
{:ok, _activity2} =
|
||||||
|
Pleroma.Web.CommonAPI.post(user, %{"status" => "42 This is :moominmamma #PleromaArt"})
|
||||||
|
|
||||||
|
{:ok, _activity3} = Pleroma.Web.CommonAPI.post(user, %{"status" => "This is :moominmamma"})
|
||||||
|
|
||||||
|
response =
|
||||||
|
conn
|
||||||
|
|> put_req_header("content-type", "application/atom+xml")
|
||||||
|
|> get(tag_feed_path(conn, :feed, "pleromaart.atom"))
|
||||||
|
|> response(200)
|
||||||
|
|
||||||
|
xml = parse(response)
|
||||||
|
|
||||||
|
assert xpath(xml, ~x"//feed/title/text()") == '#pleromaart'
|
||||||
|
|
||||||
|
assert xpath(xml, ~x"//feed/entry/title/text()"l) == [
|
||||||
|
'42 This is :moominmamm...',
|
||||||
|
'yeah #PleromaArt'
|
||||||
|
]
|
||||||
|
|
||||||
|
assert xpath(xml, ~x"//feed/entry/author/name/text()"ls) == [user.nickname, user.nickname]
|
||||||
|
assert xpath(xml, ~x"//feed/entry/author/id/text()"ls) == [user.ap_id, user.ap_id]
|
||||||
|
end
|
||||||
|
|
||||||
|
test "gets a feed (RSS)", %{conn: conn} do
|
||||||
|
Pleroma.Config.put(
|
||||||
|
[:feed, :post_title],
|
||||||
|
%{max_length: 25, omission: "..."}
|
||||||
|
)
|
||||||
|
|
||||||
|
user = insert(:user)
|
||||||
|
{:ok, activity1} = Pleroma.Web.CommonAPI.post(user, %{"status" => "yeah #PleromaArt"})
|
||||||
|
|
||||||
|
object = Pleroma.Object.normalize(activity1)
|
||||||
|
|
||||||
|
object_data =
|
||||||
|
Map.put(object.data, "attachment", [
|
||||||
|
%{
|
||||||
|
"url" => [
|
||||||
|
%{
|
||||||
|
"href" =>
|
||||||
|
"https://peertube.moe/static/webseed/df5f464b-be8d-46fb-ad81-2d4c2d1630e3-480.mp4",
|
||||||
|
"mediaType" => "video/mp4",
|
||||||
|
"type" => "Link"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
object
|
||||||
|
|> Ecto.Changeset.change(data: object_data)
|
||||||
|
|> Pleroma.Repo.update()
|
||||||
|
|
||||||
|
{:ok, activity2} =
|
||||||
|
Pleroma.Web.CommonAPI.post(user, %{"status" => "42 This is :moominmamma #PleromaArt"})
|
||||||
|
|
||||||
|
{:ok, _activity3} = Pleroma.Web.CommonAPI.post(user, %{"status" => "This is :moominmamma"})
|
||||||
|
|
||||||
|
response =
|
||||||
|
conn
|
||||||
|
|> put_req_header("content-type", "application/rss+xml")
|
||||||
|
|> get(tag_feed_path(conn, :feed, "pleromaart.rss"))
|
||||||
|
|> response(200)
|
||||||
|
|
||||||
|
xml = parse(response)
|
||||||
|
assert xpath(xml, ~x"//channel/title/text()") == '#pleromaart'
|
||||||
|
|
||||||
|
assert xpath(xml, ~x"//channel/description/text()"s) ==
|
||||||
|
"These are public toots tagged with #pleromaart. You can interact with them if you have an account anywhere in the fediverse."
|
||||||
|
|
||||||
|
assert xpath(xml, ~x"//channel/link/text()") ==
|
||||||
|
'#{Pleroma.Web.base_url()}/tags/pleromaart.rss'
|
||||||
|
|
||||||
|
assert xpath(xml, ~x"//channel/webfeeds:logo/text()") ==
|
||||||
|
'#{Pleroma.Web.base_url()}/static/logo.png'
|
||||||
|
|
||||||
|
assert xpath(xml, ~x"//channel/item/title/text()"l) == [
|
||||||
|
'42 This is :moominmamm...',
|
||||||
|
'yeah #PleromaArt'
|
||||||
|
]
|
||||||
|
|
||||||
|
assert xpath(xml, ~x"//channel/item/pubDate/text()"sl) == [
|
||||||
|
FeedView.pub_date(activity1.data["published"]),
|
||||||
|
FeedView.pub_date(activity2.data["published"])
|
||||||
|
]
|
||||||
|
|
||||||
|
assert xpath(xml, ~x"//channel/item/enclosure/@url"sl) == [
|
||||||
|
"https://peertube.moe/static/webseed/df5f464b-be8d-46fb-ad81-2d4c2d1630e3-480.mp4"
|
||||||
|
]
|
||||||
|
|
||||||
|
obj1 = Pleroma.Object.normalize(activity1)
|
||||||
|
obj2 = Pleroma.Object.normalize(activity2)
|
||||||
|
|
||||||
|
assert xpath(xml, ~x"//channel/item/description/text()"sl) == [
|
||||||
|
HtmlEntities.decode(FeedView.activity_content(obj2)),
|
||||||
|
HtmlEntities.decode(FeedView.activity_content(obj1))
|
||||||
|
]
|
||||||
|
|
||||||
|
response =
|
||||||
|
conn
|
||||||
|
|> put_req_header("content-type", "application/atom+xml")
|
||||||
|
|> get(tag_feed_path(conn, :feed, "pleromaart"))
|
||||||
|
|> response(200)
|
||||||
|
|
||||||
|
xml = parse(response)
|
||||||
|
assert xpath(xml, ~x"//channel/title/text()") == '#pleromaart'
|
||||||
|
|
||||||
|
assert xpath(xml, ~x"//channel/description/text()"s) ==
|
||||||
|
"These are public toots tagged with #pleromaart. You can interact with them if you have an account anywhere in the fediverse."
|
||||||
|
end
|
||||||
|
end
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue