mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 05:15:04 +00:00
New function default_avatar_base64().
This commit is contained in:
parent
0607ebc201
commit
a3ed2408fc
4 changed files with 20 additions and 13 deletions
|
@ -17,6 +17,22 @@
|
||||||
|
|
||||||
const char *public_address = "https:/" "/www.w3.org/ns/activitystreams#Public";
|
const char *public_address = "https:/" "/www.w3.org/ns/activitystreams#Public";
|
||||||
|
|
||||||
|
/* susie.png */
|
||||||
|
const char *susie =
|
||||||
|
"iVBORw0KGgoAAAANSUhEUgAAAEAAAABAAQAAAAC"
|
||||||
|
"CEkxzAAAAUUlEQVQoz43R0QkAMQwCUDdw/y3dwE"
|
||||||
|
"vsvzlL4X1IoQkAisKmwfAFT3RgJHbQezpSRoXEq"
|
||||||
|
"eqCL9BJBf7h3QbOCCxV5EVWMEMwG7K1/WODtlvx"
|
||||||
|
"AYTtEsDU9F34AAAAAElFTkSuQmCC";
|
||||||
|
|
||||||
|
|
||||||
|
const char *default_avatar_base64(void)
|
||||||
|
/* returns the default avatar in base64 */
|
||||||
|
{
|
||||||
|
return susie;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int activitypub_request(snac *snac, char *url, d_char **data)
|
int activitypub_request(snac *snac, char *url, d_char **data)
|
||||||
/* request an object */
|
/* request an object */
|
||||||
{
|
{
|
||||||
|
|
3
html.c
3
html.c
|
@ -82,7 +82,7 @@ d_char *html_actor_icon(snac *snac, d_char *os, char *actor,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avatar == NULL)
|
if (avatar == NULL)
|
||||||
avatar = xs_fmt("data:image/png;base64, %s", susie);
|
avatar = xs_fmt("data:image/png;base64, %s", default_avatar_base64());
|
||||||
|
|
||||||
{
|
{
|
||||||
xs *s1 = xs_fmt("<p><img class=\"snac-avatar\" src=\"%s\" alt=\"\" "
|
xs *s1 = xs_fmt("<p><img class=\"snac-avatar\" src=\"%s\" alt=\"\" "
|
||||||
|
@ -558,7 +558,6 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, int local, int level, cons
|
||||||
char *actor;
|
char *actor;
|
||||||
int sensitive = 0;
|
int sensitive = 0;
|
||||||
char *v;
|
char *v;
|
||||||
xs *likes = NULL;
|
|
||||||
xs *boosts = NULL;
|
xs *boosts = NULL;
|
||||||
|
|
||||||
/* do not show non-public messages in the public timeline */
|
/* do not show non-public messages in the public timeline */
|
||||||
|
|
10
httpd.c
10
httpd.c
|
@ -14,14 +14,6 @@
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
/* susie.png */
|
|
||||||
const char *susie =
|
|
||||||
"iVBORw0KGgoAAAANSUhEUgAAAEAAAABAAQAAAAC"
|
|
||||||
"CEkxzAAAAUUlEQVQoz43R0QkAMQwCUDdw/y3dwE"
|
|
||||||
"vsvzlL4X1IoQkAisKmwfAFT3RgJHbQezpSRoXEq"
|
|
||||||
"eqCL9BJBf7h3QbOCCxV5EVWMEMwG7K1/WODtlvx"
|
|
||||||
"AYTtEsDU9F34AAAAAElFTkSuQmCC";
|
|
||||||
|
|
||||||
|
|
||||||
/* nodeinfo 2.0 template */
|
/* nodeinfo 2.0 template */
|
||||||
const char *nodeinfo_2_0_template = ""
|
const char *nodeinfo_2_0_template = ""
|
||||||
|
@ -99,7 +91,7 @@ int server_get_handler(d_char *req, char *q_path,
|
||||||
else
|
else
|
||||||
if (strcmp(q_path, "/susie.png") == 0 || strcmp(q_path, "/favicon.ico") == 0 ) {
|
if (strcmp(q_path, "/susie.png") == 0 || strcmp(q_path, "/favicon.ico") == 0 ) {
|
||||||
status = 200;
|
status = 200;
|
||||||
*body = xs_base64_dec(susie, b_size);
|
*body = xs_base64_dec(default_avatar_base64(), b_size);
|
||||||
*ctype = "image/png";
|
*ctype = "image/png";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
4
snac.h
4
snac.h
|
@ -13,8 +13,6 @@ extern int srv_running;
|
||||||
|
|
||||||
extern int dbglevel;
|
extern int dbglevel;
|
||||||
|
|
||||||
extern const char *susie;
|
|
||||||
|
|
||||||
#define L(s) (s)
|
#define L(s) (s)
|
||||||
|
|
||||||
int valid_status(int status);
|
int valid_status(int status);
|
||||||
|
@ -148,6 +146,8 @@ int webfinger_request(char *qs, char **actor, char **user);
|
||||||
int webfinger_get_handler(d_char *req, char *q_path,
|
int webfinger_get_handler(d_char *req, char *q_path,
|
||||||
char **body, int *b_size, char **ctype);
|
char **body, int *b_size, char **ctype);
|
||||||
|
|
||||||
|
const char *default_avatar_base64(void);
|
||||||
|
|
||||||
d_char *msg_admiration(snac *snac, char *object, char *type);
|
d_char *msg_admiration(snac *snac, char *object, char *type);
|
||||||
d_char *msg_create(snac *snac, char *object);
|
d_char *msg_create(snac *snac, char *object);
|
||||||
d_char *msg_follow(snac *snac, char *actor);
|
d_char *msg_follow(snac *snac, char *actor);
|
||||||
|
|
Loading…
Reference in a new issue