mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
Only create the limited/ folder in calling limit().
This commit is contained in:
parent
bf79c8c370
commit
a3f1387daa
1 changed files with 4 additions and 4 deletions
8
data.c
8
data.c
|
@ -1506,11 +1506,9 @@ int limited(snac *user, const char *id, int cmd)
|
|||
/* announce messages from a followed (0: check, 1: limit; 2: unlimit) */
|
||||
{
|
||||
int ret = 0;
|
||||
xs *fn = xs_fmt("%s/limited/", user->basedir);
|
||||
mkdirx(fn);
|
||||
|
||||
xs *dir = xs_fmt("%s/limited", user->basedir);
|
||||
xs *md5 = xs_md5_hex(id, strlen(id));
|
||||
fn = xs_str_cat(fn, md5);
|
||||
xs *fn = xs_fmt("%s/%s", dir, md5);
|
||||
|
||||
switch (cmd) {
|
||||
case 0: /** check **/
|
||||
|
@ -1518,6 +1516,8 @@ int limited(snac *user, const char *id, int cmd)
|
|||
break;
|
||||
|
||||
case 1: /** limit **/
|
||||
mkdirx(dir);
|
||||
|
||||
if (mtime(fn) > 0.0)
|
||||
ret = -1;
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue