Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
f0cde24f
Commit
f0cde24f
authored
Feb 08, 2018
by
lain
Browse files
Merge branch 'fix/config-disable-chat' into 'develop'
Add config option for enabling/disabling chat. See merge request
!58
parents
2f291576
f0745148
Pipeline
#665
passed with stage
in 2 minutes and 39 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
config/config.exs
View file @
f0cde24f
...
...
@@ -56,6 +56,9 @@
redirect_on_failure:
true
#base_url: "https://cache.pleroma.social"
config
:pleroma
,
:chat
,
enabled:
true
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config
"
#{
Mix
.
env
}
.exs"
lib/pleroma/application.ex
View file @
f0cde24f
...
...
@@ -20,14 +20,18 @@ def start(_type, _args) do
limit:
2500
]]),
worker
(
Pleroma
.
Web
.
Federator
,
[]),
worker
(
Pleroma
.
Web
.
ChatChannel
.
ChatChannelState
,
[]),
worker
(
Pleroma
.
Stats
,
[]),
]
++
if
Mix
.
env
==
:test
,
do
:
[],
else
:
[
worker
(
Pleroma
.
Web
.
Streamer
,
[])]
++
if
!chat_enabled
(),
do
:
[],
else
:
[
worker
(
Pleroma
.
Web
.
ChatChannel
.
ChatChannelState
,
[])]
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
# for other strategies and supported options
opts
=
[
strategy:
:one_for_one
,
name:
Pleroma
.
Supervisor
]
Supervisor
.
start_link
(
children
,
opts
)
end
defp
chat_enabled
do
Application
.
get_env
(
:pleroma
,
:chat
,
[])
|>
Keyword
.
get
(
:enabled
)
end
end
lib/pleroma/web/channels/user_socket.ex
View file @
f0cde24f
...
...
@@ -5,7 +5,9 @@ defmodule Pleroma.Web.UserSocket do
## Channels
# channel "room:*", Pleroma.Web.RoomChannel
channel
"chat:*"
,
Pleroma
.
Web
.
ChatChannel
if
Application
.
get_env
(
:pleroma
,
:chat
)
|>
Keyword
.
get
(
:enabled
)
do
channel
"chat:*"
,
Pleroma
.
Web
.
ChatChannel
end
## Transports
transport
:websocket
,
Phoenix
.
Transports
.
WebSocket
...
...
lib/pleroma/web/endpoint.ex
View file @
f0cde24f
defmodule
Pleroma
.
Web
.
Endpoint
do
use
Phoenix
.
Endpoint
,
otp_app:
:pleroma
socket
"/socket"
,
Pleroma
.
Web
.
UserSocket
if
Application
.
get_env
(
:pleroma
,
:chat
)
|>
Keyword
.
get
(
:enabled
)
do
socket
"/socket"
,
Pleroma
.
Web
.
UserSocket
end
socket
"/api/v1"
,
Pleroma
.
Web
.
MastodonAPI
.
MastodonSocket
# Serve at "/" the static files from "priv/static" directory.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment