diff options
| -rw-r--r-- | html.c | 34 | ||||
| -rw-r--r-- | snac.h | 2 |
2 files changed, 14 insertions, 22 deletions
| @@ -591,31 +591,21 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, int local, int level, int | |||
| 591 | } | 591 | } |
| 592 | } | 592 | } |
| 593 | } | 593 | } |
| 594 | |||
| 595 | #if 0 | ||
| 596 | if (!xs_is_null((p = xs_dict_get(meta, "parent"))) && *p) { | ||
| 597 | /* this may happen if any of the autor or the parent aren't here */ | ||
| 598 | xs *s1 = xs_fmt( | ||
| 599 | "<div class=\"snac-origin\">%s " | ||
| 600 | "<a href=\"%s\">»</a></div>\n", | ||
| 601 | L("in reply to"), p | ||
| 602 | ); | ||
| 603 | |||
| 604 | s = xs_str_cat(s, s1); | ||
| 605 | } | ||
| 606 | else | 594 | else |
| 607 | if (!xs_is_null((p = xs_dict_get(meta, "liked_by"))) && | 595 | if (strcmp(type, "Note") == 0) { |
| 608 | xs_list_in(p, snac->actor) != -1) { | 596 | /* is the parent not here? */ |
| 609 | /* we liked this */ | 597 | char *parent = xs_dict_get(msg, "inReplyTo"); |
| 610 | xs *s1 = xs_fmt( | ||
| 611 | "<div class=\"snac-origin\">" | ||
| 612 | "<a href=\"%s\">%s</a> %s</a></div>", | ||
| 613 | snac->actor, xs_dict_get(snac->config, "name"), L("liked") | ||
| 614 | ); | ||
| 615 | 598 | ||
| 616 | s = xs_str_cat(s, s1); | 599 | if (!xs_is_null(parent) && !object_here(parent)) { |
| 600 | xs *s1 = xs_fmt( | ||
| 601 | "<div class=\"snac-origin\">%s " | ||
| 602 | "<a href=\"%s\">»</a></div>\n", | ||
| 603 | L("in reply to"), parent | ||
| 604 | ); | ||
| 605 | |||
| 606 | s = xs_str_cat(s, s1); | ||
| 607 | } | ||
| 617 | } | 608 | } |
| 618 | #endif | ||
| 619 | } | 609 | } |
| 620 | else | 610 | else |
| 621 | s = xs_str_cat(s, "<div class=\"snac-child\">\n"); | 611 | s = xs_str_cat(s, "<div class=\"snac-child\">\n"); |
| @@ -60,6 +60,7 @@ int index_first(const char *fn, char *buf, int size); | |||
| 60 | d_char *index_list(const char *fn, int max); | 60 | d_char *index_list(const char *fn, int max); |
| 61 | d_char *index_list_desc(const char *fn, int max); | 61 | d_char *index_list_desc(const char *fn, int max); |
| 62 | 62 | ||
| 63 | int object_here_by_md5(char *id); | ||
| 63 | int object_here(char *id); | 64 | int object_here(char *id); |
| 64 | int object_get_by_md5(const char *md5, d_char **obj, const char *type); | 65 | int object_get_by_md5(const char *md5, d_char **obj, const char *type); |
| 65 | int object_get(const char *id, d_char **obj, const char *type); | 66 | int object_get(const char *id, d_char **obj, const char *type); |
| @@ -69,6 +70,7 @@ int object_del_if_unref(const char *id); | |||
| 69 | d_char *object_children(const char *id); | 70 | d_char *object_children(const char *id); |
| 70 | d_char *object_likes(const char *id); | 71 | d_char *object_likes(const char *id); |
| 71 | d_char *object_announces(const char *id); | 72 | d_char *object_announces(const char *id); |
| 73 | int object_parent(const char *id, char *buf, int size); | ||
| 72 | 74 | ||
| 73 | int follower_add(snac *snac, const char *actor); | 75 | int follower_add(snac *snac, const char *actor); |
| 74 | int follower_del(snac *snac, const char *actor); | 76 | int follower_del(snac *snac, const char *actor); |