bengibaykal / swe574group1

2 stars 2 forks source link

Activity Stream - Django-Activity-Stream Library Does Not Support Activity Stream 2.0 Requirements #65

Closed eermis1 closed 4 years ago

eermis1 commented 4 years ago

Django-activity-stream library does not support W3C Activity Stream 2.0 requirements (compatible with 1.0) therefore by overriding the library alignment with 2.0 has to be created Related to issue #41

eermis1 commented 4 years ago

Issue has been fixed by overriding Django-Activity-Stream / Feeds.py

See below structure;

` class AbstractActivityStream_W3C2(AbstractActivityStream):

def format(self, action):
    """
    Returns a formatted dictionary for the given action.
    """
    item = {
        '@context': 'https://www.w3.org/ns/activitystreams',
        'summary': str(action),
        'type': str(action.description),
        'id': self.get_uri(action),
        'url': self.get_url(action),
        'verb': action.verb,
        'published': rfc3339_date(action.timestamp),
        'actor': self.format_actor(action),

    }
    if action.target:
        item['target'] = self.format_target(action)
    if action.action_object:
        item['object'] = self.format_action_object(action)
    return item`