]> cat aescling's git repositories - mastodon.git/commitdiff
Support proper content-type in Delete & Redraft
authorThibaut Girka <thib@sitedethib.com>
Sun, 12 May 2019 18:35:58 +0000 (20:35 +0200)
committerThibG <thib@sitedethib.com>
Fri, 17 May 2019 21:51:14 +0000 (23:51 +0200)
app/javascript/flavours/glitch/actions/statuses.js
app/javascript/flavours/glitch/reducers/compose.js

index 550fe510fc3a76c185383f6ba137b60c550129ae..7e22a7f988ccb8204b52550e122cb43c5b61e8e6 100644 (file)
@@ -71,11 +71,12 @@ export function fetchStatusFail(id, error, skipLoading) {
   };
 };
 
-export function redraft(status, raw_text) {
+export function redraft(status, raw_text, content_type) {
   return {
     type: REDRAFT,
     status,
     raw_text,
+    content_type,
   };
 };
 
@@ -94,7 +95,7 @@ export function deleteStatus(id, router, withRedraft = false) {
       dispatch(deleteFromTimelines(id));
 
       if (withRedraft) {
-        dispatch(redraft(status, response.data.text));
+        dispatch(redraft(status, response.data.text, response.data.content_type));
 
         if (!getState().getIn(['compose', 'mounted'])) {
           router.push('/statuses/new');
index 516da859aa1481e4c69ec43506c00577e3b669ab..82facb1e2ece7cdba9ccb79be0e9bea6df19d87c 100644 (file)
@@ -433,6 +433,7 @@ export default function compose(state = initialState, action) {
   case REDRAFT:
     return state.withMutations(map => {
       map.set('text', action.raw_text || unescapeHTML(expandMentions(action.status)));
+      map.set('content_type', action.content_type || 'text/plain');
       map.set('in_reply_to', action.status.get('in_reply_to_id'));
       map.set('privacy', action.status.get('visibility'));
       map.set('media_attachments', action.status.get('media_attachments'));