[go: up one dir, main page]

Skip to content

Ensure Twitter @mentions are correctly formatted when posting TO Twitter

  • Add an extra sample for twitter handles without a leading @ in the form username@twitter.com
  • Update expected output in test_double_mention in tests/test_toots.py
  • Refactor test_twitter_mention in tests/test_toots.py into a shared helper method (_twitter_mention_helper) and two test methods; for testing mentions with SANITIZE_TWITTER_HANDLES enabled and disabled.
  • Move the replacement of @user@twitter.com mentions to the end of sanitize_twitter_handles in moa/toot.py
  • Refactor the scan for overlapping @mentions between twitter handle matching and mastodon handle matching into sub function in sanitize_twitter_handles in moa/toot.py
  • Update sanitize_twitter_handles and the new sub function in moa/toot.py to also handle fully-qualified Twitter @mentions (i.e. @user@twitter.com) to allow those to be passed through without rewriting until the end of the method where we then replace them with bare @mentions ready for posting to Twitter

Fixes: #40

Edited by Lucy Llewellyn

Merge request reports

Loading