Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add local only posts #8

Merged
merged 105 commits into from
May 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
ffaa814
Use backend from glitch-soc for instance-only toots
renatolond Aug 23, 2018
4969ea4
Base frontend on privacy dropdown
renatolond Aug 23, 2018
f37ca30
Add backend support for local_only on status create
renatolond Aug 25, 2018
c963e15
Add local_only indicator in the status action bar
renatolond Aug 24, 2018
b4ae56e
Add local_only indicator to detailed status
renatolond Aug 24, 2018
e1049a9
Normalize translations
renatolond Aug 26, 2018
6bef1a8
Add local_only to admin screens
renatolond Aug 26, 2018
469294d
Hide local statuses from user atom and from unlogged users
renatolond Sep 3, 2018
5497b5a
Add local only icon to status page
renatolond Sep 4, 2018
9d6e005
Fix issue with toggle in mobile
renatolond Oct 1, 2018
d42a06f
Add default federation option to settings
renatolond Oct 1, 2018
fde9668
Merge tag 'v2.6.0rc1' into instance_only_statuses
renatolond Oct 23, 2018
3306fad
Fix wrong configuration fetched
renatolond Oct 23, 2018
b9f0f79
Change setting wording
renatolond Oct 23, 2018
449e6e4
Check for empty "last_status" before sorting DM column (#9207)
sammy8806 Nov 5, 2018
430499f
Update resolve_url_service.rb (#9188)
mbajur Nov 5, 2018
5ee4fd4
Increase default column width from 330px to 350px (#9227)
Gargron Nov 8, 2018
330401b
Optimize the process of following someone (#9220)
Gargron Nov 8, 2018
b3c29ec
Fix follow limit validator reporting lower number past threshold (#9230)
Gargron Nov 8, 2018
4b2f254
Fix form validation flash message color and input borders (#9235)
Gargron Nov 8, 2018
21fd335
Display amount of freed disk space in tootctl media remove (#9229)
Gargron Nov 8, 2018
0f436de
Add "Show thread" link to self-replies (#9228)
Gargron Nov 8, 2018
63f168c
Fix nil error regression from #9229 in tootctl media remove (#9239)
Gargron Nov 8, 2018
f73b7e7
Improve ActiveRecord connection in on_worker_boot (#9238)
Gargron Nov 9, 2018
d06a724
Check that twitter:player is valid before using it (#9254)
ClearlyClaire Nov 10, 2018
886ef1c
Fix emoji update date processing (#9255)
ClearlyClaire Nov 10, 2018
4ce6ed2
Perform deep comparison for card data when receiving new props (#9270)
ClearlyClaire Nov 12, 2018
cd8575a
Fix null error introduced in #9270 (#9275)
Gargron Nov 12, 2018
a3ef076
Fix race condition causing shallow status with only a "favourited" at…
ClearlyClaire Nov 13, 2018
01a8ab9
Fix "tootctl media remove" can't count the file size (#9288)
mayaeh Nov 16, 2018
6d4438a
Remove intermediary arrays when creating hash maps from results (#9291)
Gargron Nov 16, 2018
ecc58c0
Prevent multiple handlers for Delete of Actor from running (#9292)
Gargron Nov 16, 2018
fa02f87
Fix filter ID not being a string in REST API (#9303)
Gargron Nov 19, 2018
c0736c4
Update Nginx config for Nanobox apps (#9310)
danhunsaker Nov 20, 2018
2c36d35
WebSub: ATOM before RSS (#9302)
Alkarex Nov 20, 2018
15dcb41
Touch account on successful response, change char shown when culled (…
renatolond Nov 20, 2018
12bdd7d
Ignore JSON-LD profile in mime type comparison (#9179)
valerauko Nov 22, 2018
a2cda74
Fix connect timeout not being enforced (#9329)
Gargron Nov 22, 2018
404dc97
Bump version to 2.6.2
Gargron Nov 23, 2018
ec20a5d
add loglevel to ffmpeg in gif upload (#9368)
Nov 27, 2018
49f49cf
Allow hyphens in the middle of remote user names (#9345)
ClearlyClaire Nov 27, 2018
cc0c167
Fix nil error when no DNS addresses are found for host (#9379)
Gargron Nov 27, 2018
58108b4
Don't count suspended users in user count (#9380)
Gargron Nov 27, 2018
442f335
Skip deliveries to inboxes that have already been marked as unavailab…
Gargron Nov 27, 2018
34de90c
Fix TLS handshake timeout not being enforced (#9381)
Gargron Nov 27, 2018
a1216e6
Bump version to 2.6.3
Gargron Nov 30, 2018
8257001
Remove npm-run-all dependency (#9401)
Gargron Nov 30, 2018
13979a8
Bump version to 2.6.4
Gargron Nov 30, 2018
f13d083
Preload common JSON-LD contexts (#9412)
ClearlyClaire Dec 2, 2018
e625425
Include replies to list owner and replies to list members in list sta…
ClearlyClaire Nov 21, 2018
887f9de
Bump version to 2.6.5
Gargron Dec 2, 2018
f5f9fc3
Merge tag 'v2.6.5' into instance_only_statuses
renatolond Dec 7, 2018
237952c
Only stream local-only toots to logged-in users
ClearlyClaire Nov 13, 2018
4207973
Merge tag 'v2.7.0rc1' into instance_only_statuses
renatolond Jan 9, 2019
e8161a1
Normalize translations
renatolond Jan 9, 2019
20ad816
Merge tag 'v2.7.0' into instance_only_statuses
renatolond Jan 22, 2019
e8012c1
Merge tag 'v2.7.1' into instance_only_statuses
renatolond Jan 31, 2019
88a1d0c
Bumps copyright year in README.md to 2019 (#9939)
sts10 Jan 28, 2019
e31970b
Fix link color in high-contrast theme, add underlines (#9949)
Gargron Jan 31, 2019
687a0cb
Replace unlock-alt icon with unlock (#9952)
Jan 31, 2019
fdf819b
Allow most kinds of characters in URL query (fixes #8408) (#8447)
JMendyk Feb 2, 2019
a742a09
Fix authorized applications list page design (#9969)
rinsuki Feb 4, 2019
5e7c75c
Fix not showing custom emojis in share page emoji picker (#9970)
rinsuki Feb 4, 2019
cd36ff4
[UI] Fix whitespace being applied to div instead of p (#9968)
trwnh Feb 5, 2019
edde07f
Hide misleading “You will be sent a confirmation e-mail” hint from ad…
ClearlyClaire Feb 5, 2019
e2afe5f
Fix Tombstone.delete_all ArgumentError (#9978)
abcang Feb 6, 2019
2a7c091
Only URLs extract with pre-escaped text (#9991)
hinaloe Feb 9, 2019
6ea4cd5
Fix URL linkifier grabbing full-width spaces and quotations (#9997)
Gargron Feb 9, 2019
d9f0c7f
Fix IntersectionObserverArticle not hiding some out-of-view items (#9…
ClearlyClaire Feb 6, 2019
e1dbdf7
Fix timeline jumps (#10001)
ClearlyClaire Feb 11, 2019
41ecf80
Don't focus spiler input when disabled spoiler (#10017)
hinaloe Feb 12, 2019
d662675
Move sending account Delete to anyone but the account's followers to …
ClearlyClaire Feb 12, 2019
27310a8
Add support for IPv6 only MXes in Email validation (#10009)
zoc Feb 12, 2019
1186b9a
Save IP address used for sign-up, not only sign-in (#10026)
ClearlyClaire Feb 12, 2019
f0f657e
Fix color of static page links in high contrast theme (#10028)
Gargron Feb 13, 2019
a46487e
Fix hashtags select styling in default and high contrast themes (#10029)
Gargron Feb 13, 2019
2a1adab
Fix style regressions on landing page (#10030)
Gargron Feb 13, 2019
5a04861
Add tight rate-limit for API deletions (#10042)
Gargron Feb 14, 2019
17a41e1
Fix hashtag column not subscribing to stream on mount (#10040)
Gargron Feb 14, 2019
737ac4b
Create Redisable#redis (#9633)
ysksn Feb 2, 2019
6c11f0f
Alternative handling of private self-boosts (#9998)
ClearlyClaire Feb 13, 2019
ef45411
Filter incoming Create activities by relation to local activity (#10005)
Gargron Feb 13, 2019
e84c761
Filter incoming Announce activities by relation to local activity (#1…
Gargron Feb 15, 2019
71b8316
Add logging for rejected ActivityPub payloads and add tests (#10062)
Gargron Feb 17, 2019
b163368
Fix Announce activities of unknown statuses not fetching those status…
Gargron Feb 17, 2019
8ad75ee
Fix relay enabling/disabling not resetting inbox availability status …
Gargron Feb 15, 2019
637f000
Change robots.txt to exclude some URLs (#10037)
Gargron Feb 13, 2019
45b2bb4
Change robots.txt to exclude only media proxy URLs (#10038)
nightpool Feb 14, 2019
1ad0d23
Improve image description user experience (#10036)
BenLubar Feb 14, 2019
77a7123
perf: run node directly when streaming (#10032)
nolanlawson Feb 13, 2019
5aa147b
Fix breaks when opening a reply tree in WebUI (#10046)
rinsuki Feb 14, 2019
7b59de4
Change conversations to always show names of other participants (#10047)
Gargron Feb 15, 2019
584f29e
Change buttons on timeline preview to open the interaction dialog (#1…
Gargron Feb 15, 2019
caf1450
Change error graphic to hover-to-play (#10055)
Gargron Feb 15, 2019
b6a5268
Add registrations attribute to instance entity in REST API (#10060)
Gargron Feb 16, 2019
98e3820
Add vapid_key to the application entity in the REST API (#10058)
Gargron Feb 16, 2019
33e8fa0
Fix mutes, blocks, domain blocks and follow requests not paginating (…
Gargron Feb 16, 2019
e5f4af2
Fix crash on public hashtag pages when streaming fails (#10061)
ClearlyClaire Feb 16, 2019
f3eb99a
Bump version to 2.7.2
Gargron Feb 17, 2019
153385e
Merge tag 'v2.7.2' into instance_only_statuses
renatolond Feb 19, 2019
546581d
Merge tag 'v2.8.0' into instance_only_statuses
renatolond Apr 13, 2019
a285462
Do not leak local-only toots to remote mentioned users
ClearlyClaire Apr 22, 2019
07a2f95
Merge branch 'instance_only_statuses' into addLocalOnlyPosts
May 6, 2019
924b113
Update .gitignore
May 6, 2019
1efd04e
Update Beach City version to 1.4
May 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ yarn-debug.log
# Ignore Docker option files
docker-compose.override.yml

dump.rdb
logfile
10 changes: 7 additions & 3 deletions app/controllers/accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ def show
format.atom do
mark_cacheable!

@entries = @account.stream_entries.where(hidden: false).with_includes.paginate_by_max_id(PAGE_SIZE, params[:max_id], params[:since_id])
@entries = @account.stream_entries.where(hidden: false).with_includes.without_local_only.paginate_by_max_id(PAGE_SIZE, params[:max_id], params[:since_id])
render xml: OStatus::AtomSerializer.render(OStatus::AtomSerializer.new.feed(@account, @entries.reject { |entry| entry.status.nil? }))
end

format.rss do
mark_cacheable!

@statuses = cache_collection(default_statuses.without_reblogs.without_replies.limit(PAGE_SIZE), Status)
@statuses = cache_collection(default_statuses.without_local_only.without_reblogs.without_replies.limit(PAGE_SIZE), Status)
render xml: RSS::AccountSerializer.render(@account, @statuses)
end

Expand Down Expand Up @@ -70,7 +70,11 @@ def filtered_statuses
end

def default_statuses
@account.statuses.where(visibility: [:public, :unlisted])
if current_user.nil?
@account.statuses.without_local_only.where(visibility: [:public, :unlisted])
else
@account.statuses.where(visibility: [:public, :unlisted])
end
end

def only_media_scope
Expand Down
1 change: 1 addition & 0 deletions app/controllers/api/v1/accounts/credentials_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def user_settings_params
'setting_default_privacy' => source_params.fetch(:privacy, @account.user.setting_default_privacy),
'setting_default_sensitive' => source_params.fetch(:sensitive, @account.user.setting_default_sensitive),
'setting_default_language' => source_params.fetch(:language, @account.user.setting_default_language),
'setting_default_federation' => source_params.fetch(:federation, @account.user.setting_default_federation),
}
end
end
4 changes: 3 additions & 1 deletion app/controllers/api/v1/statuses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def create
scheduled_at: status_params[:scheduled_at],
application: doorkeeper_token.application,
poll: status_params[:poll],
idempotency: request.headers['Idempotency-Key'])
idempotency: request.headers['Idempotency-Key'],
local_only: status_params[:local_only])

render json: @status, serializer: @status.is_a?(ScheduledStatus) ? REST::ScheduledStatusSerializer : REST::StatusSerializer
end
Expand Down Expand Up @@ -85,6 +86,7 @@ def status_params
:spoiler_text,
:visibility,
:scheduled_at,
:local_only,
media_ids: [],
poll: [
:multiple,
Expand Down
1 change: 1 addition & 0 deletions app/controllers/settings/preferences_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def user_settings_params
:setting_default_privacy,
:setting_default_sensitive,
:setting_default_language,
:setting_default_federation,
:setting_unfollow_modal,
:setting_boost_modal,
:setting_delete_modal,
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/stream_entries_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def show
end

format.atom do
unless @stream_entry.hidden?
unless @stream_entry.hidden? || @stream_entry.local_only?
skip_session!
expires_in 3.minutes, public: true
end
Expand Down Expand Up @@ -53,7 +53,7 @@ def set_stream_entry
@type = @stream_entry.activity_type.downcase

raise ActiveRecord::RecordNotFound if @stream_entry.activity.nil?
authorize @stream_entry.activity, :show? if @stream_entry.hidden?
authorize @stream_entry.activity, :show? if @stream_entry.hidden? || @stream_entry.local_only?
rescue Mastodon::NotPermittedError
# Reraise in order to get a 404
raise ActiveRecord::RecordNotFound
Expand Down
9 changes: 9 additions & 0 deletions app/javascript/mastodon/actions/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const COMPOSE_SENSITIVITY_CHANGE = 'COMPOSE_SENSITIVITY_CHANGE';
export const COMPOSE_SPOILERNESS_CHANGE = 'COMPOSE_SPOILERNESS_CHANGE';
export const COMPOSE_SPOILER_TEXT_CHANGE = 'COMPOSE_SPOILER_TEXT_CHANGE';
export const COMPOSE_VISIBILITY_CHANGE = 'COMPOSE_VISIBILITY_CHANGE';
export const COMPOSE_FEDERATION_CHANGE = 'COMPOSE_FEDERATION_CHANGE';
export const COMPOSE_LISTABILITY_CHANGE = 'COMPOSE_LISTABILITY_CHANGE';
export const COMPOSE_COMPOSING_CHANGE = 'COMPOSE_COMPOSING_CHANGE';

Expand Down Expand Up @@ -140,6 +141,7 @@ export function submitCompose(routerHistory) {
spoiler_text: getState().getIn(['compose', 'spoiler_text'], ''),
visibility: getState().getIn(['compose', 'privacy']),
poll: getState().getIn(['compose', 'poll'], null),
local_only: !getState().getIn(['compose', 'federation']),
}, {
headers: {
'Idempotency-Key': getState().getIn(['compose', 'idempotencyKey']),
Expand Down Expand Up @@ -489,6 +491,13 @@ export function changeComposeVisibility(value) {
};
};

export function changeComposeFederation(value) {
return {
type: COMPOSE_FEDERATION_CHANGE,
value,
};
};

export function insertEmojiCompose(position, emoji, needsSpace) {
return {
type: COMPOSE_EMOJI_INSERT,
Expand Down
5 changes: 5 additions & 0 deletions app/javascript/mastodon/components/status_action_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const messages = defineMessages({
reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost to original audience' },
cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' },
cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },
local_only: { id: 'status.local_only', defaultMessage: 'This post is only visible by other users of your instance' },
favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },
open: { id: 'status.open', defaultMessage: 'Expand this status' },
report: { id: 'status.report', defaultMessage: 'Report @{name}' },
Expand Down Expand Up @@ -183,6 +184,7 @@ class StatusActionBar extends ImmutablePureComponent {
const mutingConversation = status.get('muted');
const anonymousAccess = !me;
const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
const federated = !status.get('local_only');

let menu = [];
let reblogIcon = 'retweet';
Expand Down Expand Up @@ -257,6 +259,9 @@ class StatusActionBar extends ImmutablePureComponent {
<div className='status__action-bar-dropdown'>
<DropdownMenuContainer disabled={anonymousAccess} status={status} items={menu} icon='ellipsis-h' size={18} direction='right' title={intl.formatMessage(messages.more)} />
</div>
{ !federated &&
<IconButton className='status__action-bar-button' disabled title={intl.formatMessage(messages.local_only)} icon='chain-broken' />
}
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import UploadButtonContainer from '../containers/upload_button_container';
import { defineMessages, injectIntl } from 'react-intl';
import SpoilerButtonContainer from '../containers/spoiler_button_container';
import PrivacyDropdownContainer from '../containers/privacy_dropdown_container';
import FederationDropdownContainer from '../containers/federation_dropdown_container';
import SensitiveButtonContainer from '../containers/sensitive_button_container';
import EmojiPickerDropdown from '../containers/emoji_picker_dropdown_container';
import PollFormContainer from '../containers/poll_form_container';
import UploadFormContainer from '../containers/upload_form_container';
Expand Down Expand Up @@ -43,6 +45,7 @@ class ComposeForm extends ImmutablePureComponent {
spoiler: PropTypes.bool,
privacy: PropTypes.string,
spoilerText: PropTypes.string,
federation: PropTypes.bool,
focusDate: PropTypes.instanceOf(Date),
caretPosition: PropTypes.number,
preselectDate: PropTypes.instanceOf(Date),
Expand Down Expand Up @@ -214,6 +217,7 @@ class ComposeForm extends ImmutablePureComponent {
<PollButtonContainer />
<PrivacyDropdownContainer />
<SpoilerButtonContainer />
<FederationDropdownContainer />
</div>
<div className='character-counter__wrapper'><CharacterCounter max={500} text={text} /></div>
</div>
Expand Down
Loading