Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect use of atom:uri element #752

Closed
imax9000 opened this issue Jul 18, 2024 · 1 comment
Closed

Incorrect use of atom:uri element #752

imax9000 opened this issue Jul 18, 2024 · 1 comment

Comments

@imax9000
Copy link

https://github.com/snarfed/granary/blob/main/granary/atom.py#L265

  a = {
    'objectType': 'activity',
    'verb': _as1_value(entry, 'verb') or 'post',
    'id': _text(entry, 'id') or (obj['id'] if obj_elem is None else None),
    'url': _text(entry, 'uri') or (obj['url'] if obj_elem is None else None),
    'object': obj,
    'actor': _author_to_actor(entry, feed_author=feed_author),
    'inReplyTo': obj.get('inReplyTo'),
  }

atom:uri element doesn't do what you think it does. Correct way of getting a URL from an entry is href attribute of atom:link element.

@snarfed
Copy link
Owner

snarfed commented Jul 18, 2024

Ah, good catch, thank you! uri is evidently for authors. Fortunately this should generally a noop, since we're grabbing link here:

self_links = [link for link in elem.iterfind('atom:link', NAMESPACES)

Still worth fixing though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants