Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
markdown: Cache Twitter 403 responses that are semi-permanent.
Alex Vandiver092ed87ae308
diff --git a/zerver/lib/markdown/__init__.py b/zerver/lib/markdown/__init__.pyindex d9099d3814a..b2ffdf80fb9 100644--- a/zerver/lib/markdown/__init__.py+++ b/zerver/lib/markdown/__init__.py@@ -419,6 +419,10 @@ def fetch_tweet_data(tweet_id: str) -> Optional[Dict[str, Any]]:# that the message doesn't exist; return None so# that we will cache the error.return None+ elif code in [63, 179]:+ # 63 is that the account is suspended, 179 is that+ # it is now locked; cache the None.+ return Noneelif code in [88, 130]:# Code 88 means that we were rate-limited and 130# means Twitter is having capacity issues; either way