Commit graph

518 commits

Author SHA1 Message Date
kim
2509cb83b7 finish writing code comments 2025-04-25 15:24:39 +01:00
kim
b76398f685 more code comments, don't bother inserting statuses if timeline not preloaded 2025-04-25 15:24:39 +01:00
kim
00d8a1f8ac much improved status timeline code comments 2025-04-25 15:24:39 +01:00
kim
cc86a08f15 fix timeline preload state check 2025-04-25 15:24:39 +01:00
kim
b026299b46 comment-out unused functions, but leave in place as we might end-up using them 2025-04-25 15:24:39 +01:00
kim
83f6685437 add logic to allow dynamic clear / preloading of timelines 2025-04-25 15:24:39 +01:00
kim
b04b4f8516 share a bunch of the database load code in timeline cache, don't clear timelines on relationship change 2025-04-25 15:24:39 +01:00
kim
b3c9bfde18 start adding preloading support 2025-04-25 15:24:39 +01:00
kim
50805fac53 add repeat boost filtering logic, update go-structr, general improvements 2025-04-25 15:24:38 +01:00
kim
6176c22048 remove the boost logic from prepare function 2025-04-25 15:23:34 +01:00
kim
8c09d0f20d move boost checking to prepare function 2025-04-25 15:23:34 +01:00
kim
227d6edc3e remove local / public caches (is out of scope for this work), share more timeline code 2025-04-25 15:23:34 +01:00
kim
294e1a6bd8 add (now) missing slice reverse of tag timeline statuses when paging ASC 2025-04-25 15:23:34 +01:00
kim
53817c23fd simplify timeline cache loading, fix lo/hi returns, fix timeline invalidation side-effects missing for some federated actions 2025-04-25 15:23:34 +01:00
kim
f8af213259 remove the zero length check, as lo, hi values might still be set 2025-04-25 15:23:34 +01:00
kim
daa83cfd0d rewrite calls to public / local timeline calls 2025-04-25 15:23:34 +01:00
kim
374f0f5175 have a local and public timeline *per user* 2025-04-25 15:23:34 +01:00
kim
f62cc52761 fill in more code comments 2025-04-25 15:23:34 +01:00
kim
158463908a change the way we update lo,hi paging values during timeline load 2025-04-25 15:23:34 +01:00
kim
eadd5a6f0f further list timeline fixes 2025-04-25 15:23:34 +01:00
kim
8bec0eb5ff fix list timeline cache fetching 2025-04-25 15:23:34 +01:00
kim
884afa26e5 clarify some things better in code comments 2025-04-25 15:23:34 +01:00
kim
64564496f1 fix up more tests, fix missing required changes, etc 2025-04-25 15:23:34 +01:00
kim
61f8da707c fix test-identified timeline cache package issues 2025-04-25 15:23:34 +01:00
kim
4e80d0bf79 start adding page validation 2025-04-25 15:23:34 +01:00
kim
e96bf44497 remove references to old timeline types that needed starting up in tests 2025-04-25 15:23:34 +01:00
kim
566e2b1d38 remove old timeline package, add local timeline cache 2025-04-25 15:23:34 +01:00
kim
4803ae6bad implement new timeline code into more areas of codebase, pull in latest go-mangler, go-mutexes, go-structr 2025-04-25 15:23:34 +01:00
kim
bc46cd72b6 remove old use of go-bytes 2025-04-25 15:23:32 +01:00
kim
771fbe2d5e more work integration new timeline code 2025-04-25 15:22:41 +01:00
kim
49d9a008d9 further work rewriting timeline caching 2025-04-25 15:22:41 +01:00
kim
f4b4a696f2 start work rewriting timeline cache type 2025-04-25 15:22:41 +01:00
tobi
ffde1b150f
[chore] Move deps to code.superseriousbusiness.org (#4054) 2025-04-25 15:15:36 +02:00
tobi
0992ffc057
[bugfix] Use util.IsNil for checking DomainPermission (#4040) 2025-04-22 12:20:45 +02:00
kim
67fc1fd904
ensure 'none' gets included in serializable visibilities (#4007) 2025-04-14 13:33:37 +01:00
tobi
c8a780e12a
[bugfix] Fix setting bot on/off (#3986)
* [bugfix] Fix setting bot on/off

* read client messages in tests

* test fix
2025-04-11 15:36:40 +01:00
tobi
e032c959e1
[feature] Implement /oauth/revoke for token revocation (#3983) 2025-04-10 16:24:17 +02:00
tobi
365b575341
[feature] add TOTP two-factor authentication (2FA) (#3960)
* [feature] add TOTP two-factor authentication (2FA)

* use byteutil.S2B to avoid allocations when comparing + generating password hashes

* don't bother with string conversion  for consts

* use io.ReadFull

* use MustGenerateSecret for backup codes

* rename util functions
2025-04-07 16:14:41 +02:00
tobi
8ae2440da3
[chore] Migrate accounts to new table, relax uniqueness constraint of actor url and collections (#3928)
* [chore] Migrate accounts to new table, relax uniqueness constraint of actor url and collections

* fiddle with it! (that's what she said)

* remove unused cache fields

* sillyness

* fix tiny whoopsie
2025-04-06 14:39:40 +02:00
tobi
b184432331
[feature] Allow editing domain blocks/allows, fix comment import (#3967)
* start implementing editing of existing domain permissions

* [feature] Allow editing domain blocks/allows, fix comment import

* [bugfix] Use "comment" via /api/v1/instance

* fix the stuff
2025-04-04 18:29:22 +02:00
tobi
3949117be0
[feature] Use blurhashes in frontend, tidy up gallery view a bit (#3948)
* [feature] Use blurhashes in frontend, tidy up gallery view a bit

* weeeeeeeeeeeeeeeee

* beep boop
2025-03-31 15:51:17 +02:00
tobi
b6e481d63e
[feature] Allow user to choose "gallery" style layout for web view of profile (#3917)
* [feature] Allow user to choose "gallery" style web layout

* find a bug and squish it up and all day long you'll have good luck

* just a sec

* [performance] reindex public timeline + tinker with query a bit

* fiddling

* should be good now

* last bit of finagling, i'm done now i prommy

* panic normally
2025-03-26 15:59:39 +00:00
tobi
d5847e2d2b
[feature] Application creation + management via API + settings panel (#3906)
* [feature] Application creation + management via API + settings panel

* fix docs links

* add errnorows test

* use known application as shorter

* add comment about side effects
2025-03-17 14:06:17 +00:00
tobi
d8113c11e4
[feature] Parse content warning to HTML, serialize via client API as plaintext (#3876)
* [feature] Parse content warning as HTML, serialize via API to plaintext

* tidy up some cruft

* whoops

* oops

* i'm da joker baybee

* clemency muy lorde

* rename some of the text functions for clarity

* jiggle the opts

* fiddle de deee

* hopefully the last test fix i ever have to do in my beautiful life
2025-03-07 14:04:34 +00:00
ewwwin
424f62dd70
[bugfix] Store and expose status content type (#3870)
* Add ContentType to internal models

* Add ContentType to API models StatusSource and StatusEdit

* Add helpers to convert between API/internal StatusContentType

* Write status content type on create/edit

* Add migration

* Update API docs

go run github.com/go-swagger/go-swagger/cmd/swagger generate spec --scan-models --exclude-deps --output docs/api/swagger.yaml

* ensure ContentType is updated anywhere Text is

* Update docs, take care of TODOs

* Set ContentType in more places where Text is set

* We don't actually use ContentType on the API status model

* Update StatusSource test

* Remove unused helper function I copied

* Revert change to StatusContentType swagger annotation

I'm going to include this in a follow-on PR instead.

* Add test for updating content type in edits

* Return a value from processContentType instead of modifying the existing status

Fixes an issue that was caught by the test I just added - the recorded edit would be marked with the *new* content type instead of the old one, which is obviously bad

* Add test for handling of statuses with no stored content type

* repurpose an existing test status instead of adding a new one to avoid breaking other tests

* Add test to ensure newly created statuses always have content type saved

* Do include content type on status API model actually

This is mostly important when deleting and redrafting.

The comment on `apimodel.Status.Text` implies that it's not sent except in response to status deletion, but actually this doesn't seem to be the case; it also appears to be present in responses to creations and normal fetches and stuff. So I'm treating `ContentType` the same here.

* Update new tests to check content type on API statuses

* Check content type of API statuses in all tests where text is checked

* update other api tests with status content type field

* Add test ensuring text and content type are returned when deleting a status

* Convert processContentType to free function and remove unused parameter

* check for the correct value in the deletion test

* Be explicit about this test status having an empty content type

* Use omitempty consistently on API models

* clean up the final diff a bit

* one more swagger regen for the road

* Handle nil statuses in processContentType

* Don't pass processContentType the entire edit form, it doesn't need it

* Move processContentType to common.go and use for creation as well

* Remove unused parameters to ContentTypeToAPIContentType
2025-03-06 16:31:52 +00:00
tobi
829143d263
[feature] Add token review / delete to backend + settings panel (#3845) 2025-03-04 10:01:25 +00:00
tobi
1b37944f8b
[feature] Refactor tokens, allow multiple app redirect_uris (#3849)
* [feature] Refactor tokens, allow multiple app redirect_uris

* move + tweak handlers a bit

* return error for unset oauth2.ClientStore funcs

* wrap UpdateToken with cache

* panic handling

* cheeky little time optimization

* unlock on error
2025-03-03 15:03:36 +00:00
tobi
8488ac9286
[chore] migrate oauth2 -> codeberg (#3857) 2025-03-02 16:42:51 +01:00
tobi
e2e185d10b
[chore] github.com/superseriousbusiness/activity -> codeberg.org/superseriousbusiness/activity (#3853) 2025-03-02 12:48:00 +01:00
Xavier Vello
0118e03cda
[feature] Implement CSV import for mutes (#3696)
* Implement CSV import for mutes

* update swagger.yaml

* update documentation

* add ImportTestSuite.TestImportMutes

* fix comment typo
2025-03-01 11:37:40 +01:00