PlaidWeb / Pushl

Push notification adapter for feeds
MIT License
30 stars 0 forks source link

Rework the href vs. link thing #30

Closed fluffy-critter closed 5 years ago

fluffy-critter commented 5 years ago

Right now the href vs link thing is causing a bunch of weird behavior and also the caching on it could be a lot better.

Possible refactoring:

  1. entries.Entry.get_targets returns a list of (url,href) pairs (looks like it already does this but the naming is confusing)
  2. webmentions.get_target only takes (and caches) the url value
  3. webmentions.Target.__init__ stores the self.canonical value from the request.url response
  4. webmentions.Target._get_endpoint can override self.canonical if the document provides a <link rel="canonical">
  5. webmentions.Target.send takes source,href parameters, and emits a compatibility warning if href != self.canonical (but only if self.endpoint is not None).