Wykres commitów

38 Commity (1f15583aad60843bc01411382ec1a7ab92a54804)

Autor SHA1 Wiadomość Data
Alain St-Denis 3dfe7d637b use markdownify instead of as md. 2024-02-26 20:04:12 -05:00
Alain St-Denis d080bcf509 handle escaped characters in markdown mentions 2024-02-13 14:04:15 -05:00
Alain St-Denis 3f98f1e04e Select the img tag title property over the alt property for embedded images. Adjust the corresponding test. 2024-02-11 08:33:32 -05:00
Alain St-Denis 33366802c4 Move process_text_links back to the client app. Skip related tests. Convert it to BeautifulSoup. Remove unused imports. 2023-07-16 07:13:56 -04:00
Alain St-Denis 24f5bb21a9 Fix some tests and fix code that was failing tests. Catch HTML signatures with invalid padding. 2023-07-10 14:39:55 -04:00
Alain St-Denis e0993a7f7f Switch to BeautifulSoup for content processing. Outbound rendered content is now provided by the client app. Mark inbound AP HTML content hashtags and mentions. Fix missing href attribute crashing process_text_links. 2023-07-08 07:34:44 -04:00
Alain St-Denis 6b9c74b793 Implement automatic remote profile updates. Reduce remote requests frequency. WIP: implement profile retractions. 2023-04-07 12:06:22 -04:00
Alain St-Denis e7d954b788 Fixes to address the reviewer's comments. Where appropriate, align with existing code structure. 2023-03-26 14:47:40 -04:00
Alain St-Denis 41785c2fdc Refactor jsonld context management. Move LD signing to entities/activitypub. Move jsonld document_loader caching to __init__.py. Fix tests. 2023-03-24 18:34:15 -04:00
Alain St-Denis 9df803dafe Render Activitypub outbound payloads with calamus. 2023-01-07 15:59:38 +00:00
Alain St-Denis 58c8f95e54 Add audio and video media objects and much more. 2022-08-19 17:01:44 +00:00
Jason Robinson e4db91503b Fetch and upload embedded images before sending to Matrix 2021-01-01 02:48:40 +02:00
Jason Robinson 82ac0ce3cf Refactor up the embedded image recognition code from ActivityPub AttachImagesMixin to the base RawContentMixin so Matrix can use that too to upload images pre sending. 2020-12-29 23:12:06 +02:00
Jason Robinson c40194da95 Support Post entities on Matrix side into profile rooms 2020-12-27 01:10:31 +02:00
Jason Robinson 3745d72bcd Wrap outbound HTML tags in link tags
If Django configured, otherwise just keep the
text as is. Django configuration must have the
base url and tags path for making the link.

Closes https://git.feneas.org/socialhome/socialhome/issues/571
Refs https://git.feneas.org/socialhome/socialhome/issues/572
2020-02-17 22:45:23 +02:00
Jason Robinson 1e3de327c3 Wrap outbound HTML mention links in span
This is Mastodon specific, but what can we do than copy the
biggest for greater compatibility.
2020-02-17 22:16:59 +02:00
Jason Robinson 9cb2509ab6 Add replacer functionality to the find_tags utility 2020-02-17 21:58:00 +02:00
Jason Robinson b72ce5b870 Use find_tags when calculating tags from RawContentMixin.raw_content
Closes #70
2020-02-17 21:10:03 +02:00
Jason Robinson 3678c520dd Add mention class to outgoing ActivityPub HTML payload mentions
This seems to be a community convention to stop mentions rendering as
links, possibly?
2020-02-16 23:20:10 +02:00
Jason Robinson 52eb8fc6cd Linkify URL's in outgoing ActivityPub payloads
Refs: #572
2020-01-26 01:21:41 +02:00
Jason Robinson c479a42d47 Entities with a `raw_content` field now have URL syntax mentions rendered into a link
If Django is configured, a profile will be retrieved using the configured profile
getter function and the profile name or username will be used for the link.

Refs: https://git.feneas.org/socialhome/socialhome/issues/572
2020-01-18 01:39:44 +02:00
Jason Robinson 6bc85a3bfa Loosen validation of `TargetIDMixin`
It now requires one of the target attributes
to be set, not just `target_id`. This fixes
follows over the Diaspora protocol which broke
with stricter send validation added in 0.19.0.
2020-01-12 00:56:46 +02:00
Jason Robinson ee7f3aef60 Only validate signatures for inbound entities
For now anyway.
2019-10-11 00:13:10 +03:00
Jason Robinson 8d2bc74556 Attach mentions in ActivityPub outgoing payloads
Any mentions given in the _mentions list or found in the raw_content
are attached as Mention tags before sending.

https://git.feneas.org/socialhome/socialhome/issues/522
2019-09-08 23:52:23 +03:00
Jason Robinson 64f266e544 Refactor extract_mentions logic to base RawContentMixin
Since we're going to reuse the Diaspora style mentions syntax
(without the display name part), pull out the mentions extract code
from the Diaspora mixins to the base mixins.
2019-09-08 23:04:08 +03:00
Jason Robinson c3fd773f78 Extract mentions from ActivityPub payload content 2019-09-08 02:21:08 +03:00
Jason Robinson 7e93dc3da3 Fix _allowed_children check 2019-09-08 02:03:51 +03:00
Jason Robinson 7dad9c8109 Add tags found on raw_content when sending ActivityPub entities
Tags are added as "type: Hashtag" objects into the payload object.

Refs: https://git.feneas.org/socialhome/socialhome/issues/522
2019-09-03 22:51:41 +03:00
Jason Robinson 61a0fc442b Add media type and rendered content to entities with raw_content
Entities with `raw_content` now also contain a `_media_type` and
`rendered_content`.

The default `_media_type` is `text/markdown` except for ActivityPub
originating posts it defaults to `text/html`. If the ActivityPub
payload contains a `source`, that mediaType will be used instead.
2019-08-18 22:37:18 +03:00
Jason Robinson 41637e7688 Add receivers in mappers to inbound entities
Entities processed by inbound mappers will now have a list of
receivers in `_receivers`. This replaces the
`_receiving_actor_id` which was previously set for Diaspora entities.

UserType now has a `receiver_variant` which is one of `ReceiverVariant`
enum. `ACTOR` means this receiver is a single actor ID.
`FOLLOWERS` means this is the followers of the ID in the receiver.

Contains terrible hack to figure out if ActivityPub to/cc contains
a reference to the followers collection of the sender 🙈 . Will replace
"later" with proper fetch+cache solution, once we have a cache.

Refs: https://git.feneas.org/socialhome/socialhome/issues/522
2019-08-04 17:41:08 +03:00
Jason Robinson 1e757ca43b Add support for root parent for Comment entity
Added support for Diaspora `Comment` entity `thread_parent_guid`
attribute.

Added `root_target_id` and `root_target_guid` to `Comment` base entity.
This allows referring to a parent object up the hierarchy chain for
threaded comments.
2019-07-15 00:09:53 +03:00
Jason Robinson 4e2f40f7c8 Add a default activity to certain entity types
Default is Create for those entity types that are normally the
target of an activity. Those types that are normally activities don't
need a default activity.

Refs: #7
2019-06-21 00:34:26 +03:00
Jason Robinson 871cf67cde Add username to base Profile entity 2019-03-02 01:42:08 +02:00
Jason Robinson 837f463848 Add BaseEntity.username property
Returns username from handle or None.
2018-09-26 23:27:47 +03:00
Jason Robinson c4484d61c3 Add ActivityType enum 2018-09-25 23:50:34 +03:00
Jason Robinson 939dbf15d7 Return also guid to profile
But make Diaspora entities figure handle and guid from the ID's
if necessary. If ID's are not in diaspora format, they must be
passed in separately.
2018-08-26 16:46:24 +03:00
Jason Robinson fd6f24ad34 Correct attribute _receiving_actor_id on BaseEntity 2018-08-12 19:42:22 +03:00
Jason Robinson 493ee7bf22 Refactoring of diaspora protocol support to use ID's everywhere
Entities no longer have `handle` or `guid`, `target_guid` or
`target_handle` attributes. These are
now properties on the Diaspora entities only. For working with
entities, the new URI based attributes should be used. These are
`id`, `target_id` and `actor_id`. Depending on entity type, some
of these will be required while some not (just like with handle,
guid, target_guid and target_handle before).

All high level methods now expect ID's and return ID's for everything.
Internally the diaspora protocol still works with handle's and guid's.

This opens adding ActivityPub which works with URI ID's everywhere.
2018-08-11 23:41:15 +03:00