mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 05:15:04 +00:00
Also reject Like messages in is_msg_for_me().
This commit is contained in:
parent
1dd88aa6f6
commit
cf2cfca624
1 changed files with 5 additions and 1 deletions
|
@ -383,12 +383,16 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
|
|||
{
|
||||
const char *type = xs_dict_get(c_msg, "type");
|
||||
|
||||
if (strcmp(type, "Announce") == 0) {
|
||||
if (strcmp(type, "Like") == 0 || strcmp(type, "Announce") == 0) {
|
||||
const char *object = xs_dict_get(c_msg, "object");
|
||||
|
||||
if (xs_type(object) == XSTYPE_DICT)
|
||||
object = xs_dict_get(object, "id");
|
||||
|
||||
/* bad object id? reject */
|
||||
if (xs_type(object) != XSTYPE_STRING)
|
||||
return 0;
|
||||
|
||||
/* if it's about one of our posts, accept it */
|
||||
if (xs_startswith(object, snac->actor))
|
||||
return 2;
|
||||
|
|
Loading…
Reference in a new issue