Skip to content

Commit

Permalink
Merge pull request #70 from MozillaSocial/upstream-v4.2.8
Browse files Browse the repository at this point in the history
merge `upstream-v4.2.8` branch into main
  • Loading branch information
toufali authored May 15, 2024
2 parents 35630ba + 571665b commit e664d83
Show file tree
Hide file tree
Showing 20 changed files with 175 additions and 210 deletions.
11 changes: 5 additions & 6 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class ApplicationController < ActionController::Base
helper_method :limited_federation_mode?
helper_method :body_class_string
helper_method :skip_csrf_meta_tags?
helper_method :sso_redirect

rescue_from ActionController::ParameterMissing, Paperclip::AdapterRegistry::NoHandlerError, with: :bad_request
rescue_from Mastodon::NotPermittedError, with: :forbidden
Expand Down Expand Up @@ -88,7 +87,11 @@ def skip_csrf_meta_tags?
end

def after_sign_out_path_for(_resource_or_scope)
root_path
if ENV['OMNIAUTH_ONLY'] == 'true' && ENV['OIDC_ENABLED'] == 'true'
'/auth/auth/openid_connect/logout'
else
new_user_session_path
end
end

protected
Expand Down Expand Up @@ -145,10 +148,6 @@ def omniauth_only?
ENV['OMNIAUTH_ONLY'] == 'true'
end

def sso_redirect
"/auth/auth/#{Devise.omniauth_providers[0]}" if ENV['OMNIAUTH_ONLY'] == 'true' && Devise.omniauth_providers.length == 1
end

def sso_account_settings
ENV.fetch('SSO_ACCOUNT_SETTINGS', nil)
end
Expand Down
3 changes: 0 additions & 3 deletions app/controllers/auth/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ class Auth::SessionsController < Devise::SessionsController
skip_before_action :require_functional!
skip_before_action :update_user_sign_in

# Allow any client to call /auth/sign_out via a delete call
skip_before_action :verify_authenticity_token, only: [:destroy]

prepend_before_action :check_suspicious!, only: [:create]

include TwoFactorAuthenticationConcern
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/mastodon/components/column_back_button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createPortal } from 'react-dom';

import { FormattedMessage } from 'react-intl';

import { Icon } from 'mastodon/components/icon';
import { Icon } from 'mastodon/components/icon';

export default class ColumnBackButton extends PureComponent {

Expand All @@ -30,7 +30,7 @@ export default class ColumnBackButton extends PureComponent {
}
};

render() {
render () {
const { multiColumn } = this.props;

const component = (
Expand Down
57 changes: 28 additions & 29 deletions app/javascript/mastodon/containers/status_container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const makeMapStateToProps = () => {

const mapDispatchToProps = (dispatch, { intl, contextType }) => ({

onReply(status, router) {
onReply (status, router) {
dispatch((_, getState) => {
let state = getState();

Expand All @@ -87,56 +87,55 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
modalProps: {
message: intl.formatMessage(messages.replyMessage),
confirm: intl.formatMessage(messages.replyConfirm),
onConfirm: () => dispatch(replyCompose(status, router))
},
onConfirm: () => dispatch(replyCompose(status, router)) },
}));
} else {
dispatch(replyCompose(status, router));
}
});
},

onModalReblog(status, privacy) {
onModalReblog (status, privacy) {
if (status.get('reblogged')) {
dispatch(unreblog(status));
} else {
dispatch(reblog(status, privacy));
}
},

onReblog(status, e) {
onReblog (status, e) {
if ((e && e.shiftKey) || !boostModal) {
this.onModalReblog(status);
} else {
dispatch(initBoostModal({ status, onReblog: this.onModalReblog }));
}
},

onFavourite(status) {
onFavourite (status) {
if (status.get('favourited')) {
dispatch(unfavourite(status));
} else {
dispatch(favourite(status));
}
},

onBookmark(status) {
onBookmark (status) {
if (status.get('bookmarked')) {
dispatch(unbookmark(status));
} else {
dispatch(bookmark(status));
}
},

onPin(status) {
onPin (status) {
if (status.get('pinned')) {
dispatch(unpin(status));
} else {
dispatch(pin(status));
}
},

onEmbed(status) {
onEmbed (status) {
dispatch(openModal({
modalType: 'EMBED',
modalProps: {
Expand All @@ -146,7 +145,7 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
}));
},

onDelete(status, history, withRedraft = false) {
onDelete (status, history, withRedraft = false) {
if (!deleteModal) {
dispatch(deleteStatus(status.get('id'), history, withRedraft));
} else {
Expand All @@ -161,7 +160,7 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
}
},

onEdit(status, history) {
onEdit (status, history) {
dispatch((_, getState) => {
let state = getState();
if (state.getIn(['compose', 'text']).trim().length !== 0) {
Expand All @@ -179,82 +178,82 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
});
},

onTranslate(status) {
onTranslate (status) {
if (status.get('translation')) {
dispatch(undoStatusTranslation(status.get('id'), status.get('poll')));
} else {
dispatch(translateStatus(status.get('id')));
}
},

onDirect(account, router) {
onDirect (account, router) {
dispatch(directCompose(account, router));
},

onMention(account, router) {
onMention (account, router) {
dispatch(mentionCompose(account, router));
},

onOpenMedia(statusId, media, index, lang) {
onOpenMedia (statusId, media, index, lang) {
dispatch(openModal({
modalType: 'MEDIA',
modalProps: { statusId, media, index, lang },
}));
},

onOpenVideo(statusId, media, lang, options) {
onOpenVideo (statusId, media, lang, options) {
dispatch(openModal({
modalType: 'VIDEO',
modalProps: { statusId, media, lang, options },
}));
},

onBlock(status) {
onBlock (status) {
const account = status.get('account');
dispatch(initBlockModal(account));
},

onUnblock(account) {
onUnblock (account) {
dispatch(unblockAccount(account.get('id')));
},

onReport(status) {
onReport (status) {
dispatch(initReport(status.get('account'), status));
},

onAddFilter(status) {
onAddFilter (status) {
dispatch(initAddFilter(status, { contextType }));
},

onMute(account) {
onMute (account) {
dispatch(initMuteModal(account));
},

onUnmute(account) {
onUnmute (account) {
dispatch(unmuteAccount(account.get('id')));
},

onMuteConversation(status) {
onMuteConversation (status) {
if (status.get('muted')) {
dispatch(unmuteStatus(status.get('id')));
} else {
dispatch(muteStatus(status.get('id')));
}
},

onToggleHidden(status) {
onToggleHidden (status) {
if (status.get('hidden')) {
dispatch(revealStatus(status.get('id')));
} else {
dispatch(hideStatus(status.get('id')));
}
},

onToggleCollapsed(status, isCollapsed) {
onToggleCollapsed (status, isCollapsed) {
dispatch(toggleStatusCollapse(status.get('id'), isCollapsed));
},

onBlockDomain(domain) {
onBlockDomain (domain) {
dispatch(openModal({
modalType: 'CONFIRM',
modalProps: {
Expand All @@ -265,15 +264,15 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
}));
},

onUnblockDomain(domain) {
onUnblockDomain (domain) {
dispatch(unblockDomain(domain));
},

deployPictureInPicture(status, type, mediaProps) {
deployPictureInPicture (status, type, mediaProps) {
dispatch(deployPictureInPicture(status.get('id'), status.getIn(['account', 'id']), type, mediaProps));
},

onInteractionModal(type, status) {
onInteractionModal (type, status) {
dispatch(openModal({
modalType: 'INTERACTION',
modalProps: {
Expand Down
Loading

0 comments on commit e664d83

Please sign in to comment.