mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
Process 'Undo' + 'Follow'.
This commit is contained in:
parent
484a7f1fd8
commit
c38cc09e4c
2 changed files with 14 additions and 4 deletions
|
@ -591,11 +591,17 @@ void process_message(snac *snac, char *msg, char *req)
|
||||||
snac_log(snac, xs_fmt("New follower %s", actor));
|
snac_log(snac, xs_fmt("New follower %s", actor));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/*
|
|
||||||
if (strcmp(type, "Undo") == 0) {
|
if (strcmp(type, "Undo") == 0) {
|
||||||
|
if (strcmp(utype, "Follow") == 0) {
|
||||||
|
if (valid_status(follower_del(snac, actor)))
|
||||||
|
snac_log(snac, xs_fmt("no longer following us %s", actor));
|
||||||
|
else
|
||||||
|
snac_log(snac, xs_fmt("error deleting follower %s", actor));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
snac_debug(snac, 1, xs_fmt("ignored 'Undo' for object type '%s'", utype));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*/
|
|
||||||
if (strcmp(type, "Create") == 0) {
|
if (strcmp(type, "Create") == 0) {
|
||||||
if (strcmp(utype, "Note") == 0) {
|
if (strcmp(utype, "Note") == 0) {
|
||||||
if (is_muted(snac, actor))
|
if (is_muted(snac, actor))
|
||||||
|
|
8
data.c
8
data.c
|
@ -217,13 +217,17 @@ int follower_add(snac *snac, char *actor, char *msg)
|
||||||
int follower_del(snac *snac, char *actor)
|
int follower_del(snac *snac, char *actor)
|
||||||
/* deletes a follower */
|
/* deletes a follower */
|
||||||
{
|
{
|
||||||
|
int status = 200;
|
||||||
xs *fn = _follower_fn(snac, actor);
|
xs *fn = _follower_fn(snac, actor);
|
||||||
|
|
||||||
unlink(fn);
|
if (fn != NULL)
|
||||||
|
unlink(fn);
|
||||||
|
else
|
||||||
|
status = 404;
|
||||||
|
|
||||||
snac_debug(snac, 2, xs_fmt("follower_del %s %s", actor, fn));
|
snac_debug(snac, 2, xs_fmt("follower_del %s %s", actor, fn));
|
||||||
|
|
||||||
return 200;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue