2022-01-10 14:01:24 -08:00
|
|
|
import { isLoggedIn } from 'soapbox/utils/auth';
|
2022-04-29 14:19:52 -07:00
|
|
|
import { getFeatures } from 'soapbox/utils/features';
|
2022-01-10 14:01:24 -08:00
|
|
|
import { shouldHaveCard } from 'soapbox/utils/status';
|
2022-01-10 14:25:06 -08:00
|
|
|
|
2022-04-23 20:31:49 -07:00
|
|
|
import api, { getNextLink } from '../api';
|
2022-01-10 14:25:06 -08:00
|
|
|
|
2022-04-27 13:50:35 -07:00
|
|
|
import { setComposeToStatus } from './compose';
|
2023-04-10 10:06:06 -07:00
|
|
|
import { fetchGroupRelationships } from './groups';
|
2021-07-15 10:28:18 -07:00
|
|
|
import { importFetchedStatus, importFetchedStatuses } from './importer';
|
2022-02-02 05:33:12 -08:00
|
|
|
import { openModal } from './modals';
|
2022-01-10 14:17:52 -08:00
|
|
|
import { deleteFromTimelines } from './timelines';
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
import type { AppDispatch, RootState } from 'soapbox/store';
|
2022-08-09 15:05:16 -07:00
|
|
|
import type { APIEntity, Status } from 'soapbox/types/entities';
|
2021-06-27 12:17:37 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const STATUS_CREATE_REQUEST = 'STATUS_CREATE_REQUEST';
|
|
|
|
const STATUS_CREATE_SUCCESS = 'STATUS_CREATE_SUCCESS';
|
|
|
|
const STATUS_CREATE_FAIL = 'STATUS_CREATE_FAIL';
|
2022-04-27 13:50:35 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const STATUS_FETCH_SOURCE_REQUEST = 'STATUS_FETCH_SOURCE_REQUEST';
|
|
|
|
const STATUS_FETCH_SOURCE_SUCCESS = 'STATUS_FETCH_SOURCE_SUCCESS';
|
|
|
|
const STATUS_FETCH_SOURCE_FAIL = 'STATUS_FETCH_SOURCE_FAIL';
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const STATUS_FETCH_REQUEST = 'STATUS_FETCH_REQUEST';
|
|
|
|
const STATUS_FETCH_SUCCESS = 'STATUS_FETCH_SUCCESS';
|
|
|
|
const STATUS_FETCH_FAIL = 'STATUS_FETCH_FAIL';
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const STATUS_DELETE_REQUEST = 'STATUS_DELETE_REQUEST';
|
|
|
|
const STATUS_DELETE_SUCCESS = 'STATUS_DELETE_SUCCESS';
|
|
|
|
const STATUS_DELETE_FAIL = 'STATUS_DELETE_FAIL';
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const CONTEXT_FETCH_REQUEST = 'CONTEXT_FETCH_REQUEST';
|
|
|
|
const CONTEXT_FETCH_SUCCESS = 'CONTEXT_FETCH_SUCCESS';
|
|
|
|
const CONTEXT_FETCH_FAIL = 'CONTEXT_FETCH_FAIL';
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const STATUS_MUTE_REQUEST = 'STATUS_MUTE_REQUEST';
|
|
|
|
const STATUS_MUTE_SUCCESS = 'STATUS_MUTE_SUCCESS';
|
|
|
|
const STATUS_MUTE_FAIL = 'STATUS_MUTE_FAIL';
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const STATUS_UNMUTE_REQUEST = 'STATUS_UNMUTE_REQUEST';
|
|
|
|
const STATUS_UNMUTE_SUCCESS = 'STATUS_UNMUTE_SUCCESS';
|
|
|
|
const STATUS_UNMUTE_FAIL = 'STATUS_UNMUTE_FAIL';
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const STATUS_REVEAL = 'STATUS_REVEAL';
|
|
|
|
const STATUS_HIDE = 'STATUS_HIDE';
|
|
|
|
|
2022-10-27 10:46:03 -07:00
|
|
|
const STATUS_TRANSLATE_REQUEST = 'STATUS_TRANSLATE_REQUEST';
|
|
|
|
const STATUS_TRANSLATE_SUCCESS = 'STATUS_TRANSLATE_SUCCESS';
|
|
|
|
const STATUS_TRANSLATE_FAIL = 'STATUS_TRANSLATE_FAIL';
|
|
|
|
const STATUS_TRANSLATE_UNDO = 'STATUS_TRANSLATE_UNDO';
|
|
|
|
|
2023-03-03 13:40:39 -08:00
|
|
|
const STATUS_UNFILTER = 'STATUS_UNFILTER';
|
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const statusExists = (getState: () => RootState, statusId: string) => {
|
|
|
|
return (getState().statuses.get(statusId) || null) !== null;
|
2021-11-04 11:16:28 -07:00
|
|
|
};
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2022-06-20 10:59:51 -07:00
|
|
|
const createStatus = (params: Record<string, any>, idempotencyKey: string, statusId: string | null) => {
|
2022-06-19 12:26:57 -07:00
|
|
|
return (dispatch: AppDispatch, getState: () => RootState) => {
|
2022-08-06 05:39:05 -07:00
|
|
|
dispatch({ type: STATUS_CREATE_REQUEST, params, idempotencyKey, editing: !!statusId });
|
2021-06-27 12:17:37 -07:00
|
|
|
|
2022-04-27 13:50:35 -07:00
|
|
|
return api(getState).request({
|
|
|
|
url: statusId === null ? '/api/v1/statuses' : `/api/v1/statuses/${statusId}`,
|
|
|
|
method: statusId === null ? 'post' : 'put',
|
|
|
|
data: params,
|
2021-06-27 12:17:37 -07:00
|
|
|
headers: { 'Idempotency-Key': idempotencyKey },
|
|
|
|
}).then(({ data: status }) => {
|
2021-11-15 17:08:27 -08:00
|
|
|
// The backend might still be processing the rich media attachment
|
|
|
|
if (!status.card && shouldHaveCard(status)) {
|
|
|
|
status.expectsCard = true;
|
|
|
|
}
|
|
|
|
|
2021-10-09 19:12:21 -07:00
|
|
|
dispatch(importFetchedStatus(status, idempotencyKey));
|
2023-01-07 03:01:15 -08:00
|
|
|
dispatch({ type: STATUS_CREATE_SUCCESS, status, params, idempotencyKey, editing: !!statusId });
|
2021-11-15 17:08:27 -08:00
|
|
|
|
|
|
|
// Poll the backend for the updated card
|
|
|
|
if (status.expectsCard) {
|
|
|
|
const delay = 1000;
|
|
|
|
|
|
|
|
const poll = (retries = 5) => {
|
|
|
|
api(getState).get(`/api/v1/statuses/${status.id}`).then(response => {
|
2022-02-18 18:04:03 -08:00
|
|
|
if (response.data?.card) {
|
2021-11-15 17:08:27 -08:00
|
|
|
dispatch(importFetchedStatus(response.data));
|
|
|
|
} else if (retries > 0 && response.status === 200) {
|
|
|
|
setTimeout(() => poll(retries - 1), delay);
|
|
|
|
}
|
|
|
|
}).catch(console.error);
|
|
|
|
};
|
|
|
|
|
|
|
|
setTimeout(() => poll(), delay);
|
|
|
|
}
|
|
|
|
|
2021-06-27 12:17:37 -07:00
|
|
|
return status;
|
|
|
|
}).catch(error => {
|
2022-08-06 05:39:05 -07:00
|
|
|
dispatch({ type: STATUS_CREATE_FAIL, error, params, idempotencyKey, editing: !!statusId });
|
2021-06-27 12:17:37 -07:00
|
|
|
throw error;
|
|
|
|
});
|
|
|
|
};
|
2022-06-19 12:26:57 -07:00
|
|
|
};
|
2021-06-27 12:17:37 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const editStatus = (id: string) => (dispatch: AppDispatch, getState: () => RootState) => {
|
|
|
|
let status = getState().statuses.get(id)!;
|
2022-04-27 13:50:35 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
if (status.poll) {
|
|
|
|
status = status.set('poll', getState().polls.get(status.poll) as any);
|
2022-04-27 13:50:35 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
dispatch({ type: STATUS_FETCH_SOURCE_REQUEST });
|
|
|
|
|
|
|
|
api(getState).get(`/api/v1/statuses/${id}/source`).then(response => {
|
|
|
|
dispatch({ type: STATUS_FETCH_SOURCE_SUCCESS });
|
2022-09-03 07:13:41 -07:00
|
|
|
dispatch(setComposeToStatus(status, response.data.text, response.data.spoiler_text, response.data.content_type, false));
|
2022-04-27 13:50:35 -07:00
|
|
|
dispatch(openModal('COMPOSE'));
|
|
|
|
}).catch(error => {
|
|
|
|
dispatch({ type: STATUS_FETCH_SOURCE_FAIL, error });
|
|
|
|
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const fetchStatus = (id: string) => {
|
|
|
|
return (dispatch: AppDispatch, getState: () => RootState) => {
|
2021-11-04 11:16:28 -07:00
|
|
|
const skipLoading = statusExists(getState, id);
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2021-11-04 11:16:28 -07:00
|
|
|
dispatch({ type: STATUS_FETCH_REQUEST, id, skipLoading });
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2021-11-04 11:16:28 -07:00
|
|
|
return api(getState).get(`/api/v1/statuses/${id}`).then(({ data: status }) => {
|
|
|
|
dispatch(importFetchedStatus(status));
|
2023-04-10 10:06:06 -07:00
|
|
|
if (status.group) {
|
|
|
|
dispatch(fetchGroupRelationships([status.group.id]));
|
|
|
|
}
|
2021-11-04 11:16:28 -07:00
|
|
|
dispatch({ type: STATUS_FETCH_SUCCESS, status, skipLoading });
|
|
|
|
return status;
|
2021-07-15 10:28:18 -07:00
|
|
|
}).catch(error => {
|
2021-11-04 11:16:28 -07:00
|
|
|
dispatch({ type: STATUS_FETCH_FAIL, id, error, skipLoading, skipAlert: true });
|
2020-03-27 13:59:38 -07:00
|
|
|
});
|
|
|
|
};
|
2022-06-19 12:26:57 -07:00
|
|
|
};
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const deleteStatus = (id: string, withRedraft = false) => {
|
|
|
|
return (dispatch: AppDispatch, getState: () => RootState) => {
|
2022-06-01 05:34:36 -07:00
|
|
|
if (!isLoggedIn(getState)) return null;
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
let status = getState().statuses.get(id)!;
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
if (status.poll) {
|
|
|
|
status = status.set('poll', getState().polls.get(status.poll) as any);
|
2020-03-27 13:59:38 -07:00
|
|
|
}
|
|
|
|
|
2022-06-01 05:34:36 -07:00
|
|
|
dispatch({ type: STATUS_DELETE_REQUEST, params: status });
|
|
|
|
|
|
|
|
return api(getState)
|
|
|
|
.delete(`/api/v1/statuses/${id}`)
|
|
|
|
.then(response => {
|
|
|
|
dispatch({ type: STATUS_DELETE_SUCCESS, id });
|
|
|
|
dispatch(deleteFromTimelines(id));
|
|
|
|
|
|
|
|
if (withRedraft) {
|
|
|
|
dispatch(setComposeToStatus(status, response.data.text, response.data.spoiler_text, response.data.pleroma?.content_type, withRedraft));
|
|
|
|
dispatch(openModal('COMPOSE'));
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.catch(error => {
|
|
|
|
dispatch({ type: STATUS_DELETE_FAIL, params: status, error });
|
|
|
|
});
|
2020-03-27 13:59:38 -07:00
|
|
|
};
|
2022-06-19 12:26:57 -07:00
|
|
|
};
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const updateStatus = (status: APIEntity) => (dispatch: AppDispatch) =>
|
2022-04-27 13:50:35 -07:00
|
|
|
dispatch(importFetchedStatus(status));
|
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const fetchContext = (id: string) =>
|
|
|
|
(dispatch: AppDispatch, getState: () => RootState) => {
|
2021-11-04 11:16:28 -07:00
|
|
|
dispatch({ type: CONTEXT_FETCH_REQUEST, id });
|
|
|
|
|
|
|
|
return api(getState).get(`/api/v1/statuses/${id}/context`).then(({ data: context }) => {
|
2022-02-07 10:19:28 -08:00
|
|
|
if (Array.isArray(context)) {
|
|
|
|
// Mitra: returns a list of statuses
|
|
|
|
dispatch(importFetchedStatuses(context));
|
|
|
|
} else if (typeof context === 'object') {
|
|
|
|
// Standard Mastodon API returns a map with `ancestors` and `descendants`
|
|
|
|
const { ancestors, descendants } = context;
|
|
|
|
const statuses = ancestors.concat(descendants);
|
|
|
|
dispatch(importFetchedStatuses(statuses));
|
|
|
|
dispatch({ type: CONTEXT_FETCH_SUCCESS, id, ancestors, descendants });
|
|
|
|
} else {
|
|
|
|
throw context;
|
|
|
|
}
|
2021-11-04 11:16:28 -07:00
|
|
|
return context;
|
2020-03-27 13:59:38 -07:00
|
|
|
}).catch(error => {
|
2022-02-18 18:04:03 -08:00
|
|
|
if (error.response?.status === 404) {
|
2020-03-27 13:59:38 -07:00
|
|
|
dispatch(deleteFromTimelines(id));
|
|
|
|
}
|
|
|
|
|
2021-11-04 11:16:28 -07:00
|
|
|
dispatch({ type: CONTEXT_FETCH_FAIL, id, error, skipAlert: true });
|
2020-03-27 13:59:38 -07:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const fetchNext = (statusId: string, next: string) =>
|
|
|
|
async(dispatch: AppDispatch, getState: () => RootState) => {
|
2022-04-23 20:31:49 -07:00
|
|
|
const response = await api(getState).get(next);
|
|
|
|
dispatch(importFetchedStatuses(response.data));
|
2022-05-13 11:07:11 -07:00
|
|
|
|
|
|
|
dispatch({
|
|
|
|
type: CONTEXT_FETCH_SUCCESS,
|
|
|
|
id: statusId,
|
|
|
|
ancestors: [],
|
|
|
|
descendants: response.data,
|
|
|
|
});
|
|
|
|
|
2022-04-23 20:31:49 -07:00
|
|
|
return { next: getNextLink(response) };
|
|
|
|
};
|
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const fetchAncestors = (id: string) =>
|
|
|
|
async(dispatch: AppDispatch, getState: () => RootState) => {
|
2022-04-23 20:31:49 -07:00
|
|
|
const response = await api(getState).get(`/api/v1/statuses/${id}/context/ancestors`);
|
|
|
|
dispatch(importFetchedStatuses(response.data));
|
|
|
|
return response;
|
|
|
|
};
|
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const fetchDescendants = (id: string) =>
|
|
|
|
async(dispatch: AppDispatch, getState: () => RootState) => {
|
2022-04-23 20:31:49 -07:00
|
|
|
const response = await api(getState).get(`/api/v1/statuses/${id}/context/descendants`);
|
|
|
|
dispatch(importFetchedStatuses(response.data));
|
|
|
|
return response;
|
|
|
|
};
|
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const fetchStatusWithContext = (id: string) =>
|
|
|
|
async(dispatch: AppDispatch, getState: () => RootState) => {
|
2022-04-23 20:31:49 -07:00
|
|
|
const features = getFeatures(getState().instance);
|
|
|
|
|
|
|
|
if (features.paginatedContext) {
|
2022-05-13 15:25:58 -07:00
|
|
|
await dispatch(fetchStatus(id));
|
2022-04-23 20:31:49 -07:00
|
|
|
const responses = await Promise.all([
|
|
|
|
dispatch(fetchAncestors(id)),
|
|
|
|
dispatch(fetchDescendants(id)),
|
|
|
|
]);
|
2022-05-13 11:07:11 -07:00
|
|
|
|
|
|
|
dispatch({
|
|
|
|
type: CONTEXT_FETCH_SUCCESS,
|
|
|
|
id,
|
|
|
|
ancestors: responses[0].data,
|
|
|
|
descendants: responses[1].data,
|
|
|
|
});
|
|
|
|
|
2022-04-23 20:31:49 -07:00
|
|
|
const next = getNextLink(responses[1]);
|
|
|
|
return { next };
|
|
|
|
} else {
|
|
|
|
await Promise.all([
|
|
|
|
dispatch(fetchContext(id)),
|
|
|
|
dispatch(fetchStatus(id)),
|
|
|
|
]);
|
|
|
|
return { next: undefined };
|
|
|
|
}
|
2020-03-27 13:59:38 -07:00
|
|
|
};
|
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const muteStatus = (id: string) =>
|
|
|
|
(dispatch: AppDispatch, getState: () => RootState) => {
|
2021-03-24 09:44:51 -07:00
|
|
|
if (!isLoggedIn(getState)) return;
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2021-11-04 11:16:28 -07:00
|
|
|
dispatch({ type: STATUS_MUTE_REQUEST, id });
|
2020-03-27 13:59:38 -07:00
|
|
|
api(getState).post(`/api/v1/statuses/${id}/mute`).then(() => {
|
2021-11-04 11:16:28 -07:00
|
|
|
dispatch({ type: STATUS_MUTE_SUCCESS, id });
|
2020-03-27 13:59:38 -07:00
|
|
|
}).catch(error => {
|
2021-11-04 11:16:28 -07:00
|
|
|
dispatch({ type: STATUS_MUTE_FAIL, id, error });
|
2020-03-27 13:59:38 -07:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const unmuteStatus = (id: string) =>
|
|
|
|
(dispatch: AppDispatch, getState: () => RootState) => {
|
2021-03-24 09:44:51 -07:00
|
|
|
if (!isLoggedIn(getState)) return;
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2021-11-04 11:16:28 -07:00
|
|
|
dispatch({ type: STATUS_UNMUTE_REQUEST, id });
|
2020-03-27 13:59:38 -07:00
|
|
|
api(getState).post(`/api/v1/statuses/${id}/unmute`).then(() => {
|
2021-11-04 11:16:28 -07:00
|
|
|
dispatch({ type: STATUS_UNMUTE_SUCCESS, id });
|
2020-03-27 13:59:38 -07:00
|
|
|
}).catch(error => {
|
2021-11-04 11:16:28 -07:00
|
|
|
dispatch({ type: STATUS_UNMUTE_FAIL, id, error });
|
2020-03-27 13:59:38 -07:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2022-08-09 15:05:16 -07:00
|
|
|
const toggleMuteStatus = (status: Status) =>
|
|
|
|
(dispatch: AppDispatch, getState: () => RootState) => {
|
|
|
|
if (status.muted) {
|
|
|
|
dispatch(unmuteStatus(status.id));
|
|
|
|
} else {
|
|
|
|
dispatch(muteStatus(status.id));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const hideStatus = (ids: string[] | string) => {
|
2020-03-27 13:59:38 -07:00
|
|
|
if (!Array.isArray(ids)) {
|
|
|
|
ids = [ids];
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
type: STATUS_HIDE,
|
|
|
|
ids,
|
|
|
|
};
|
2022-06-19 12:26:57 -07:00
|
|
|
};
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
const revealStatus = (ids: string[] | string) => {
|
2020-03-27 13:59:38 -07:00
|
|
|
if (!Array.isArray(ids)) {
|
|
|
|
ids = [ids];
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
type: STATUS_REVEAL,
|
|
|
|
ids,
|
|
|
|
};
|
2022-06-19 12:26:57 -07:00
|
|
|
};
|
|
|
|
|
2022-08-09 15:45:01 -07:00
|
|
|
const toggleStatusHidden = (status: Status) => {
|
|
|
|
if (status.hidden) {
|
|
|
|
return revealStatus(status.id);
|
|
|
|
} else {
|
|
|
|
return hideStatus(status.id);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-11-04 14:36:39 -07:00
|
|
|
const translateStatus = (id: string, targetLanguage?: string) => (dispatch: AppDispatch, getState: () => RootState) => {
|
2022-10-27 10:46:03 -07:00
|
|
|
dispatch({ type: STATUS_TRANSLATE_REQUEST, id });
|
|
|
|
|
2022-11-04 14:36:39 -07:00
|
|
|
api(getState).post(`/api/v1/statuses/${id}/translate`, {
|
|
|
|
target_language: targetLanguage,
|
|
|
|
}).then(response => {
|
2022-10-27 10:46:03 -07:00
|
|
|
dispatch({
|
|
|
|
type: STATUS_TRANSLATE_SUCCESS,
|
|
|
|
id,
|
|
|
|
translation: response.data,
|
|
|
|
});
|
|
|
|
}).catch(error => {
|
|
|
|
dispatch({
|
|
|
|
type: STATUS_TRANSLATE_FAIL,
|
|
|
|
id,
|
|
|
|
error,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
const undoStatusTranslation = (id: string) => ({
|
|
|
|
type: STATUS_TRANSLATE_UNDO,
|
|
|
|
id,
|
|
|
|
});
|
|
|
|
|
2023-03-03 13:40:39 -08:00
|
|
|
const unfilterStatus = (id: string) => ({
|
|
|
|
type: STATUS_UNFILTER,
|
|
|
|
id,
|
|
|
|
});
|
|
|
|
|
2022-06-19 12:26:57 -07:00
|
|
|
export {
|
|
|
|
STATUS_CREATE_REQUEST,
|
|
|
|
STATUS_CREATE_SUCCESS,
|
|
|
|
STATUS_CREATE_FAIL,
|
|
|
|
STATUS_FETCH_SOURCE_REQUEST,
|
|
|
|
STATUS_FETCH_SOURCE_SUCCESS,
|
|
|
|
STATUS_FETCH_SOURCE_FAIL,
|
|
|
|
STATUS_FETCH_REQUEST,
|
|
|
|
STATUS_FETCH_SUCCESS,
|
|
|
|
STATUS_FETCH_FAIL,
|
|
|
|
STATUS_DELETE_REQUEST,
|
|
|
|
STATUS_DELETE_SUCCESS,
|
|
|
|
STATUS_DELETE_FAIL,
|
|
|
|
CONTEXT_FETCH_REQUEST,
|
|
|
|
CONTEXT_FETCH_SUCCESS,
|
|
|
|
CONTEXT_FETCH_FAIL,
|
|
|
|
STATUS_MUTE_REQUEST,
|
|
|
|
STATUS_MUTE_SUCCESS,
|
|
|
|
STATUS_MUTE_FAIL,
|
|
|
|
STATUS_UNMUTE_REQUEST,
|
|
|
|
STATUS_UNMUTE_SUCCESS,
|
|
|
|
STATUS_UNMUTE_FAIL,
|
|
|
|
STATUS_REVEAL,
|
|
|
|
STATUS_HIDE,
|
2022-10-27 10:46:03 -07:00
|
|
|
STATUS_TRANSLATE_REQUEST,
|
|
|
|
STATUS_TRANSLATE_SUCCESS,
|
|
|
|
STATUS_TRANSLATE_FAIL,
|
|
|
|
STATUS_TRANSLATE_UNDO,
|
2023-03-03 13:40:39 -08:00
|
|
|
STATUS_UNFILTER,
|
2022-06-19 12:26:57 -07:00
|
|
|
createStatus,
|
|
|
|
editStatus,
|
|
|
|
fetchStatus,
|
|
|
|
deleteStatus,
|
|
|
|
updateStatus,
|
|
|
|
fetchContext,
|
|
|
|
fetchNext,
|
|
|
|
fetchAncestors,
|
|
|
|
fetchDescendants,
|
|
|
|
fetchStatusWithContext,
|
|
|
|
muteStatus,
|
|
|
|
unmuteStatus,
|
2022-08-09 15:05:16 -07:00
|
|
|
toggleMuteStatus,
|
2022-06-19 12:26:57 -07:00
|
|
|
hideStatus,
|
|
|
|
revealStatus,
|
2022-08-09 15:45:01 -07:00
|
|
|
toggleStatusHidden,
|
2022-10-27 10:46:03 -07:00
|
|
|
translateStatus,
|
|
|
|
undoStatusTranslation,
|
2023-03-03 13:40:39 -08:00
|
|
|
unfilterStatus,
|
2022-06-19 12:26:57 -07:00
|
|
|
};
|