about summary refs log tree commit diff
path: root/app/javascript/mastodon/actions/accounts.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/mastodon/actions/accounts.js')
-rw-r--r--app/javascript/mastodon/actions/accounts.js215
1 files changed, 0 insertions, 215 deletions
diff --git a/app/javascript/mastodon/actions/accounts.js b/app/javascript/mastodon/actions/accounts.js
index 405032460..a862798f9 100644
--- a/app/javascript/mastodon/actions/accounts.js
+++ b/app/javascript/mastodon/actions/accounts.js
@@ -29,22 +29,6 @@ export const ACCOUNT_UNMUTE_REQUEST = 'ACCOUNT_UNMUTE_REQUEST';
 export const ACCOUNT_UNMUTE_SUCCESS = 'ACCOUNT_UNMUTE_SUCCESS';
 export const ACCOUNT_UNMUTE_FAIL    = 'ACCOUNT_UNMUTE_FAIL';
 
-export const ACCOUNT_TIMELINE_FETCH_REQUEST = 'ACCOUNT_TIMELINE_FETCH_REQUEST';
-export const ACCOUNT_TIMELINE_FETCH_SUCCESS = 'ACCOUNT_TIMELINE_FETCH_SUCCESS';
-export const ACCOUNT_TIMELINE_FETCH_FAIL    = 'ACCOUNT_TIMELINE_FETCH_FAIL';
-
-export const ACCOUNT_TIMELINE_EXPAND_REQUEST = 'ACCOUNT_TIMELINE_EXPAND_REQUEST';
-export const ACCOUNT_TIMELINE_EXPAND_SUCCESS = 'ACCOUNT_TIMELINE_EXPAND_SUCCESS';
-export const ACCOUNT_TIMELINE_EXPAND_FAIL    = 'ACCOUNT_TIMELINE_EXPAND_FAIL';
-
-export const ACCOUNT_MEDIA_TIMELINE_FETCH_REQUEST = 'ACCOUNT_MEDIA_TIMELINE_FETCH_REQUEST';
-export const ACCOUNT_MEDIA_TIMELINE_FETCH_SUCCESS = 'ACCOUNT_MEDIA_TIMELINE_FETCH_SUCCESS';
-export const ACCOUNT_MEDIA_TIMELINE_FETCH_FAIL    = 'ACCOUNT_MEDIA_TIMELINE_FETCH_FAIL';
-
-export const ACCOUNT_MEDIA_TIMELINE_EXPAND_REQUEST = 'ACCOUNT_MEDIA_TIMELINE_EXPAND_REQUEST';
-export const ACCOUNT_MEDIA_TIMELINE_EXPAND_SUCCESS = 'ACCOUNT_MEDIA_TIMELINE_EXPAND_SUCCESS';
-export const ACCOUNT_MEDIA_TIMELINE_EXPAND_FAIL    = 'ACCOUNT_MEDIA_TIMELINE_EXPAND_FAIL';
-
 export const FOLLOWERS_FETCH_REQUEST = 'FOLLOWERS_FETCH_REQUEST';
 export const FOLLOWERS_FETCH_SUCCESS = 'FOLLOWERS_FETCH_SUCCESS';
 export const FOLLOWERS_FETCH_FAIL    = 'FOLLOWERS_FETCH_FAIL';
@@ -99,99 +83,6 @@ export function fetchAccount(id) {
   };
 };
 
-export function fetchAccountTimeline(id, replace = false) {
-  return (dispatch, getState) => {
-    const ids      = getState().getIn(['timelines', 'accounts_timelines', id, 'items'], Immutable.List());
-    const newestId = ids.size > 0 ? ids.first() : null;
-
-    let params = {};
-    let skipLoading = false;
-
-    replace = replace || newestId === null;
-
-    if (!replace) {
-      params.since_id = newestId;
-      skipLoading = true;
-    }
-
-    dispatch(fetchAccountTimelineRequest(id, skipLoading));
-
-    api(getState).get(`/api/v1/accounts/${id}/statuses`, { params }).then(response => {
-      const next = getLinks(response).refs.find(link => link.rel === 'next');
-      dispatch(fetchAccountTimelineSuccess(id, response.data, replace, skipLoading, next));
-    }).catch(error => {
-      dispatch(fetchAccountTimelineFail(id, error, skipLoading));
-    });
-  };
-};
-
-export function fetchAccountMediaTimeline(id, replace = false) {
-  return (dispatch, getState) => {
-    const ids      = getState().getIn(['timelines', 'accounts_media_timelines', id, 'items'], Immutable.List());
-    const newestId = ids.size > 0 ? ids.first() : null;
-
-    let params = { only_media: 'true', limit: 12 };
-    let skipLoading = false;
-
-    replace = replace || newestId === null;
-
-    if (!replace) {
-      params.since_id = newestId;
-      skipLoading = true;
-    }
-
-    dispatch(fetchAccountMediaTimelineRequest(id, skipLoading));
-
-    api(getState).get(`/api/v1/accounts/${id}/statuses`, { params }).then(response => {
-      const next = getLinks(response).refs.find(link => link.rel === 'next');
-      dispatch(fetchAccountMediaTimelineSuccess(id, response.data, replace, skipLoading, next));
-    }).catch(error => {
-      dispatch(fetchAccountMediaTimelineFail(id, error, skipLoading));
-    });
-  };
-};
-
-export function expandAccountTimeline(id) {
-  return (dispatch, getState) => {
-    const lastId = getState().getIn(['timelines', 'accounts_timelines', id, 'items'], Immutable.List()).last();
-
-    dispatch(expandAccountTimelineRequest(id));
-
-    api(getState).get(`/api/v1/accounts/${id}/statuses`, {
-      params: {
-        limit: 10,
-        max_id: lastId,
-      },
-    }).then(response => {
-      const next = getLinks(response).refs.find(link => link.rel === 'next');
-      dispatch(expandAccountTimelineSuccess(id, response.data, next));
-    }).catch(error => {
-      dispatch(expandAccountTimelineFail(id, error));
-    });
-  };
-};
-
-export function expandAccountMediaTimeline(id) {
-  return (dispatch, getState) => {
-    const lastId = getState().getIn(['timelines', 'accounts_media_timelines', id, 'items'], Immutable.List()).last();
-
-    dispatch(expandAccountMediaTimelineRequest(id));
-
-    api(getState).get(`/api/v1/accounts/${id}/statuses`, {
-      params: {
-        limit: 12,
-        only_media: 'true',
-        max_id: lastId,
-      },
-    }).then(response => {
-      const next = getLinks(response).refs.find(link => link.rel === 'next');
-      dispatch(expandAccountMediaTimelineSuccess(id, response.data, next));
-    }).catch(error => {
-      dispatch(expandAccountMediaTimelineFail(id, error));
-    });
-  };
-};
-
 export function fetchAccountRequest(id) {
   return {
     type: ACCOUNT_FETCH_REQUEST,
@@ -281,112 +172,6 @@ export function unfollowAccountFail(error) {
   };
 };
 
-export function fetchAccountTimelineRequest(id, skipLoading) {
-  return {
-    type: ACCOUNT_TIMELINE_FETCH_REQUEST,
-    id,
-    skipLoading,
-  };
-};
-
-export function fetchAccountTimelineSuccess(id, statuses, replace, skipLoading, next) {
-  return {
-    type: ACCOUNT_TIMELINE_FETCH_SUCCESS,
-    id,
-    statuses,
-    replace,
-    skipLoading,
-    next,
-  };
-};
-
-export function fetchAccountTimelineFail(id, error, skipLoading) {
-  return {
-    type: ACCOUNT_TIMELINE_FETCH_FAIL,
-    id,
-    error,
-    skipLoading,
-    skipAlert: error.response.status === 404,
-  };
-};
-
-export function fetchAccountMediaTimelineRequest(id, skipLoading) {
-  return {
-    type: ACCOUNT_MEDIA_TIMELINE_FETCH_REQUEST,
-    id,
-    skipLoading,
-  };
-};
-
-export function fetchAccountMediaTimelineSuccess(id, statuses, replace, skipLoading, next) {
-  return {
-    type: ACCOUNT_MEDIA_TIMELINE_FETCH_SUCCESS,
-    id,
-    statuses,
-    replace,
-    skipLoading,
-    next,
-  };
-};
-
-export function fetchAccountMediaTimelineFail(id, error, skipLoading) {
-  return {
-    type: ACCOUNT_MEDIA_TIMELINE_FETCH_FAIL,
-    id,
-    error,
-    skipLoading,
-    skipAlert: error.response.status === 404,
-  };
-};
-
-export function expandAccountTimelineRequest(id) {
-  return {
-    type: ACCOUNT_TIMELINE_EXPAND_REQUEST,
-    id,
-  };
-};
-
-export function expandAccountTimelineSuccess(id, statuses, next) {
-  return {
-    type: ACCOUNT_TIMELINE_EXPAND_SUCCESS,
-    id,
-    statuses,
-    next,
-  };
-};
-
-export function expandAccountTimelineFail(id, error) {
-  return {
-    type: ACCOUNT_TIMELINE_EXPAND_FAIL,
-    id,
-    error,
-  };
-};
-
-export function expandAccountMediaTimelineRequest(id) {
-  return {
-    type: ACCOUNT_MEDIA_TIMELINE_EXPAND_REQUEST,
-    id,
-  };
-};
-
-export function expandAccountMediaTimelineSuccess(id, statuses, next) {
-  return {
-    type: ACCOUNT_MEDIA_TIMELINE_EXPAND_SUCCESS,
-    id,
-    statuses,
-    next,
-  };
-};
-
-export function expandAccountMediaTimelineFail(id, error) {
-  return {
-    type: ACCOUNT_MEDIA_TIMELINE_EXPAND_FAIL,
-    id,
-    error,
-  };
-};
-
 export function blockAccount(id) {
   return (dispatch, getState) => {
     dispatch(blockAccountRequest(id));