Rename the non-federating Chat feature to Shout
This commit is contained in:
parent
ee52fc840d
commit
ff00b354fa
11 changed files with 36 additions and 35 deletions
|
|
@ -93,8 +93,8 @@ defmodule Pleroma.Config.TransferTaskTest do
|
|||
end
|
||||
|
||||
test "on reboot time key" do
|
||||
clear_config(:chat)
|
||||
insert(:config, key: :chat, value: [enabled: false])
|
||||
clear_config(:shout)
|
||||
insert(:config, key: :shout, value: [enabled: false])
|
||||
assert capture_log(fn -> TransferTask.start_link([]) end) =~ "pleroma restarted"
|
||||
end
|
||||
|
||||
|
|
@ -105,10 +105,10 @@ defmodule Pleroma.Config.TransferTaskTest do
|
|||
end
|
||||
|
||||
test "don't restart pleroma on reboot time key and subkey if there is false flag" do
|
||||
clear_config(:chat)
|
||||
clear_config(:shout)
|
||||
clear_config(Pleroma.Captcha)
|
||||
|
||||
insert(:config, key: :chat, value: [enabled: false])
|
||||
insert(:config, key: :shout, value: [enabled: false])
|
||||
insert(:config, key: Pleroma.Captcha, value: [seconds_valid: 60])
|
||||
|
||||
refute String.contains?(
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ defmodule Pleroma.Web.AdminAPI.ConfigControllerTest do
|
|||
end
|
||||
|
||||
test "saving config which need pleroma reboot", %{conn: conn} do
|
||||
clear_config([:chat, :enabled], true)
|
||||
clear_config([:shout, :enabled], true)
|
||||
|
||||
assert conn
|
||||
|> put_req_header("content-type", "application/json")
|
||||
|
|
@ -417,7 +417,7 @@ defmodule Pleroma.Web.AdminAPI.ConfigControllerTest do
|
|||
"/api/pleroma/admin/config",
|
||||
%{
|
||||
configs: [
|
||||
%{group: ":pleroma", key: ":chat", value: [%{"tuple" => [":enabled", true]}]}
|
||||
%{group: ":pleroma", key: ":shout", value: [%{"tuple" => [":enabled", true]}]}
|
||||
]
|
||||
}
|
||||
)
|
||||
|
|
@ -426,7 +426,7 @@ defmodule Pleroma.Web.AdminAPI.ConfigControllerTest do
|
|||
%{
|
||||
"db" => [":enabled"],
|
||||
"group" => ":pleroma",
|
||||
"key" => ":chat",
|
||||
"key" => ":shout",
|
||||
"value" => [%{"tuple" => [":enabled", true]}]
|
||||
}
|
||||
],
|
||||
|
|
@ -454,7 +454,7 @@ defmodule Pleroma.Web.AdminAPI.ConfigControllerTest do
|
|||
end
|
||||
|
||||
test "update setting which need reboot, don't change reboot flag until reboot", %{conn: conn} do
|
||||
clear_config([:chat, :enabled], true)
|
||||
clear_config([:shout, :enabled], true)
|
||||
|
||||
assert conn
|
||||
|> put_req_header("content-type", "application/json")
|
||||
|
|
@ -462,7 +462,7 @@ defmodule Pleroma.Web.AdminAPI.ConfigControllerTest do
|
|||
"/api/pleroma/admin/config",
|
||||
%{
|
||||
configs: [
|
||||
%{group: ":pleroma", key: ":chat", value: [%{"tuple" => [":enabled", true]}]}
|
||||
%{group: ":pleroma", key: ":shout", value: [%{"tuple" => [":enabled", true]}]}
|
||||
]
|
||||
}
|
||||
)
|
||||
|
|
@ -471,7 +471,7 @@ defmodule Pleroma.Web.AdminAPI.ConfigControllerTest do
|
|||
%{
|
||||
"db" => [":enabled"],
|
||||
"group" => ":pleroma",
|
||||
"key" => ":chat",
|
||||
"key" => ":shout",
|
||||
"value" => [%{"tuple" => [":enabled", true]}]
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ defmodule Pleroma.Web.MastodonAPI.InstanceControllerTest do
|
|||
"background_upload_limit" => _,
|
||||
"banner_upload_limit" => _,
|
||||
"background_image" => from_config_background,
|
||||
"chat_limit" => _,
|
||||
"shout_limit" => _,
|
||||
"description_limit" => _
|
||||
} = result
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Web.ChatChannelTest do
|
||||
defmodule Pleroma.Web.ShoutChannelTest do
|
||||
use Pleroma.Web.ChannelCase
|
||||
alias Pleroma.Web.ChatChannel
|
||||
alias Pleroma.Web.ShoutChannel
|
||||
alias Pleroma.Web.UserSocket
|
||||
|
||||
import Pleroma.Factory
|
||||
|
|
@ -14,7 +14,7 @@ defmodule Pleroma.Web.ChatChannelTest do
|
|||
|
||||
{:ok, _, socket} =
|
||||
socket(UserSocket, "", %{user_name: user.nickname})
|
||||
|> subscribe_and_join(ChatChannel, "chat:public")
|
||||
|> subscribe_and_join(ShoutChannel, "shout:public")
|
||||
|
||||
{:ok, socket: socket}
|
||||
end
|
||||
|
|
@ -25,7 +25,7 @@ defmodule Pleroma.Web.ChatChannelTest do
|
|||
end
|
||||
|
||||
describe "message lengths" do
|
||||
setup do: clear_config([:instance, :chat_limit])
|
||||
setup do: clear_config([:instance, :shout_limit])
|
||||
|
||||
test "it ignores messages of length zero", %{socket: socket} do
|
||||
push(socket, "new_msg", %{"text" => ""})
|
||||
|
|
@ -33,7 +33,7 @@ defmodule Pleroma.Web.ChatChannelTest do
|
|||
end
|
||||
|
||||
test "it ignores messages above a certain length", %{socket: socket} do
|
||||
clear_config([:instance, :chat_limit], 2)
|
||||
Pleroma.Config.put([:instance, :shout_limit], 2)
|
||||
push(socket, "new_msg", %{"text" => "123"})
|
||||
refute_broadcast("new_msg", %{text: "123"})
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue