Newer
Older
Eliot Berriot
committed
from . import serializers
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
ACTIVITY_TYPES = [
'Accept',
'Add',
'Announce',
'Arrive',
'Block',
'Create',
'Delete',
'Dislike',
'Flag',
'Follow',
'Ignore',
'Invite',
'Join',
'Leave',
'Like',
'Listen',
'Move',
'Offer',
'Question',
'Reject',
'Read',
'Remove',
'TentativeReject',
'TentativeAccept',
'Travel',
'Undo',
'Update',
'View',
]
OBJECT_TYPES = [
'Article',
'Audio',
'Collection',
'Document',
'Event',
'Image',
'Note',
'OrderedCollection',
'Page',
'Place',
'Profile',
'Relationship',
'Tombstone',
'Video',
def deliver(activity, on_behalf_of, to=[]):
return tasks.send.delay(
activity=activity,
actor_id=on_behalf_of.pk,
to=to
)
Eliot Berriot
committed
def accept_follow(follow):
serializer = serializers.AcceptFollowSerializer(follow)
Eliot Berriot
committed
serializer.data,
to=[follow.actor.url],
on_behalf_of=follow.target)