diff options
| -rw-r--r-- | data.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1506,11 +1506,9 @@ int limited(snac *user, const char *id, int cmd) | |||
| 1506 | /* announce messages from a followed (0: check, 1: limit; 2: unlimit) */ | 1506 | /* announce messages from a followed (0: check, 1: limit; 2: unlimit) */ |
| 1507 | { | 1507 | { |
| 1508 | int ret = 0; | 1508 | int ret = 0; |
| 1509 | xs *fn = xs_fmt("%s/limited/", user->basedir); | 1509 | xs *dir = xs_fmt("%s/limited", user->basedir); |
| 1510 | mkdirx(fn); | ||
| 1511 | |||
| 1512 | xs *md5 = xs_md5_hex(id, strlen(id)); | 1510 | xs *md5 = xs_md5_hex(id, strlen(id)); |
| 1513 | fn = xs_str_cat(fn, md5); | 1511 | xs *fn = xs_fmt("%s/%s", dir, md5); |
| 1514 | 1512 | ||
| 1515 | switch (cmd) { | 1513 | switch (cmd) { |
| 1516 | case 0: /** check **/ | 1514 | case 0: /** check **/ |
| @@ -1518,6 +1516,8 @@ int limited(snac *user, const char *id, int cmd) | |||
| 1518 | break; | 1516 | break; |
| 1519 | 1517 | ||
| 1520 | case 1: /** limit **/ | 1518 | case 1: /** limit **/ |
| 1519 | mkdirx(dir); | ||
| 1520 | |||
| 1521 | if (mtime(fn) > 0.0) | 1521 | if (mtime(fn) > 0.0) |
| 1522 | ret = -1; | 1522 | ret = -1; |
| 1523 | else { | 1523 | else { |