Commit graph

123 commits

Author SHA1 Message Date
Adeodato Simó 699d637bae
Fix detection of unlisted posts (#3258)
Merged from dato/fix_unlisted_set_from_activity.
2024-03-27 16:29:09 -03:00
Mouse Reeve dd9d68c97d
Merge pull request #3096 from bookwyrm-social/image-ap-serialization
Changes to how images are serialized
2024-03-02 18:58:08 -08:00
Adeodato Simó accb3273f1
When determining privacy, check for unlisted early
If `followers_url` is found in `to`, the post may still be _unlisted_
if `"https://www.w3.org/ns/activitystreams#Public"` appears in `cc`.
Hence this should be checked earlier.
2024-01-26 06:45:54 -03:00
Adeodato Simó edfa6b18a1
Rename utils.sealed_date module (and tests) to utils.partial_date 2023-11-09 14:00:44 -03:00
Adeodato Simó fa80aa54a9
SealedDate renames, pt. 2
• SealedDate -> PartialDate
• MonthSeal  -> MonthParts
• YearSeal   -> YearParts
2023-11-09 14:00:44 -03:00
Adeodato Simó 0e4c5ed439
SealedDate renames, pt. 1
• SealedDateField      -> PartialDateModel
• SealedDateFormField  -> PartialDateFormField
• SealedDateDescriptor -> PartialDateDescriptor
2023-11-09 14:00:44 -03:00
Adeodato Simó e928027e16
Merge from main for up-to-date migrations 2023-11-09 14:00:14 -03:00
Adeodato Simó dccac11527
PartialDateField: allow incoming dates without timezone 2023-11-09 13:04:09 -03:00
Mouse Reeve 0bb4b0d71d Changes to how images are serialized
I'm just going to see if any tests fail?
2023-11-08 15:24:47 -08:00
Mouse Reeve ae51dcec63
Merge pull request #3039 from dato/ap_image_url
Fix creation of covers for ActivityPub imports
2023-11-02 14:44:44 -07:00
Adeodato Simó 737ac8e908
Implement PartialDateField using SealedDate and a custom descriptor 2023-10-24 17:30:15 -03:00
Adeodato Simó 3251ef0bf5
Fix creation of covers for ActivityPub imports
`cover` comes as a JSON dict, but the code was looking for URL as
an attribute.

(This commit leaves the attribute access in place, just in case
`cover` is updated to serialize as Document proper.)
2023-10-16 17:43:04 -03:00
Adeodato Simó c02306a66b
Default to Jan 1st too on incomplete dates received from ActivityPub 2023-10-15 19:59:51 -03:00
Joeri de Ruiter 8736f2c6ef Remove '@' from the beginning of hashtag names in activity 2023-07-28 11:20:08 +02:00
Hugh Rundle a0b7112c9c
Merge branch 'main' into gts 2023-04-14 18:24:02 +10:00
Hugh Rundle a6676718cb formatting 2023-04-13 13:27:51 +10:00
Hugh Rundle e3261c6b88 fix incoming GTS mentions and DMs
GoToSocial sends 'tag' values as a single object if there is only one
user mentioned, rather than an array with an object inside it.

This causes Bookwyrm to reject the tag since it comes through as a
dict rather than a list.

This commit fixes this at the point the incoming AP object is transformed
so that "mention" tags are turned into a mention_user.
2023-04-13 13:21:05 +10:00
Hugh Rundle c9dcd4f7ad Include initial '@' in mention tag name
GoToSocial expects the 'name' value of a mention tag to have an initial '@' symbol. Mastodon doesn't seem to mind either way.
2023-04-10 20:38:20 +10:00
Josh Soref c216937dc4 spelling: massively
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref f6a6cb281b spelling: different
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 319be60c80 spelling: assigning
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Christof Dorner 11640f986e Import hashtags from activitypub statuses 2023-03-07 12:59:31 +01:00
Christof Dorner c68304a99b Parse hashtags and store them in CreateStatus view 2023-03-07 12:55:36 +01:00
Mouse Reeve 216be2aeea Fixes pylint complaints
"fixes" as in silences, sorry
2023-02-20 12:24:53 -08:00
Mouse Reeve 779d2b0694 Attempt to complete inbox requests synchronously
When an inbox activity comes in from another fediverse instance, the
behavior prior to this commit was always to immediately give a 200
response to the external server and then create a celery activity
(usually in the MEDIUM_PRIORITY queue) to complete it.

Instead, this would receive a request and try to complete it without
making any http requests (which would make the request take too long to
process). If an external request is required to complete the activity, a
task is created and added to the queue.

Ideally, this will cause some tasks to happen very promptly, and reduce
the load on celery, which would help queued tasks happen more quickly as
well.

One downside is that this will make completing http requests from
external servers slowing (since it's doing a bunch of thinking before
responding).
2023-02-20 11:05:18 -08:00
Mouse Reeve 8951628e02 Don't try to markdownify a null field 2022-12-05 15:12:53 -08:00
Mouse Reeve fe7163be33 Render markdown to html when using activitypub
This will produce better federated results outside of bookwyrm, and will
still display correctly within bookwyrm
2022-11-17 11:05:48 -08:00
Mouse Reeve 7f78140015 Uses library for html cleanup 2022-07-04 13:21:13 -07:00
Mouse Reeve 9921a1e754 Various pylint complaince fixes 2022-04-08 14:23:37 -07:00
Mouse Reeve 90277a1697 Avoid new pylint complaint 2022-03-26 10:07:06 -07:00
Mouse Reeve 754e24812b Check image extensions before saving 2022-02-01 21:18:25 -08:00
Mouse Reeve d74360a13f Merge branch 'main' into book-file-links 2022-01-12 17:14:27 -08:00
Mouse Reeve 8b2335c52c Build-in translations to privacy choices dropdwon 2022-01-12 15:26:13 -08:00
Mouse Reeve 4f576b77a0 Use urlfield 2021-12-15 12:46:10 -08:00
Mouse Reeve 3a7f070a79 Typo fix 2021-11-28 08:50:29 -08:00
Mouse Reeve 54cef421e2 Fixes checking if image fields are already set 2021-11-28 07:57:27 -08:00
Mouse Reeve 717da918cf Use social media preview images 2021-11-10 10:59:21 -08:00
Mouse Reeve 4f5d23e785 Replace image_serialzier helper with built-in serializers 2021-11-10 10:28:43 -08:00
Joachim b956b79bd0 Add full URL generation to image_serializer 2021-10-27 18:56:37 +02:00
Joachim 35bd4a4071 Apply review suggestion 2021-10-27 18:13:47 +02:00
Mouse Reeve 9d4e0851a0
Merge branch 'main' into image-absolute-url-getter 2021-10-20 15:12:06 -07:00
Mouse Reeve 08f6a97653 Python formatting 2021-09-18 11:33:43 -07:00
Mouse Reeve acfb1bb376 Updating string format synatx part 2 2021-09-18 11:32:00 -07:00
Mouse Reeve 082c2708a7 Fixes attribution field logic 2021-08-29 08:50:46 -07:00
Mouse Reeve 8c8b1168d4 Support attribution field on boosts 2021-08-29 08:22:14 -07:00
Mouse Reeve 9eea60b35c Fixes call to followers url in serialization 2021-08-29 07:36:59 -07:00
Mouse Reeve a5dcc0e5e4 Support multiple possible fields that indicate user ownership 2021-08-28 12:11:15 -07:00
Mouse Reeve 2c26b04119 Uses correct object to determine author 2021-08-28 11:30:54 -07:00
Mouse Reeve 53d9ff87d9 Look up followers url to determine post privacy 2021-08-28 10:40:52 -07:00
Mouse Reeve ad0fff7030 Prevent overwriting data on import form outside data source 2021-08-17 10:08:07 -07:00