mirror of https://codeberg.org/grunfink/snac2.git
Compare commits
7 Commits
1a9bb5fd07
...
ad4199de75
Author | SHA1 | Date |
---|---|---|
default | ad4199de75 | |
grunfink | b150bfe5ca | |
louis | cf5718bf4d | |
default | dba0630660 | |
default | a7bd9b63e4 | |
default | e362dfc356 | |
default | 46f2e324d8 |
|
@ -1941,6 +1941,8 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
|
|||
}
|
||||
else
|
||||
if (strcmp(type, "Undo") == 0) { /** **/
|
||||
char *id = xs_dict_get(object, "object");
|
||||
|
||||
if (xs_type(object) != XSTYPE_DICT)
|
||||
utype = "Follow";
|
||||
|
||||
|
@ -1952,6 +1954,23 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
|
|||
else
|
||||
snac_log(snac, xs_fmt("error deleting follower %s", actor));
|
||||
}
|
||||
else
|
||||
if (strcmp(utype, "Like") == 0) { /** **/
|
||||
int status = object_unadmire(id, actor, 1);
|
||||
|
||||
snac_log(snac, xs_fmt("Unlike for %s %d", id, status));
|
||||
}
|
||||
else
|
||||
if (strcmp(utype, "Announce") == 0) { /** **/
|
||||
int status = 200;
|
||||
|
||||
/* commented out: if a followed user boosts something that
|
||||
is requested and then unboosts, the post remains here,
|
||||
but with no apparent reason, and that is confusing */
|
||||
//status = object_unadmire(id, actor, 0);
|
||||
|
||||
snac_log(snac, xs_fmt("Unboost for %s %d", id, status));
|
||||
}
|
||||
else
|
||||
snac_debug(snac, 1, xs_fmt("ignored 'Undo' for object type '%s'", utype));
|
||||
}
|
||||
|
|
15
data.c
15
data.c
|
@ -406,7 +406,7 @@ int index_del_md5(const char *fn, const char *md5)
|
|||
fclose(f);
|
||||
}
|
||||
else
|
||||
status = 500;
|
||||
status = 410;
|
||||
|
||||
pthread_mutex_unlock(&data_mutex);
|
||||
|
||||
|
@ -917,6 +917,9 @@ int object_unadmire(const char *id, const char *actor, int like)
|
|||
|
||||
status = index_del(fn, actor);
|
||||
|
||||
if (valid_status(status))
|
||||
index_gc(fn);
|
||||
|
||||
srv_debug(0,
|
||||
xs_fmt("object_unadmire (%s) %s %s %d", like ? "Like" : "Announce", actor, fn, status));
|
||||
|
||||
|
@ -2743,6 +2746,16 @@ void purge_server(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* delete index backups */
|
||||
xs *specb = xs_fmt("%s/" "*.bak", v);
|
||||
xs *bakfs = xs_glob(specb, 0, 0);
|
||||
|
||||
p2 = bakfs;
|
||||
while (xs_list_iter(&p2, &v2)) {
|
||||
unlink(v2);
|
||||
srv_debug(1, xs_fmt("purged %s", v2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue