summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'html.c')
-rw-r--r--html.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/html.c b/html.c
index e8d31a3..175dcdc 100644
--- a/html.c
+++ b/html.c
@@ -9,6 +9,7 @@
9#include "xs_openssl.h" 9#include "xs_openssl.h"
10#include "xs_time.h" 10#include "xs_time.h"
11#include "xs_mime.h" 11#include "xs_mime.h"
12#include "xs_match.h"
12 13
13#include "snac.h" 14#include "snac.h"
14 15
@@ -203,8 +204,7 @@ xs_str *html_msg_icon(xs_str *os, const xs_dict *msg)
203 int priv = 0; 204 int priv = 0;
204 const char *type = xs_dict_get(msg, "type"); 205 const char *type = xs_dict_get(msg, "type");
205 206
206 if (strcmp(type, "Note") == 0 || strcmp(type, "Question") == 0 || 207 if (xs_match(type, "Note|Question|Page|Article"))
207 strcmp(type, "Page") == 0 || strcmp(type, "Article") == 0)
208 url = xs_dict_get(msg, "id"); 208 url = xs_dict_get(msg, "id");
209 209
210 priv = !is_msg_public(msg); 210 priv = !is_msg_public(msg);
@@ -1387,8 +1387,7 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local,
1387 continue; 1387 continue;
1388 1388
1389 /* infer MIME type from non-specific attachments */ 1389 /* infer MIME type from non-specific attachments */
1390 if (xs_list_len(attach) < 2 && 1390 if (xs_list_len(attach) < 2 && xs_match(t, "Link|Document")) {
1391 (strcmp(t, "Link") == 0 || strcmp(t, "Document") == 0)) {
1392 const char *mt = xs_mime_by_ext(url); 1391 const char *mt = xs_mime_by_ext(url);
1393 1392
1394 if (xs_startswith(mt, "image/") || 1393 if (xs_startswith(mt, "image/") ||