Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gab-social
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
gab
social
gab-social
Commits
41f48ea8
Commit
41f48ea8
authored
Sep 14, 2020
by
mgabdev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added checks for status visiblity if group is private
• Added: - checks for status visiblity if group is private
parent
e1fb44af
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
0 deletions
+6
-0
app/controllers/api/v1/statuses_controller.rb
app/controllers/api/v1/statuses_controller.rb
+2
-0
app/javascript/gabsocial/actions/compose.js
app/javascript/gabsocial/actions/compose.js
+2
-0
app/services/post_status_service.rb
app/services/post_status_service.rb
+2
-0
No files found.
app/controllers/api/v1/statuses_controller.rb
View file @
41f48ea8
...
...
@@ -57,6 +57,7 @@ class Api::V1::StatusesController < Api::BaseController
text:
status_params
[
:status
],
markdown:
markdown
,
autoJoinGroup:
status_params
[
:autoJoinGroup
],
isPrivateGroup:
status_params
[
:isPrivateGroup
],
thread:
status_params
[
:in_reply_to_id
].
blank?
?
nil
:
Status
.
find
(
status_params
[
:in_reply_to_id
]),
media_ids:
status_params
[
:media_ids
],
sensitive:
status_params
[
:sensitive
],
...
...
@@ -113,6 +114,7 @@ class Api::V1::StatusesController < Api::BaseController
:status
,
:markdown
,
:autoJoinGroup
,
:isPrivateGroup
,
:in_reply_to_id
,
:quote_of_id
,
:sensitive
,
...
...
app/javascript/gabsocial/actions/compose.js
View file @
41f48ea8
...
...
@@ -277,6 +277,7 @@ export function submitCompose(groupId, replyToId = null, router, isStandalone, a
let
status
=
getState
().
getIn
([
'
compose
'
,
'
text
'
],
''
);
let
markdown
=
getState
().
getIn
([
'
compose
'
,
'
markdown
'
],
''
);
const
media
=
getState
().
getIn
([
'
compose
'
,
'
media_attachments
'
]);
const
isPrivateGroup
=
!!
groupId
?
getState
().
getIn
([
'
groups
'
,
groupId
,
'
is_private
'
],
false
)
:
false
const
replacer
=
(
match
)
=>
{
const
hasProtocol
=
match
.
startsWith
(
'
https://
'
)
||
match
.
startsWith
(
'
http://
'
)
...
...
@@ -334,6 +335,7 @@ export function submitCompose(groupId, replyToId = null, router, isStandalone, a
expires_at
,
scheduled_at
,
autoJoinGroup
,
isPrivateGroup
,
in_reply_to_id
:
inReplyToId
,
quote_of_id
:
getState
().
getIn
([
'
compose
'
,
'
quote_of_id
'
],
null
),
media_ids
:
media
.
map
(
item
=>
item
.
get
(
'
id
'
)),
...
...
app/services/post_status_service.rb
View file @
41f48ea8
...
...
@@ -30,6 +30,7 @@ class PostStatusService < BaseService
@markdown
=
@options
[
:markdown
]
if
@account
.
is_pro
@in_reply_to
=
@options
[
:thread
]
@autoJoinGroup
=
@options
[
:autoJoinGroup
]
||
false
@isPrivateGroup
=
@options
[
:isPrivateGroup
]
||
false
return
idempotency_duplicate
if
idempotency_given?
&&
idempotency_duplicate?
...
...
@@ -56,6 +57,7 @@ class PostStatusService < BaseService
@text
=
@options
.
delete
(
:spoiler_text
)
if
@text
.
blank?
&&
@options
[
:spoiler_text
].
present?
@visibility
=
@options
[
:visibility
]
||
@account
.
user
&
.
setting_default_privacy
@visibility
=
:unlisted
if
@visibility
==
:public
&&
@account
.
silenced?
@visibility
=
:private_group
if
@isPrivateGroup
@expires_at
=
@options
[
:expires_at
]
&
.
to_datetime
if
@account
.
is_pro
@scheduled_at
=
@options
[
:scheduled_at
]
&
.
to_datetime
@scheduled_at
=
nil
if
scheduled_in_the_past?
...
...
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