diff --git a/.env.production.sample b/.env.production.sample
index 7bcce0f7e59b98..4d058f0119180d 100644
--- a/.env.production.sample
+++ b/.env.production.sample
@@ -294,6 +294,9 @@ MAX_POLL_OPTION_CHARS=100
# HCAPTCHA_SECRET_KEY=
# HCAPTCHA_SITE_KEY=
+# New registrations will automatically follow these accounts (separated by commas)
+AUTOFOLLOW=
+
# IP and session retention
# -----------------------
# Make sure to modify the scheduling of ip_cleanup_scheduler in config/sidekiq.yml
diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js
index 4041b4819425aa..63a9c7e6b7feee 100644
--- a/app/javascript/flavours/glitch/components/status.js
+++ b/app/javascript/flavours/glitch/components/status.js
@@ -6,6 +6,7 @@ import StatusHeader from './status_header';
import StatusIcons from './status_icons';
import StatusContent from './status_content';
import StatusActionBar from './status_action_bar';
+import StatusExpandButton from './status_expand_button';
import AttachmentList from './attachment_list';
import Card from '../features/status/components/card';
import { injectIntl, FormattedMessage } from 'react-intl';
@@ -799,6 +800,14 @@ class Status extends ImmutablePureComponent {
tagLinks={settings.get('tag_misleading_links')}
rewriteMentions={settings.get('rewrite_mentions')}
/>
+ {/* Only show expand button if collapsed and no spoiler tag is present */}
+ {isCollapsed && status.get('spoiler_text').length===0 ? (
+
+ ) : null}
{!isCollapsed || !(muted || !settings.getIn(['collapsed', 'show_action_bar'])) ? (
{
return (text === origin || text === host
@@ -359,38 +360,6 @@ class StatusContent extends React.PureComponent {
)).reduce((aggregate, item) => [...aggregate, item, ' '], []);
- let toggleText = null;
- if (hidden) {
- toggleText = [
- ,
- ];
- if (mediaIcons) {
- mediaIcons.forEach((mediaIcon, idx) => {
- toggleText.push(
- ,
- );
- });
- }
- } else {
- toggleText = (
-
- );
- }
-
if (hidden) {
mentionsPlaceholder = {mentionLinks}
;
}
@@ -402,9 +371,11 @@ class StatusContent extends React.PureComponent {
>
{' '}
-
+
{mentionsPlaceholder}
diff --git a/app/javascript/flavours/glitch/components/status_expand_button.js b/app/javascript/flavours/glitch/components/status_expand_button.js
new file mode 100644
index 00000000000000..3f5d8638640147
--- /dev/null
+++ b/app/javascript/flavours/glitch/components/status_expand_button.js
@@ -0,0 +1,71 @@
+import React from 'react';
+import { useState, useEffect } from 'react';
+import PropTypes from 'prop-types';
+import { FormattedMessage } from 'react-intl';
+import Icon from './icon';
+
+
+const StatusExpandButton=(
+ {
+ hidden,
+ handleSpoilerClick,
+ mediaIcons,
+ },
+)=>{
+ const makeToggleText = () => {
+ let newText;
+ if (hidden) {
+ newText = [
+ ,
+ ];
+ if (mediaIcons) {
+ mediaIcons.forEach((mediaIcon, idx) => {
+ newText.push(
+ ,
+ );
+ });
+ }
+ } else {
+ newText = (
+
+ );
+ }
+ return(newText);
+ };
+
+ // const [hidden, setHidden] = useState(false);
+ const [toggleText, setToggleText] = useState(makeToggleText());
+
+ // Change the text when the hidden state changes
+ useEffect(() => {
+ setToggleText(makeToggleText());
+ }, [hidden]);
+
+ return(
+
+ );
+};
+
+StatusExpandButton.propTypes = {
+ hidden: PropTypes.bool,
+ handleSpoilerClick: PropTypes.func,
+ mediaIcons: PropTypes.arrayOf(PropTypes.string),
+};
+
+export default StatusExpandButton;
diff --git a/app/javascript/flavours/glitch/styles/components/status.scss b/app/javascript/flavours/glitch/styles/components/status.scss
index bb5bbc0ac6d7a4..6c4bd55c5b734a 100644
--- a/app/javascript/flavours/glitch/styles/components/status.scss
+++ b/app/javascript/flavours/glitch/styles/components/status.scss
@@ -391,22 +391,22 @@
}
.status__content {
- height: 20px;
+ max-height: 6em;
overflow: hidden;
text-overflow: ellipsis;
- padding-top: 0;
+ //padding-top: 0;
&:after {
content: "";
position: absolute;
- top: 0;
+ height: 40%;
bottom: 0;
left: 0;
right: 0;
background: linear-gradient(rgba($ui-base-color, 0), rgba($ui-base-color, 1));
pointer-events: none;
}
-
+
a:hover {
text-decoration: none;
}
diff --git a/app/services/bootstrap_timeline_service.rb b/app/services/bootstrap_timeline_service.rb
index 126c0fa2e59791..8ed2974b09a0c1 100644
--- a/app/services/bootstrap_timeline_service.rb
+++ b/app/services/bootstrap_timeline_service.rb
@@ -6,6 +6,7 @@ def call(source_account)
autofollow_inviter!
notify_staff!
+ autofollow!
end
private
@@ -16,6 +17,19 @@ def autofollow_inviter!
FollowService.new.call(@source_account, @source_account.user.invite.user.account)
end
+ def autofollow!
+ return unless ENV['AUTOFOLLOW'].present?
+
+ ENV['AUTOFOLLOW'].to_s.split(',').each do |account|
+ begin
+ to_follow = Account.find_local!(account.strip)
+ FollowService.new.call(@source_account, to_follow)
+ rescue ActiveRecord::RecordNotFound
+ Rails.logger.warn("Could not find account #{account} to autofollow")
+ end
+ end
+ end
+
def notify_staff!
User.those_who_can(:manage_users).includes(:account).find_each do |user|
LocalNotificationWorker.perform_async(user.account_id, @source_account.id, 'Account', 'admin.sign_up')
diff --git a/config/settings.yml b/config/settings.yml
index d3e6da131949d5..3199e8e1904f81 100644
--- a/config/settings.yml
+++ b/config/settings.yml
@@ -43,7 +43,7 @@ defaults: &defaults
trending_status_cw: true
crop_images: true
notification_emails:
- follow: true
+ follow: false
reblog: false
favourite: false
mention: true