comparison sat/plugins/plugin_comp_ap_gateway/constants.py @ 3904:0aa7023dcd08

component AP gateway: events: - XMPP Events <=> AP Events conversion - `Join`/`Leave` activities are converted to RSVP attachments and vice versa - fix caching/notification on item published on a virtual pubsub node - add Ad-Hoc command to convert XMPP Jid/Node to virtual AP Account - handle `Update` activity - on `convertAndPostItems`, `Update` activity is used instead of `Create` if a version of the item is already present in cache - `events` field is added to actor data (and to `endpoints`), it links the `outbox` of the actor mapping the same JID with the Events node (i.e. it links to the Events node of the entity) - fix subscription to nodes which are not the microblog one rel 372
author Goffi <goffi@goffi.org>
date Thu, 22 Sep 2022 00:01:41 +0200
parents aa7197b67c26
children d538b07cddf3
comparison
equal deleted inserted replaced
3903:384b7e6c2dbf 3904:0aa7023dcd08
29 TYPE_ITEM = "item" 29 TYPE_ITEM = "item"
30 TYPE_TOMBSTONE = "Tombstone" 30 TYPE_TOMBSTONE = "Tombstone"
31 TYPE_MENTION = "Mention" 31 TYPE_MENTION = "Mention"
32 TYPE_LIKE = "Like" 32 TYPE_LIKE = "Like"
33 TYPE_REACTION = "EmojiReact" 33 TYPE_REACTION = "EmojiReact"
34 TYPE_EVENT = "Event"
35 TYPE_JOIN = "Join"
36 TYPE_LEAVE = "Leave"
34 MEDIA_TYPE_AP = "application/activity+json" 37 MEDIA_TYPE_AP = "application/activity+json"
35 NS_AP = "https://www.w3.org/ns/activitystreams" 38 NS_AP = "https://www.w3.org/ns/activitystreams"
36 NS_AP_PUBLIC = f"{NS_AP}#Public" 39 NS_AP_PUBLIC = f"{NS_AP}#Public"
37 # 3 values can be used, see https://www.w3.org/TR/activitypub/#public-addressing 40 # 3 values can be used, see https://www.w3.org/TR/activitypub/#public-addressing
38 PUBLIC_TUPLE = (NS_AP_PUBLIC, "as:Public", "Public") 41 PUBLIC_TUPLE = (NS_AP_PUBLIC, "as:Public", "Public")
71 ) 74 )
72 ACTIVITY_TARGET_MANDATORY = ("Add", "Remove") 75 ACTIVITY_TARGET_MANDATORY = ("Add", "Remove")
73 # activities which can be used with Shared Inbox (i.e. with no account specified) 76 # activities which can be used with Shared Inbox (i.e. with no account specified)
74 # must be lowercase 77 # must be lowercase
75 ACTIVIY_NO_ACCOUNT_ALLOWED = ( 78 ACTIVIY_NO_ACCOUNT_ALLOWED = (
76 "create", "delete", "announce", "undo", "like", "emojireact" 79 "create", "update", "delete", "announce", "undo", "like", "emojireact", "join",
80 "leave"
77 ) 81 )
78 # maximum number of parents to retrieve when comments_max_depth option is set 82 # maximum number of parents to retrieve when comments_max_depth option is set
79 COMMENTS_MAX_PARENTS = 100 83 COMMENTS_MAX_PARENTS = 100
80 # maximum size of avatar, in bytes 84 # maximum size of avatar, in bytes
81 MAX_AVATAR_SIZE = 1024 * 1024 * 5 85 MAX_AVATAR_SIZE = 1024 * 1024 * 5