mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 12:59:17 +02:00
API refinements for activity stream
This commit is contained in:
parent
d509c090d3
commit
a6da10be41
12 changed files with 188 additions and 12 deletions
19
api/funkwhale_api/history/activities.py
Normal file
19
api/funkwhale_api/history/activities.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
from funkwhale_api.common import channels
|
||||
from funkwhale_api.activity import record
|
||||
|
||||
from . import serializers
|
||||
|
||||
record.registry.register_serializer(
|
||||
serializers.ListeningActivitySerializer)
|
||||
|
||||
|
||||
@record.registry.register_consumer('history.Listening')
|
||||
def broadcast_listening_to_instance_activity(data, obj):
|
||||
if obj.user.privacy_level not in ['instance', 'everyone']:
|
||||
return
|
||||
|
||||
channels.group_send('instance_activity', {
|
||||
'type': 'event.send',
|
||||
'text': '',
|
||||
'data': data
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue