diff --git a/README.md b/README.md
index a56c7820..d4b24240 100644
--- a/README.md
+++ b/README.md
@@ -19,10 +19,10 @@ We have diverged from Mastodon in several ways in pursuit of our own goals.
1. Quote posting
## BTCPay
-In order to make BTC flow work, 3 enviornment variables need to be set:
+In order to make BTC flow work, 3 environment variables need to be set:
-- `BTCPAY_LEGACY_TOKEN`: So called Legacy Tokens can be found in https://btcpay.xxx.com/stores/yyy/Tokens
-- `BTCPAY_PUB_KEY`: Public key that is used when creating an access token or pairing https://btcpay.xxx.com/stores/yyy/Tokens/Create
+- `BTCPAY_LEGACY_TOKEN`: So called Legacy Tokens can be found in https://btcpay.[yourdomain].com/stores/[yourstore]/Tokens
+- `BTCPAY_PUB_KEY`: Public key that is used when creating an access token or pairing https://btcpay.[yourdomain].com/stores/[yourstore]/Tokens/Create
- `BTCPAY_MERCHANT_TOKEN`: Token created for facade *merchant*
## Deployment
diff --git a/app/javascript/gabsocial/actions/compose.js b/app/javascript/gabsocial/actions/compose.js
index a52dc427..536c0560 100644
--- a/app/javascript/gabsocial/actions/compose.js
+++ b/app/javascript/gabsocial/actions/compose.js
@@ -137,6 +137,32 @@ export function directCompose(account, routerHistory) {
};
};
+export function handleComposeSubmit(dispatch, getState, response, status) {
+ if (!dispatch || !getState) return;
+
+ dispatch(insertIntoTagHistory(response.data.tags, status));
+ dispatch(submitComposeSuccess({ ...response.data }));
+
+ // To make the app more responsive, immediately push the status into the columns
+ const insertIfOnline = timelineId => {
+ const timeline = getState().getIn(['timelines', timelineId]);
+
+ if (timeline && timeline.get('items').size > 0 && timeline.getIn(['items', 0]) !== null && timeline.get('online')) {
+ let dequeueArgs = {};
+ if (timelineId === 'community') dequeueArgs.onlyMedia = getState().getIn(['settings', 'community', 'other', 'onlyMedia']);
+ dispatch(dequeueTimeline(timelineId, null, dequeueArgs));
+ dispatch(updateTimeline(timelineId, { ...response.data }));
+ }
+ };
+
+ if (response.data.visibility !== 'direct') {
+ insertIfOnline('home');
+ } else if (response.data.in_reply_to_id === null && response.data.visibility === 'public') {
+ insertIfOnline('community');
+ insertIfOnline('public');
+ }
+}
+
export function submitCompose(routerHistory, group) {
return function (dispatch, getState) {
if (!me) return;
@@ -175,33 +201,7 @@ export function submitCompose(routerHistory, group) {
if (response.data.visibility === 'direct' && getState().getIn(['conversations', 'mounted']) <= 0 && routerHistory) {
routerHistory.push('/messages');
}
-
- dispatch(insertIntoTagHistory(response.data.tags, status));
- dispatch(submitComposeSuccess({ ...response.data }));
-
- // To make the app more responsive, immediately push the status
- // into the columns
-
- const insertIfOnline = timelineId => {
- const timeline = getState().getIn(['timelines', timelineId]);
-
- if (timeline && timeline.get('items').size > 0 && timeline.getIn(['items', 0]) !== null && timeline.get('online')) {
- let dequeueArgs = {};
- if (timelineId === 'community') dequeueArgs.onlyMedia = getState().getIn(['settings', 'community', 'other', 'onlyMedia']),
-
- dispatch(dequeueTimeline(timelineId, null, dequeueArgs));
- dispatch(updateTimeline(timelineId, { ...response.data }));
- }
- };
-
- if (response.data.visibility !== 'direct') {
- insertIfOnline('home');
- }
-
- if (response.data.in_reply_to_id === null && response.data.visibility === 'public') {
- insertIfOnline('community');
- insertIfOnline('public');
- }
+ handleComposeSubmit(dispatch, getState, response, status);
}).catch(function (error) {
dispatch(submitComposeFail(error));
});
diff --git a/app/javascript/gabsocial/actions/streaming.js b/app/javascript/gabsocial/actions/streaming.js
index e599805e..0baf42c9 100644
--- a/app/javascript/gabsocial/actions/streaming.js
+++ b/app/javascript/gabsocial/actions/streaming.js
@@ -10,6 +10,7 @@ import { updateNotificationsQueue, expandNotifications } from './notifications';
import { updateConversations } from './conversations';
import { fetchFilters } from './filters';
import { getLocale } from '../locales';
+import { handleComposeSubmit } from './compose';
const { messages } = getLocale();
@@ -61,3 +62,18 @@ export const connectHashtagStream = (id, tag, accept) => connectTimelineStream
export const connectDirectStream = () => connectTimelineStream('direct', 'direct');
export const connectListStream = id => connectTimelineStream(`list:${id}`, `list&list=${id}`);
export const connectGroupStream = id => connectTimelineStream(`group:${id}`, `group&group=${id}`);
+
+export const connectStatusUpdateStream = () => {
+ return connectStream('statuscard', null, (dispatch, getState) => {
+ return {
+ onConnect() {},
+ onDisconnect() {},
+ onReceive (data) {
+ if (!data['event'] || !data['payload']) return;
+ if (data.event === 'update') {
+ handleComposeSubmit(dispatch, getState, {data: JSON.parse(data.payload)}, null)
+ }
+ },
+ };
+ });
+}
\ No newline at end of file
diff --git a/app/javascript/gabsocial/components/extended_video_player.js b/app/javascript/gabsocial/components/extended_video_player.js
index 009c0d55..9dfc745f 100644
--- a/app/javascript/gabsocial/components/extended_video_player.js
+++ b/app/javascript/gabsocial/components/extended_video_player.js
@@ -44,9 +44,9 @@ export default class ExtendedVideoPlayer extends React.PureComponent {
return (
GIF
diff --git a/app/javascript/gabsocial/components/status.js b/app/javascript/gabsocial/components/status.js
index 091ad617..715e887c 100644
--- a/app/javascript/gabsocial/components/status.js
+++ b/app/javascript/gabsocial/components/status.js
@@ -380,7 +380,6 @@ class Status extends ImmutablePureComponent {
diff --git a/app/javascript/gabsocial/containers/gabsocial.js b/app/javascript/gabsocial/containers/gabsocial.js
index 2e63c305..65e92607 100644
--- a/app/javascript/gabsocial/containers/gabsocial.js
+++ b/app/javascript/gabsocial/containers/gabsocial.js
@@ -11,7 +11,10 @@ import UI from '../features/ui';
import Introduction from '../features/introduction';
import { fetchCustomEmojis } from '../actions/custom_emojis';
import { hydrateStore } from '../actions/store';
-import { connectUserStream } from '../actions/streaming';
+import {
+ connectUserStream,
+ connectStatusUpdateStream,
+} from '../actions/streaming';
import { IntlProvider, addLocaleData } from 'react-intl';
import { getLocale } from '../locales';
import initialState from '../initial_state';
@@ -70,6 +73,7 @@ export default class GabSocial extends React.PureComponent {
componentDidMount() {
this.disconnect = store.dispatch(connectUserStream());
+ store.dispatch(connectStatusUpdateStream());
}
componentWillUnmount () {
diff --git a/app/javascript/gabsocial/features/account_gallery/components/media_item.js b/app/javascript/gabsocial/features/account_gallery/components/media_item.js
index e416e507..9d4a42a1 100644
--- a/app/javascript/gabsocial/features/account_gallery/components/media_item.js
+++ b/app/javascript/gabsocial/features/account_gallery/components/media_item.js
@@ -127,6 +127,7 @@ export default class MediaItem extends ImmutablePureComponent {
autoPlay={autoPlay}
loop
muted
+ playsInline
/>
GIF
diff --git a/app/javascript/gabsocial/features/status/components/card.js b/app/javascript/gabsocial/features/status/components/card.js
index b050e928..31df9726 100644
--- a/app/javascript/gabsocial/features/status/components/card.js
+++ b/app/javascript/gabsocial/features/status/components/card.js
@@ -58,16 +58,12 @@ export default class Card extends React.PureComponent {
static propTypes = {
card: ImmutablePropTypes.map,
- maxDescription: PropTypes.number,
onOpenMedia: PropTypes.func.isRequired,
- compact: PropTypes.bool,
defaultWidth: PropTypes.number,
cacheWidth: PropTypes.func,
};
static defaultProps = {
- maxDescription: 50,
- compact: false,
};
state = {
@@ -131,37 +127,52 @@ export default class Card extends React.PureComponent {
ref={this.setRef}
className='status-card__image status-card-video'
dangerouslySetInnerHTML={content}
- style={{ height }}
+ style={{
+ height,
+ paddingBottom: 0,
+ }}
/>
);
}
render () {
- const { card, maxDescription, compact } = this.props;
+ const { card } = this.props;
const { width, embedded } = this.state;
if (card === null) {
return null;
}
- const provider = card.get('provider_name').length === 0 ? decodeIDNA(getHostname(card.get('url'))) : card.get('provider_name');
- const horizontal = (!compact && card.get('width') > card.get('height') && (card.get('width') + 100 >= width)) || card.get('type') !== 'link' || embedded;
+ const maxDescription = 150;
+ const cardImg = card.get('image');
+ const provider = card.get('provider_name').length === 0 ? decodeIDNA(getHostname(card.get('url'))) : card.get('provider_name');
+ const horizontal = (card.get('width') > card.get('height') && (card.get('width') + 100 >= width)) || card.get('type') !== 'link' || embedded;
const interactive = card.get('type') !== 'link';
- const className = classnames('status-card', { horizontal, compact, interactive });
- const title = interactive ?
{card.get('title')} :
{card.get('title')};
- const ratio = card.get('width') / card.get('height');
- const height = (compact && !embedded) ? (width / (16 / 9)) : (width / ratio);
+ const className = classnames('status-card', {
+ horizontal,
+ interactive,
+ compact: !cardImg,
+ });
+ const title = interactive ?
+
+ {card.get('title')}
+
+ :
{card.get('title')};
const description = (
{title}
- {!(horizontal || compact) &&
{trim(card.get('description') || '', maxDescription)}
}
-
{provider}
+ {!horizontal &&
{trim(card.get('description') || '', maxDescription)}
}
+
+
+ {' '}
+ {provider}
+
);
- let embed = '';
- let thumbnail =
;
+ let embed = '';
+ let thumbnail =
;
if (interactive) {
if (embedded) {
@@ -176,7 +187,6 @@ export default class Card extends React.PureComponent {
embed = (
{thumbnail}
-
@@ -190,10 +200,10 @@ export default class Card extends React.PureComponent {
return (
{embed}
- {!compact && description}
+ {description}
);
- } else if (card.get('image')) {
+ } else if (cardImg) {
embed = (
{thumbnail}
diff --git a/app/javascript/gabsocial/features/video/index.js b/app/javascript/gabsocial/features/video/index.js
index 17deea6a..b03a929a 100644
--- a/app/javascript/gabsocial/features/video/index.js
+++ b/app/javascript/gabsocial/features/video/index.js
@@ -344,6 +344,7 @@ class Video extends React.PureComponent {
}
handleProgress = () => {
+ if (!this.video.buffered) return;
if (this.video.buffered.length > 0) {
this.setState({ buffer: this.video.buffered.end(0) / this.video.duration * 100 });
}
@@ -432,6 +433,7 @@ class Video extends React.PureComponent {
{revealed &&