zulip/zerver/lib
Rohitt Vashishtha 912e372c4e markdown: Remove !avatar() and !gravatar() syntax.
This particular commit has been a long time coming. For reference,
!avatar(email) was an undocumented syntax that simply rendered an
inline 50px avatar for a user in a message, essentially allowing
you to create a user pill like:

`!avatar(alice@example.com) Alice: hey!`

---

Reimplementation

If we decide to reimplement this or a similar feature in the future,
we could use something like `<avatar:userid>` syntax which is more
in line with creating links in markdown. Even then, it would not be
a good idea to add this instead of supporting inline images directly.

Since any usecases of such a syntax are in automation, we do not need
to make it userfriendly and something like the following is a better
implementation that doesn't need a custom syntax:

`![avatar for Alice](/avatar/1234?s=50) Alice: hey!`

---

History

We initially added this syntax back in 2012 and it was 'deprecated'
from the get go. Here's what the original commit had to say about
the new syntax:

> We'll use this internally for the commit bot.  We might eventually
> disable it for external users.

We eventually did start using this for our github integrations in 2013
but since then, those integrations have been neglected in favor of
our GitHub webhooks which do not use this syntax.

When we copied `!gravatar` to add the `!avatar` syntax, we also noted
that we want to deprecate the `!gravatar` syntax entirely - in 2013!

Since then, we haven't advertised either of these syntaxes anywhere
in our docs, and the only two places where this syntax remains is
our game bots that could easily do without these, and the git commit
integration that we have deprecated anyway.

We do not have any evidence of someone asking about this syntax on
chat.zulip.org when developing an integration and rightfully so- only
the people who work on Zulip (and specifically, markdown) are likely
to stumble upon it and try it out.

This is also the only peice of code due to which we had to look up
emails -> userid mapping in our backend markdown. By removing this,
we entirely remove the backend markdown's dependency on user emails
to render messages.

---

Relevant commits:

- Oct 2012, Initial commit        c31462c278
- Nov 2013, Update commit bot     968c393826
- Nov 2013, Add avatar syntax     761c0a0266
- Sep 2017, Avoid email use       c3032a7fe8
- Apr 2019, Remove from webhook   674fcfcce1
2020-07-07 10:39:44 -07:00
..
markdown markdown: Remove !avatar() and !gravatar() syntax. 2020-07-07 10:39:44 -07:00
url_preview python: Fix misuse of Optional types for optional parameters. 2020-06-13 15:31:27 -07:00
webhooks webhooks: Fix a type: ignore issue. 2020-06-30 18:58:23 -07:00
__init__.py
actions.py delete_event_notify_user_ids: Fix UnboundLocalError. 2020-07-07 10:33:50 -07:00
addressee.py addressee: Remove redundant casts. 2020-06-22 17:11:42 -07:00
alert_words.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
attachments.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
avatar.py python: Convert more percent formatting to Python 3.6 f-strings. 2020-06-14 23:27:22 -07:00
avatar_hash.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
bot_config.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
bot_lib.py test_service_bot_system: Fix type: ignore issues. 2020-06-30 18:58:23 -07:00
bot_storage.py test_service_bot_system: Fix type: ignore issues. 2020-06-30 18:58:23 -07:00
bulk_create.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
cache.py cache: Fix type: ignore issues. 2020-07-01 10:51:15 -07:00
cache_helpers.py sessions: Fix type: ignore issues. 2020-06-30 18:58:23 -07:00
camo.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
ccache.py python: Fix misuse of Optional types for optional parameters. 2020-06-13 15:31:27 -07:00
context_managers.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
create_user.py audit_log: Log acting_user in do_change_avatar_fields. 2020-07-06 17:24:18 -07:00
db.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
debug.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
dev_ldap_directory.py python: Convert more percent formatting to Python 3.6 f-strings. 2020-06-14 23:27:22 -07:00
digest.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
display_recipient.py cache: Fix type: ignore issues. 2020-07-01 10:51:15 -07:00
domains.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
email_mirror.py logging: Use logging.exception and exc_info for unexpected exceptions. 2020-06-14 23:27:22 -07:00
email_mirror_helpers.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
email_notifications.py python: Manually convert more percent-formatting to f-strings. 2020-06-14 23:27:22 -07:00
email_validation.py python: Convert percent formatting to .format for translated strings. 2020-06-15 16:24:46 -07:00
emoji.py python: Convert percent formatting to .format for translated strings. 2020-06-15 16:24:46 -07:00
error_notify.py python: Manually convert more percent-formatting to f-strings. 2020-06-14 23:27:22 -07:00
events.py move_topic_to_stream: Apply the event to the fetched state. 2020-07-06 15:48:55 -07:00
exceptions.py refactor: Change BugdownRenderingException to MarkdownRenderingException. 2020-06-26 17:08:37 -07:00
export.py python: Convert more percent formatting to Python 3.6 f-strings. 2020-06-14 23:27:22 -07:00
external_accounts.py request: Improve validator type so mypy can check it against REQ. 2020-06-20 22:29:15 -07:00
fix_unreads.py pointer: Remove fix_pre_pointer fixing logic. 2020-06-18 12:55:59 -07:00
generate_test_data.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
hotspots.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
html_diff.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
html_to_text.py python: Replace None defaults with empty collections where appropriate. 2020-06-13 15:31:27 -07:00
i18n.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
import_realm.py audit_log: Log acting_user in do_change_avatar_fields. 2020-07-06 17:24:18 -07:00
initial_password.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
integrations.py request: Improve validator type so mypy can check it against REQ. 2020-06-20 22:29:15 -07:00
logging_util.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
management.py python: Manually convert more percent-formatting to f-strings. 2020-06-14 23:27:22 -07:00
mdiff.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
mention.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
message.py refactor: Rename convert to markdown_convert. 2020-07-06 12:39:59 -07:00
migrate.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
mobile_auth_otp.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
name_restrictions.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
narrow.py python: Convert percent formatting to .format for translated strings. 2020-06-15 16:24:46 -07:00
onboarding.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
outgoing_webhook.py outgoing_webhook: Fix strict_optional errors. 2020-07-06 11:25:48 -07:00
parallel.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
presence.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
profile.py decorator: Strengthen types of signature-preserving decorators. 2020-06-30 18:58:23 -07:00
push_notifications.py push_notifications: Fix strict_optional errors. 2020-07-06 11:25:48 -07:00
pysa.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
queue.py queue: Fix strict_optional errors. 2020-07-06 11:25:48 -07:00
rate_limiter.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
realm_description.py refactor: Rename convert to markdown_convert. 2020-07-06 12:39:59 -07:00
realm_icon.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
realm_logo.py realm_logo: Return default logo for realms on LIMITED plan. 2020-06-18 17:46:26 -07:00
redis_utils.py auth: Avoid unchecked casts. 2020-06-23 13:30:09 -07:00
remote_server.py remote_server: Fix send_to_push_bouncer type. 2020-07-05 11:53:45 -07:00
request.py test_decorators: Remove tests for conditions already excluded by mypy. 2020-06-30 18:58:23 -07:00
response.py python: Replace None defaults with empty collections where appropriate. 2020-06-13 15:31:27 -07:00
rest.py rest: Strengthen default_never_cache_responses type. 2020-06-30 18:58:23 -07:00
retention.py realm: Fix strict_optional errors. 2020-07-06 11:25:48 -07:00
send_email.py emails: Add a custom header specifying the organization when possible. 2020-06-28 13:33:02 -07:00
server_initialization.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
sessions.py sessions: Fix type: ignore issues. 2020-06-30 18:58:23 -07:00
soft_deactivation.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
sqlalchemy_utils.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
statistics.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
storage.py docs: Merge front-end-build-process with html-css. 2019-10-23 13:08:36 -07:00
stream_recipient.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
stream_subscription.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
stream_topic.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
streams.py audit_log: Log RealmAuditLog when Stream is created. 2020-07-06 17:32:11 -07:00
subdomains.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_classes.py test_classes: Fix strict_optional errors. 2020-07-06 11:25:48 -07:00
test_data.source.txt
test_fixtures.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_helpers.py test_helpers: Fix strict_optional errors. 2020-07-06 11:25:48 -07:00
test_runner.py test_runner: Remove customized run_test, TestSuite, and TestLoader. 2020-07-01 10:48:12 -07:00
tex.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
thumbnail.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
timeout.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
timestamp.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
timezone.py timezone: Remove dead assignment with type: ignore issue. 2020-06-23 11:29:54 -07:00
topic.py models: Annotate most field types. 2020-07-02 13:28:10 -07:00
topic_mutes.py mypy: Use tuples for muted_topics. 2020-06-24 15:01:57 -07:00
transfer.py upload: Avoid fetching bucket objects repeatedly. 2020-06-18 17:55:13 -07:00
type_debug.py decorator: Replace type: ignore with cast, avoid Any. 2020-06-30 18:58:23 -07:00
types.py users: Avoid unchecked cast. 2020-06-22 17:18:19 -07:00
unminify.py python: Manually convert more percent-formatting to f-strings. 2020-06-14 23:27:22 -07:00
upload.py upload: Remove unused get_realm_for_filename. 2020-06-18 17:55:13 -07:00
url_encoding.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
user_agent.py user_agent: Compile the regular expression. 2020-02-14 10:26:37 -08:00
user_groups.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
user_status.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
users.py cache: Fix type: ignore issues. 2020-07-01 10:51:15 -07:00
utils.py mypy: Type simple generators as Iterator, not Iterable. 2020-06-23 11:29:54 -07:00
validator.py python: Use isinstance with a tuple for testing multiple types. 2020-06-30 18:58:23 -07:00
widget.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
zcommand.py settings: Add automatic theme detection feature. 2020-06-21 01:09:01 -07:00
zephyr.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00