mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
Don't load unneeded actor info in html_entry().
This commit is contained in:
parent
13ac53b06a
commit
d2095105de
3 changed files with 16 additions and 19 deletions
13
data.c
13
data.c
|
@ -796,16 +796,17 @@ int actor_get(snac *snac, char *actor, d_char **data)
|
||||||
status = 200;
|
status = 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((f = fopen(fn, "r")) != NULL) {
|
if (data) {
|
||||||
xs *j = xs_readall(f);
|
if ((f = fopen(fn, "r")) != NULL) {
|
||||||
|
xs *j = xs_readall(f);
|
||||||
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
if (data)
|
|
||||||
*data = xs_json_loads(j);
|
*data = xs_json_loads(j);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
status = 500;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
status = 500;
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
6
html.c
6
html.c
|
@ -443,7 +443,6 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
|
||||||
char *id = xs_dict_get(msg, "id");
|
char *id = xs_dict_get(msg, "id");
|
||||||
char *type = xs_dict_get(msg, "type");
|
char *type = xs_dict_get(msg, "type");
|
||||||
char *meta = xs_dict_get(msg, "_snac");
|
char *meta = xs_dict_get(msg, "_snac");
|
||||||
xs *actor_o = NULL;
|
|
||||||
char *actor;
|
char *actor;
|
||||||
|
|
||||||
/* do not show non-public messages in the public timeline */
|
/* do not show non-public messages in the public timeline */
|
||||||
|
@ -477,10 +476,7 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
|
||||||
if (is_muted(snac, actor))
|
if (is_muted(snac, actor))
|
||||||
return os;
|
return os;
|
||||||
|
|
||||||
if (strcmp(actor, snac->actor) == 0)
|
if (strcmp(actor, snac->actor) != 0 && !valid_status(actor_get(snac, actor, NULL)))
|
||||||
actor_o = msg_actor(snac);
|
|
||||||
else
|
|
||||||
if (!valid_status(actor_get(snac, actor, &actor_o)))
|
|
||||||
return os;
|
return os;
|
||||||
|
|
||||||
/* if this is our post, add the score */
|
/* if this is our post, add the score */
|
||||||
|
|
16
httpd.c
16
httpd.c
|
@ -98,14 +98,14 @@ void httpd_connection(FILE *f)
|
||||||
{
|
{
|
||||||
xs *req;
|
xs *req;
|
||||||
char *method;
|
char *method;
|
||||||
int status = 0;
|
int status = 0;
|
||||||
char *body = NULL;
|
d_char *body = NULL;
|
||||||
int b_size = 0;
|
int b_size = 0;
|
||||||
char *ctype = NULL;
|
char *ctype = NULL;
|
||||||
xs *headers = NULL;
|
xs *headers = NULL;
|
||||||
xs *q_path = NULL;
|
xs *q_path = NULL;
|
||||||
xs *payload = NULL;
|
xs *payload = NULL;
|
||||||
int p_size = 0;
|
int p_size = 0;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
req = xs_httpd_request(f, &payload, &p_size);
|
req = xs_httpd_request(f, &payload, &p_size);
|
||||||
|
|
Loading…
Reference in a new issue