Skip to content

Remove use of removed !avatar syntax from API bots #632

Open
@timabbott

Description

@timabbott

Apparently, we have a few integrations that are using the !avatar markdown syntax that we removed some time ago:

tabbott@coset:~/python-zulip-api$ git grep '!avatar'
zulip/integrations/git/post-receive:            commits += '!avatar(%s) %s\n' % (author_email, subject)
zulip/integrations/git/zulip_git_config.py:# return '!avatar(%s) [%s](https://example.com/commits/%s)\n' % (author, subject, commit_id)
zulip/integrations/git/zulip_git_config.py:    return '!avatar(%s) %s\n' % (author, subject)
zulip_bots/zulip_bots/bots/game_handler_bot/test_game_handler_bot.py:            'quit', 'Game cancelled.\n!avatar(foo@example.com) **foo** quit.', 0, bot, 'foo')
zulip_bots/zulip_bots/bots/game_handler_bot/test_game_handler_bot.py:        self.verify_response('move 3', '**foo** moved in column 3\n\nfoo\n\n!avatar(baz@example.com) It\'s **baz**\'s (:red_circle:) turn.',
zulip_bots/zulip_bots/bots/game_handler_bot/test_game_handler_bot.py:        self.verify_response('move 3', '**baz** moved in column 3\n\nfoo\n\n!avatar(foo@example.com) It\'s **foo**\'s (:blue_circle:) turn.',
zulip_bots/zulip_bots/bots/game_handler_bot/test_game_handler_bot.py:        self.verify_response('move 5', '!avatar(foo@example.com) It\'s **foo**\'s (:blue_circle:) turn.', 0,
zulip_bots/zulip_bots/bots/game_handler_bot/test_game_handler_bot.py:            self.verify_response('move 3', '!avatar(foo@example.com) **foo** won! :tada:',
zulip_bots/zulip_bots/bots/game_handler_bot/test_game_handler_bot.py:            self.verify_response('move 3', '!avatar(foo@example.com) **foo** won! :tada:',
zulip_bots/zulip_bots/bots/game_handler_bot/test_game_handler_bot.py:        self.verify_response('move 3', '**foo** moved in column 3\n\nfoo\n\n!avatar(test-bot@example.com) It\'s **test-bot**\'s (:red_circle:) turn.',
zulip_bots/zulip_bots/bots/game_handler_bot/test_game_handler_bot.py:> !avatar(foo@example.com)\n\
zulip_bots/zulip_bots/bots/game_handler_bot/test_game_handler_bot.py:> !avatar(foo@example.com)
zulip_bots/zulip_bots/bots/game_handler_bot/test_game_handler_bot.py:> !avatar(bar@example.com)
zulip_bots/zulip_bots/game_handler.py:        sender_avatar = "!avatar({})".format(sender)
zulip_bots/zulip_bots/game_handler.py:        player_avatar = "!avatar({})".format(player_email)
zulip_bots/zulip_bots/game_handler.py:                user_turn_avatar = "!avatar({})".format(self.players[self.turn])
zulip_bots/zulip_bots/game_handler.py:        user_turn_avatar = "!avatar({})".format(self.players[self.turn])
zulip_bots/zulip_bots/game_handler.py:            user_turn_avatar = "!avatar({})".format(self.players[self.turn])
zulip_bots/zulip_bots/game_handler.py:            winner_avatar = "!avatar({})".format(winner)

The Git integration is the most important; we should migrate it to use the same formatting model we have for the GitHub/GitLab integrations in the webapp.

For the game handler, I suspect we want to just switch to using names, but if that's problematic, we could consider adding a new "show user avatar" syntax that is more HTML-like, e.g. an <avatar> tag.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions