Sfoglia il codice sorgente

mastoapi: fixed reblog identifiers.

This fixes weird behaviour in apps like Tusky, where boosts' content disappear
after clicking on them.
grunfink 1 anno fa
parent
commit
cc0e90fbf7
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      mastoapi.c

+ 6 - 0
mastoapi.c

@@ -1134,9 +1134,15 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg)
             bst = xs_dict_set(bst, "content", "");
             bst = xs_dict_set(bst, "reblog", st);
 
+            /* reblogs must have their own id */
+            xs *b_id = xs_fmt("%s%s", xs_dict_get(st, "id"), boosted_by_md5);
+            bst = xs_dict_set(bst, "id", b_id);
+
             xs_free(st);
             st = bst;
         }
+        else
+            xs_free(bst);
     }
 
     return st;