Always set the referrer if it's the user.

This commit is contained in:
default 2022-10-31 11:56:20 +01:00
parent 81d8923768
commit 4272f58e3f

5
data.c
View file

@ -600,8 +600,9 @@ void timeline_admire(snac *snac, char *id, char *admirer, int like)
if (xs_list_in(list, admirer) == -1) if (xs_list_in(list, admirer) == -1)
list = xs_list_append(list, admirer); list = xs_list_append(list, admirer);
/* set the admirer as the referrer (if not already set) */ /* set the admirer as the referrer (if not already set or it's us) */
if (!like && xs_is_null(xs_dict_get(meta, "referrer"))) if (!like && (xs_is_null(xs_dict_get(meta, "referrer")) ||
strcmp(admirer, snac->actor) == 0))
meta = xs_dict_set(meta, "referrer", admirer); meta = xs_dict_set(meta, "referrer", admirer);
/* re-store */ /* re-store */