Commit graph

458 commits

Author SHA1 Message Date
default
2bed69d00b Use the _a.json extension for actor object links into following/. 2023-06-15 04:29:26 +02:00
default
297b82c9c6 following_list() creates links to the actors if they don't exist. 2023-06-15 04:19:09 +02:00
default
e97092cf0c Maintain a link to the author object in the following/ subdirectory. 2023-06-15 04:11:39 +02:00
default
1307b6203c Use utimes() to 'touch' the actor file in actor_get(). 2023-06-14 20:59:00 +02:00
default
b77ef13d2c Don't enqueue a request_replies message if it's already there. 2023-06-07 13:09:19 +02:00
default
ecde1c219e New function enqueue_request_replies().
This way, the (potentially expensive and slow) call to
timeline_request_replies() is detached from actions like
replying a message from the web ui.
2023-06-07 12:04:59 +02:00
default
125317ac47 Some prototype update. 2023-06-07 11:08:14 +02:00
default
3b72b0f0ac New function was_question_voted(). 2023-05-31 22:06:31 +02:00
default
7659362448 Enqueue a close_question user q_item. 2023-05-29 11:07:38 +02:00
default
654e171b93 New macro ISO_DATE_SPEC. 2023-05-29 09:07:27 +02:00
default
5d8e370ec3 More prototype tunnings. 2023-05-24 13:05:43 +02:00
default
e6eb1adc65 Also find local users in /api/v1/search. 2023-05-15 13:04:30 +02:00
default
e9588a71ae Add /v1/account/search support. 2023-05-15 11:15:28 +02:00
default
e2e7bc2d71 Added a source (web, mastoapi, etc) to lastlog_write(). 2023-05-08 09:02:45 +02:00
default
753eadfd17 Added some const here and there. 2023-05-04 09:25:09 +02:00
default
511f5062b7 Deleted real unused parameters. 2023-05-04 09:19:26 +02:00
default
cf2b334d86 Ensure no actor data is left in actor_get(). 2023-05-03 08:15:38 +02:00
default
4595a36859 Partial support for mastoapi unfavourite / unreblog. 2023-05-01 17:20:49 +02:00
default
c21bbd5f7c New functions index_del_md5(), index_del() and object_unadmire(). 2023-05-01 17:02:44 +02:00
default
84902d8dcc Purge / gc the instance timeline index. 2023-05-01 08:32:48 +02:00
default
21a2a01937 Return immediately from actor_get() if it's a local user. 2023-04-30 07:37:39 +02:00
default
e31c4810a8 actor_get() returns an actor message for local users. 2023-04-30 06:49:51 +02:00
default
ede4d6f2dc Some instance timeline work. 2023-04-30 06:39:55 +02:00
default
049818a904 Public posts are also added to an instance public timeline index. 2023-04-29 07:36:18 +02:00
default
765f63772f New function mastoapi_purge() (still dummy). 2023-04-28 08:33:02 +02:00
default
043cd5c50b Fixed warning. 2023-04-23 08:59:14 +02:00
default
4fca7c8a7e Added mastoapi unfollow. 2023-04-23 08:51:02 +02:00
default
291f251ced Added mastoapi follow. 2023-04-23 08:44:26 +02:00
default
88850bdc46 Attend mastoapi relationships.
Now, the follow/unfollow buttons appear on each account's page.
2023-04-23 06:05:35 +02:00
default
2b80873a28 History functions fail on ids with /. 2023-04-22 08:02:23 +02:00
default
51bee249d4 Fail on static data ids with / in them. 2023-04-22 07:58:31 +02:00
default
66d5acc822 Use static_get_meta() when preparing the attachment. 2023-04-22 00:51:06 +02:00
default
8c4850df50 New functions to get and set metadata into static files. 2023-04-22 00:24:15 +02:00
default
8205159f8c Replaced strcpy() with strncpy().
To shut up some compiler whining.
2023-04-16 20:12:44 +02:00
default
0240c871f3 New function user_open_by_md5(). 2023-04-16 07:43:41 +02:00
default
9e7a77c10f New mastoapi to clear all notifications. 2023-04-14 19:39:31 +02:00
default
bd21d144de New function timeline_touch(). 2023-04-14 19:17:16 +02:00
default
995fd81e48 notify_list() returns the notifications in reverse order. 2023-04-14 09:34:01 +02:00
default
35c611b8b9 Fixed crash in notification list. 2023-04-14 08:37:33 +02:00
default
c66cd2edb5 Fixed crash in notify_get(). 2023-04-13 18:34:14 +02:00
default
51208b10c1 Implemented mastoapi notifications. 2023-04-13 17:56:00 +02:00
default
1a27e67ed9 New functions notify_get() and notify_list(). 2023-04-13 17:34:48 +02:00
default
211bedd497 New function notify_check_time(). 2023-04-13 17:12:07 +02:00
default
bcde97c2d5 New function notify_add(). 2023-04-13 16:59:17 +02:00
default
e47cb4f9e1 f_ctime() returns the oldest of ctime and mtime. 2023-04-13 09:46:05 +02:00
default
885031bed9 Don't generate invalid JSON if an attachment has no description. 2023-04-12 10:41:15 +02:00
default
5046531d43 New functions object_ctime() and object_ctime_by_md5(). 2023-04-12 09:46:42 +02:00
default
93008cfc3e New function f_ctime(). 2023-04-12 09:43:23 +02:00
default
74817a4552 Updated RELEASE_NOTES. 2023-04-06 00:03:06 +02:00
default
1fe34ffb4a New function lastlog_write(). 2023-04-05 23:46:51 +02:00
default
ec31697b8d Collected addresses are also purged. 2023-03-07 14:33:15 +01:00
default
a2d36aa5f2 Renamed _purge_subdir() to _purge_user_subdir(). 2023-03-07 14:10:13 +01:00
default
b2ce9323db Added the url to srv_archive(). 2023-03-02 17:13:17 +01:00
default
5036cb5e11 Connection jobs are treated as urgent. 2023-03-02 12:38:02 +01:00
default
29b12498dd Simplified is_msg_public(). 2023-03-02 09:15:40 +01:00
default
e74ae0f589 Renamed inboxes/ to inbox/. 2023-03-02 09:01:08 +01:00
default
5e3c50d6e1 New inbox collection functions. 2023-03-02 08:43:50 +01:00
default
d75a22adab New function srv_archive_error(). 2023-03-01 08:25:36 +01:00
default
105683d4d2 Moved srv_archive() to data.c. 2023-03-01 08:09:56 +01:00
default
e4b6054313 Changed debug level for purge log messages. 2023-02-25 18:37:19 +01:00
default
3a9ea8aa1c Also purge stray index files. 2023-02-24 10:07:00 +01:00
default
1630519066 Deleted index_del_md5() and index_del(). 2023-02-23 18:43:52 +01:00
default
285dbe1a5e Call index_gc() on the user indexes. 2023-02-23 18:42:38 +01:00
default
307c9420c3 New function index_gc(). 2023-02-23 10:42:09 +01:00
default
4eec215729 Serialize some data writes. 2023-02-23 09:32:47 +01:00
default
5a5835b4fa Deleted the index_lock() nonsense. 2023-02-22 21:52:24 +01:00
default
0f328d079c New function index_unlock(). 2023-02-22 19:15:22 +01:00
default
450863031b Added index locks a bit stronger. 2023-02-22 19:09:05 +01:00
default
23c433ee02 Added a warning. 2023-02-22 18:15:48 +01:00
default
d817264e52 Added a user config override for 'purge_days'. 2023-02-12 09:26:44 +01:00
default
0f4db7cf26 New file ~user/user_o.json, for the admin to override user settings. 2023-02-12 09:17:38 +01:00
default
2c45b655c3 Added 'fattr' to the pledge() list. 2023-02-11 06:43:43 +01:00
default
28d1da0a81 Don't fail silently if the job fifo is not ready. 2023-02-11 06:28:36 +01:00
default
03325d04a5 Show the fd rlimit at httpd startup. 2023-02-10 13:39:17 +01:00
default
2ed2914fa3 Print errno in user file opening errors. 2023-02-08 15:03:35 +01:00
default
b64d0f338d New function timeline_here(). 2023-02-08 13:28:03 +01:00
default
3fcc139d66 timeline_top_level() now looks for the entries in the user caches. 2023-02-08 13:21:44 +01:00
default
b8cd0d6363 New function timeline_fn_by_md5(). 2023-02-08 13:06:49 +01:00
default
4cca157641 Output messages are now processed by the pool of threads. 2023-02-07 13:31:48 +01:00
default
67f2d4318d New utility function mkdirx(). 2023-02-07 09:25:01 +01:00
default
fabe6a5006 Tweaked user and group permissions for new files and dirs. 2023-02-07 09:01:57 +01:00
default
2db57c9df9 Added internals for Telegram notifications. 2023-02-07 07:37:23 +01:00
default
70c73d0336 New user option 'purge_days'. 2023-02-05 19:09:22 +01:00
default
143c73500b Reworked purge_user() to be clearer. 2023-02-05 18:13:46 +01:00
default
9cb6216417 timeline_get_by_md5() reads from the user cachedirs instead of the global object.
This way, user defined purging will be easier to implement.
2023-02-05 17:56:59 +01:00
default
71a7569467 Deleted the type argument from object_get_my_md5() and object_get().
It was never used.
2023-02-05 17:45:00 +01:00
default
bad9f3a8c6 Renamed timeline_get() to timeline_get_by_md5(), as that is what id does. 2023-02-05 17:39:40 +01:00
default
12aedfadfd New function timeline_get(). 2023-02-05 13:35:50 +01:00
default
d49089898f Elevated debug level to bad user / invalid user messages. 2023-02-03 16:51:59 +01:00
default
928f22fbba Email notifications have been moved to the global queue. 2023-02-02 05:21:16 +01:00
default
c639553836 New function queue() (the global queue). 2023-02-02 05:07:20 +01:00
default
106c94ef86 queue() renamed to user_queue(). 2023-02-02 04:47:59 +01:00
default
ee77e45abb dequeue() does not need a snac argument. 2023-02-02 04:44:30 +01:00
default
56c4711caf enqueue_output() adds the keyid and seckey args to the q_item. 2023-02-02 04:23:56 +01:00
default
f0ef1d4115 Reworked enqueue_message(). 2023-01-31 21:54:50 +01:00
default
274ae3d142 Reworked enqueue_email(). 2023-01-31 21:49:43 +01:00
default
4e62b409af Reworked enqueue_output(). 2023-01-31 21:15:16 +01:00
default
0233d73248 Started rewriting the queue. 2023-01-31 21:03:59 +01:00
default
94c4790bd7 Unified queue message field names. 2023-01-31 20:22:36 +01:00
default
74d30a561c Some symbol renaming. 2023-01-31 18:33:45 +01:00
default
2d7074aeb0 Deleted old paths to purge. 2023-01-31 18:28:52 +01:00
default
a38c7aeadc Updated year in copyright notices. 2023-01-17 09:50:16 +01:00
default
6406877af1 Usage of unveil() and pledge() can be disabled from config. 2023-01-13 14:18:23 +01:00
Andrew Alderwick
3cb1725225 Added OpenBSD's unveil() and pledge() support. 2023-01-13 13:25:14 +01:00
default
bb0d8f2a27 Backport from xs. 2023-01-12 09:28:02 +01:00
default
40b3f739d2 Deleted unused argument in timeline_admire(). 2023-01-11 20:47:36 +01:00
default
75f8554e38 Deleted unused arguments in timeline_add(). 2023-01-11 20:40:13 +01:00
default
47e6e47323 The purge ttl for stray global objects have been shortened. 2023-01-04 09:41:02 +01:00
default
bc7a6c2708 Log write errors in _object_add() more prominently. 2022-12-18 17:51:23 +01:00
default
25acaf178c Replaced all calls to post() with enqueue_message(). 2022-12-16 07:16:00 +01:00
default
427f7341fa New function enqueue_message(). 2022-12-16 07:09:25 +01:00
default
a0459df6ea Don't create a parent index if it already exists. 2022-12-15 10:52:09 +01:00
default
746624144c Fixed a deletion error. 2022-12-14 05:36:30 +01:00
default
6056077031 Fixed crash when unfollowing. 2022-12-13 16:02:41 +01:00
default
83a68d635d New function index_len(). 2022-12-10 11:19:26 +01:00
grunfink
060a9fcb3c Merge pull request 'Pagination of the private and public page' (#13) from kensanata/snac2:pagination into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/13
2022-12-07 08:33:09 +00:00
default
4726de661b Fixed memory leak. 2022-12-06 19:28:29 +01:00
Alex Schroeder
a221237637 Pagination of the public and private page
Use the query parameters skip and show to control what you can see,
e.g. /alex/admin?skip=0&show=4

Don't use or save the timeline cache if either is set.

The following functions were changed from accepting a single max
parameter to accepting both skip and show:
timeline_simple_list, timeline_list, index_list_desc.
2022-12-06 18:27:33 +01:00
default
7787a2ded9 New function new_password(). 2022-12-04 21:14:18 +01:00
Alex Schroeder
5b1d2bebe9 Fix arguments in callto xs_fmt
Without this, db_upgrade segfaults.
2022-12-04 10:23:48 +01:00
default
d023807942 Set default debug level to 1 for most object db functions. 2022-12-04 06:40:17 +01:00
default
002bec4def In _object_user_cache(), don't call index_add() if link() fails.
It will most probably fail because the object is already there.
2022-12-03 21:59:19 +01:00
default
85d0f40e65 From timeline_admire(), add to both caches. 2022-12-03 21:34:10 +01:00
default
3929778ea1 Don't store messages in public/ that are not public.
They weren't shown anyway, but it's better to be sure.
2022-12-03 20:28:23 +01:00
default
30e1a8ce08 Add this user admires to the public timeline. 2022-12-03 19:37:52 +01:00
default
67a81a7bf9 Upgrade timeline/ to private/. 2022-12-03 18:41:44 +01:00
default
d00026ac06 Upgraded local/ to public/. 2022-12-03 17:58:49 +01:00
default
af6d31ff83 New function timeline_simple_list(). 2022-12-03 07:27:26 +01:00
default
adfc9217d7 Use xs_set_result() in timeline_top_level(). 2022-12-02 21:24:17 +01:00
default
0c525335ee New function object_here_by_md5(). 2022-12-02 21:19:46 +01:00
default
908e068e36 New function object_parent(). 2022-12-02 21:16:34 +01:00
default
a133427e8d More old code cleaning. 2022-12-02 20:56:51 +01:00
default
3e2891b100 Renamed timeline_here() to object_here(). 2022-12-02 20:44:51 +01:00
default
4819c4248d More old code deletions. 2022-12-02 20:39:31 +01:00
default
67d57252ea The old timeline is no longer maintained. 2022-12-02 20:28:27 +01:00
default
c00e3afcdc Big data storage change. 2022-12-02 19:14:59 +01:00
default
5309a68e95 Fixed status codes for follower_add() and follower_del(). 2022-11-28 11:24:19 +01:00
default
3c7cccba3d Changed following_list() to return a list of actors. 2022-11-28 11:06:46 +01:00
default
07fec71273 Upgraded followers to the new db. 2022-11-28 10:46:42 +01:00
default
9c136dacdf New function object_user_cache_in(). 2022-11-28 08:34:19 +01:00
default
9a0a03dd9f New function object_del_if_unref(). 2022-11-27 09:45:06 +01:00
default
e8c487add7 Added some tweaks to file locking. 2022-11-26 19:19:52 +01:00
default
2ad703e520 timeline_top_level() works. 2022-11-26 18:52:51 +01:00
default
159a591f45 New function timeline_top_level() (untested). 2022-11-26 18:04:05 +01:00
default
4f261ec7b9 New function index_first(). 2022-11-26 17:35:18 +01:00
default
d03b988c99 Don't call object_del() from timeline_del().
Only delete from each user's cache, not from the global database.
2022-11-26 13:34:43 +01:00
default
8e7efad27f Only call the expensive index_del() if unlink() did not fail. 2022-11-26 06:20:41 +01:00
default
14dd5b64c9 Added comment. 2022-11-26 06:11:37 +01:00
default
8e83821eee _object_user_cache() also update the indexes. 2022-11-26 05:58:13 +01:00
default
d00a01f32e New function object_user_cache_del(). 2022-11-26 05:51:48 +01:00
default
f403d6f8d3 Renamed object_user_cache() to object_user_cache_add(). 2022-11-26 05:46:21 +01:00
default
405bf6b8e4 Maintain a one-element index with each entry's parent. 2022-11-26 05:29:09 +01:00
default
1243e26a0d New function object_add_ow(). 2022-11-26 05:18:48 +01:00
default
ad202c5ccb Avoid calling time() so many times. 2022-11-26 05:08:56 +01:00
default
afb970a757 purge_server() deletes using object_del(). 2022-11-26 05:05:57 +01:00
default
9867f321b5 Delete redundant call to timeline_update_indexes(). 2022-11-25 21:26:48 +01:00
default
2c34ec8d6c New function timeline_update_indexes(). 2022-11-25 21:21:59 +01:00
default
c0e3193529 New function object_user_cache(). 2022-11-25 17:48:43 +01:00
default
e93a79e06d Also purge the public/ and private/ caches. 2022-11-25 17:42:01 +01:00
default
6c6b5a30c4 Do hard links to objects in each user's public and private caches. 2022-11-25 17:26:12 +01:00
default
87d3ec2acc Renamed indexes.
timeline.idx to private.idx, local.idx to public.idx.
2022-11-25 17:07:23 +01:00
default
4a41f3a1f0 New function timeline_object_add(). 2022-11-25 14:19:00 +01:00
default
40a9e6e984 Fixed typo. 2022-11-25 13:54:26 +01:00
default
ee75b3f5f6 In purge_server(), don't purge objects with 2 (or more) hard links.
This way, an object can be protected from the purge by creating
a hard link to it.
2022-11-25 13:51:56 +01:00
default
2d7c327cbf New function mtime_nl(). 2022-11-25 13:33:13 +01:00
default
4bbebe8e4e Started maintaining timeline.idx and local.idx. 2022-11-25 12:42:42 +01:00
default
9df1cb129e Use macro XS_ALL were possible. 2022-11-25 12:21:26 +01:00
default
e2c332c68a On Update + Person, call object_del() before actor_add(). 2022-11-25 12:09:30 +01:00
default
200a6a0c91 The global object database is also purged. 2022-11-25 11:37:05 +01:00
default
b792417013 Also purge the hidden/ user directory. 2022-11-25 11:15:09 +01:00
default
de5345e5bd Updated documentation. 2022-11-25 11:04:23 +01:00
default
1acfe8fc54 Fixed return value of srv_open(). 2022-11-25 10:56:34 +01:00
default
45be9a1cb1 New command-line command 'upgrade'. 2022-11-25 10:53:16 +01:00
default
8a71e2e557 Only log the object_admire() if it's new. 2022-11-24 13:15:32 +01:00
default
694ae655cb Use index_in() in object_admire() to avoid admiring more than once. 2022-11-24 13:10:03 +01:00
default
8be8a9282e New function index_in(). 2022-11-24 13:06:28 +01:00
default
233ba75d1e New function object_admire(). 2022-11-24 13:00:24 +01:00
default
177c362425 Fixed some source comments. 2022-11-24 12:38:31 +01:00
default
2176a91c64 Fixed hide() to store the object id, not its md5. 2022-11-24 12:21:54 +01:00
default
4494fc3daf Fixed muted filenames. 2022-11-24 10:06:24 +01:00
default
e121aeb948 New function object_children(). 2022-11-24 09:58:37 +01:00
default
d215f8ce46 Use the new hide API. 2022-11-24 09:49:54 +01:00
default
4553528507 New API for hidden threads. 2022-11-24 09:39:16 +01:00
default
ea94a479f1 Stop dropping messages with hidden parents. 2022-11-24 09:31:58 +01:00
default
6acf906b64 Added debug info for child index updates. 2022-11-24 09:15:06 +01:00
default
391fc5cd99 In object_add(), update the parent's children index even if the parent isn't here. 2022-11-24 09:06:41 +01:00
default
1941d00650 Refuse to store objects that are already here. 2022-11-24 08:39:30 +01:00
default
b0b052ab3b Function object_del() also deletes the indexes. 2022-11-24 08:36:01 +01:00
default
42449d9cad Also check for a non-empty in_reply_to in object_add(). 2022-11-24 08:18:51 +01:00
default
ecea10e11c Function object_add() also update the parent's children index. 2022-11-24 08:09:57 +01:00
default
9d7b35940f Renamed listfile functions to index. 2022-11-24 08:00:35 +01:00
default
cde8650df7 Don't search explicitly for Person in actor_get().
Some actors are of type Service.
2022-11-23 21:43:00 +01:00
default
1bd69bc611 Some tweaks to the new listfile functions. 2022-11-23 20:25:57 +01:00
default
7f458f4fd6 More listfile functions. 2022-11-23 19:32:26 +01:00
default
0ff3b32e71 New function list_del_md5(). 2022-11-23 19:14:55 +01:00
default
fc96f02b91 New function object_get_by_md5(). 2022-11-23 19:03:21 +01:00
default
095a8b1568 Renamed _object_fn_by_id() to _object_fn(). 2022-11-23 18:59:18 +01:00
default
0c83ef5a22 New function list_add_md5(). 2022-11-23 18:58:07 +01:00
default
fa3904c5a7 New function object_del(). 2022-11-23 16:59:35 +01:00
default
39a9afb7c2 Deleted purge of old actors directory. 2022-11-23 16:52:18 +01:00