Wykres commitów

842 Commity (f781c515b0523887e3828f19586084751b287e5b)

Autor SHA1 Wiadomość Data
Marnanel Thurman f781c515b0 Merge branch 'trilby-heavy' of gitlab.com:marnanel/kepi into trilby-heavy 2020-03-28 17:44:52 +00:00
Marnanel Thurman b4232323cc intermediate 2020-03-28 17:44:25 +00:00
Marnanel Thurman 4c0f22fa5c intermediate 2020-03-28 17:33:50 +00:00
Marnanel Thurman 017d0d17fb intermediate 2020-03-28 16:20:17 +00:00
Marnanel Thurman 65debd17c7 intermediate 2020-03-28 16:16:08 +00:00
Marnanel Thurman d1ecc330d1 intermediate 2020-03-28 16:15:45 +00:00
Marnanel Thurman 9318e3de26 intermediate 2020-03-27 22:40:26 +00:00
Marnanel Thurman 3e6596b800 intermediate 2020-03-27 22:38:05 +00:00
Marnanel Thurman bd441e995f intermediate 2020-03-27 22:09:16 +00:00
Marnanel Thurman 7d2f86a57a intermediate 2020-03-27 20:17:58 +00:00
Marnanel Thurman eadd90431e intermediate 2020-03-23 00:59:28 +00:00
Marnanel Thurman b7ab7cdf84 intermediate 2020-03-21 18:49:27 +00:00
Marnanel Thurman 600d13d4f5 intermediate 2020-03-20 15:47:05 +00:00
Marnanel Thurman e07706865e Intermediate checkin 2020-03-16 17:54:02 +00:00
Marnanel Thurman c4a07a9e52 Home timeline can't have Nones in it 2020-02-28 01:15:02 +00:00
Marnanel Thurman 560eed7b40 /api/v1/statuses for all statuses renders into JSON correctly,
plus passing test.
2020-02-28 01:04:59 +00:00
Marnanel Thurman 9fa7031f5f Trilby's status numbers are now the numbers of the actual AcItem,
not the AcCreate which created it.

Suddenly, all the code is clearer.
2020-02-28 00:53:24 +00:00
Marnanel Thurman bb1210fd24 "Favourite" view generalised, and made a subclass of the generalised class.
Test generalised likewise.
2020-02-26 23:48:31 +00:00
Marnanel Thurman ab2dea89a6 Further to adding Favourite support to trilby_api: the test now passes.
The IDs of actor and object are set consistently.
The type field is set on the Like object(!)
2020-02-23 00:53:28 +00:00
Marnanel Thurman 576081f6a3 First sketch of Activities in trilby_api. Added "Favourite" view
which can create a Like. Tests supplied; they currently fail.

AcActivity gains an f_object field to support this.
2020-02-23 00:32:09 +00:00
Marnanel Thurman d61aad22e8 TrilbyUser will only create an associated AcPerson if one hasn't already been supplied. 2020-02-23 00:31:30 +00:00
Marnanel Thurman ee95ed2863 Two hacks to keep tootstream happy:
- /api/v1/instance is also at /api/v1/instance/
 - the version reported is always 1.0.0. This is because we're
   mimicking the Mastodon API, so we reply giving the corresponding
   Mastodon version. (Or, as in this case, we guess and see what works.)
2020-02-17 19:50:09 +00:00
Marnanel Thurman 7cab79775e trilby AccountsSearch stub 2020-02-10 21:45:47 +00:00
Marnanel Thurman 5ecf08cdcc stub for /api/v1/search 2020-02-10 00:28:56 +00:00
Marnanel Thurman 2bc69c1250 The "serial" field of bowler_pub's AcItem moves up to AcObject;
all objects, remote and local, now have serial numbers.

This is partly to make it easier for trilby_api to provide
decimal "id" numbers, and partly so that status URLs can contain
monotonically increasing decimal numbers. This last part
has not yet been implemented; status URLs still contain the
hex ID of the status.

It's possible that we can simplify this design a bit;
we should think about refactoring.

The regexp for local hex numbers is renamed to LOCAL_NUMBER_REGEXP
because it used to contain the word "SERIAL", which was misleading.

trilby_api now returns the "serial" field as "id"; see above.

Tests updated.
2020-02-04 01:38:54 +00:00
Marnanel Thurman 01a85e38a8 The "id" field in the Mastodon API is always a decimal string.
We convert it to a hex string for use internally, but some clients
(e.g. Tusky) expect a decimal string.

See:
https://socialhub.activitypub.rocks/t/verify-credentials-im-doing-something-wrong-here/440/3
2020-02-03 22:28:51 +00:00
Marnanel Thurman 4f57cc3b90 Statuses returned via the Mastodon API always have IDs which are
decimal integer strings.

This is to keep Tusky etc happy. See
https://socialhub.activitypub.rocks/t/verify-credentials-im-doing-something-wrong-here/440/3
2020-02-02 00:58:08 +00:00
Marnanel Thurman 25a1b40461 "acct" returns simply the account name for local accounts,
and preferredUsername@hostname for remote accounts.

This change was suggested at
https://socialhub.activitypub.rocks/t/verify-credentials-im-doing-something-wrong-here/440/2
2020-01-23 01:52:26 +00:00
Marnanel Thurman 72fd4499cb stub "following" and "followers" added to trilby 2019-12-30 15:14:34 +00:00
Marnanel Thurman f7f59d2ed9 Creating a Django user also creates an associated AcPerson 2019-12-25 23:52:35 +00:00
Marnanel Thurman 474075cd5c For the public timeline, we query each status to see whether it's public,
rather than attempting to do it via a database filter.

Database filters will fail because public-ness is based on
several possible considerations.

trilby_api.tests.create_local_status gains a "to" parameter.

Tests added.
2019-12-25 23:21:43 +00:00
Marnanel Thurman c014bd6408 added on_like handler to create a "favourited" notification, plus test 2019-12-19 21:02:20 +00:00
Marnanel Thurman fa6e49bf43 Mastodon's notifications give a dict for account and status, not just their ID 2019-12-19 18:51:17 +00:00
Marnanel Thurman b5f32bb87f Fixed trilby_api.tests.test_rest to accept the new (correct) "acct" value 2019-12-19 18:50:40 +00:00
Marnanel Thurman 12db4732cb AcActor handles display_name correctly for local users (regression fixed) 2019-12-19 18:49:51 +00:00
Marnanel Thurman 37054416d9 trilby's Notification gains attribute about_account_actor 2019-12-19 18:44:34 +00:00
Marnanel Thurman 985a23ce5c AcObject gains attributes: acct, hostname, preferredUsername, and display_name 2019-12-19 18:43:41 +00:00
Marnanel Thurman 5694851bcd In trilby_api.models
====================

Notification uses constants within the class
to represent notification types, as the docs recommend, rather than
using enum.Enum.

Notification.about_account is added. The existing "account" field
is renamed for_account for clarity.

Notification also gains a __str__() method.

on_follow modified to work properly with these changes.

Several migrations added. Note that trilby's 0006 migration is
deleted but there's a new 0006; you might have to wind back to
0005 to allow this migration to work. There are dependency
reasons for doing it like this.

In trilby_api.serializers
=========================

NotificationSerializer modified to return about_account.
It also gets immediately monkey-patched to return
notification_type as "type". Rather messy hack,
but StackExchange says this is the way to do it.

In trilby_api.views
===================

Notifications requires authentication(!) and returns
only the authenticated user's notifications.

In tests
========

test_notifications's test_follow fixed. It didn't work
before, despite the claim in commit 37095e; that was wrong
because the results weren't actually being checked.
2019-12-18 18:06:51 +00:00
Marnanel Thurman 0f2192edad bowler_pub.tests.create_remote_person() has a default publicKey field 2019-12-18 17:58:28 +00:00
Marnanel Thurman 37095e6f1d trilby integration with signals so on_follow notifications work.
Test for this passes; moving it to new test_notifications.py.
2019-12-18 16:30:56 +00:00
Marnanel Thurman 3f53925712 trilby_api.models.Notification added.
Serializer and test stub included.

Nothing actually creates Notifications yet, though.
2019-12-07 02:03:38 +00:00
Marnanel Thurman bf5a8bde07 "deleted" signal is sent when a Delete activity is successful.
Tests included.

Also, "alice" in test_signals has been renamed "arthur",
since all the test messages were from HHGTTG anyway.
2019-12-07 01:30:48 +00:00
Marnanel Thurman 81fb007eb0 Added test for the new "updated" signal.
Added test for the "Update" side_effect.
2019-12-01 20:53:44 +00:00
Marnanel Thurman aa7d5c9a68 create() can pass the send_signal flag through to the side_effect routines.
Because of this, the side_effect routines take **kwargs,
as does run_side_effects() in AcObject.

The side_effect routine for Update can update cached data for remote objects.
It doesn't attempt to modify the "id" or "type" fields on any object.

AcObject gains an items() method, by analogy with dicts etc.
It's just syntactic sugar around activity_form.
2019-12-01 20:52:01 +00:00
Marnanel Thurman 9bf422d834 bowler_pub can send "created" signal on creation.
"deleted" and "updated" signals defined but not yet used.

Tests added.
2019-11-28 19:00:09 +00:00
Marnanel Thurman 07647a39eb Version bump to 0.4.1 2019-11-20 19:11:21 +00:00
Marnanel Thurman 781750bdf0 Renamed entire project from "chapeau" to "kepi".
This is because of a name clash in PyPI.
2019-11-20 19:10:10 +00:00
Marnanel Thurman 00fa10b41c "kepi" module, which implements ActivityPub, renamed to "bowler_pub".
This is to prepare for the rename of the entire project to "kepi".
2019-11-20 19:05:40 +00:00
Marnanel Thurman 999ccf787e Version bump to 0.4.0 2019-11-20 18:42:17 +00:00
Marnanel Thurman 8c7e80afd6 AcActor.activity_form() no longer blanks the summary (bio) field.
Test included.

Also, rm an obsolete comment.
2019-11-17 18:10:29 +00:00