- Timestamp:
- 2018-07-31T06:12:25Z (6 years ago)
- Branches:
- master
- Children:
- 3b0c1c3
- Parents:
- c82e4ca
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter_lib.c
rc82e4ca r921ea8b 704 704 static void expand_entities(char **text, const json_value *node, const json_value *extended_node) 705 705 { 706 json_value *entities, *extended_entities, *quoted; 707 char *quote_url = NULL, *quote_text = NULL; 706 json_value *entities, *extended_entities, *quoted, *quoted_permalink; 707 char *quote_url = NULL, *quote_text = NULL, *quote_kort = NULL; 708 gboolean quote_used = FALSE; 708 709 709 710 if (!((entities = json_o_get(node, "entities")) && entities->type == json_object)) … … 716 717 quote_text = g_strdup_printf("@%s: %s", txs->user->screen_name, txs->text); 717 718 quote_url = g_strdup_printf("%s/status/%" G_GUINT64_FORMAT, txs->user->screen_name, txs->id); 719 if ((quoted_permalink = json_o_get(node, "quoted_status_permalink")) && quoted->type == json_object) { 720 quote_kort = json_o_strdup(quoted_permalink, "url"); 721 } 718 722 txs_free(txs); 719 723 } else { … … 759 763 format = "%s<%s> [%s]%s"; 760 764 disp = quote_text; 765 quote_used = TRUE; 761 766 } 762 767 … … 769 774 } 770 775 } 776 777 if (quote_text && !quote_used) { 778 const char *url = quote_kort ?: quote_url; 779 char *new = g_strdup_printf("%s <%s>[%s]", *text, url, quote_text); 780 g_free(*text); 781 *text = new; 782 } 783 771 784 g_free(quote_text); 772 785 g_free(quote_url); 786 g_free(quote_kort); 773 787 } 774 788
Note: See TracChangeset
for help on using the changeset viewer.