message: Remove unused old gravatar_hash field from message dicts.

This was deprecated and replaced some 4 years ago.
This commit is contained in:
Tim Abbott 2017-05-09 22:20:47 -07:00
parent e3505bd5ae
commit 9f7236eec1
6 changed files with 1 additions and 9 deletions

View File

@ -83,7 +83,6 @@
'sender_short_name': 'othello-bot',
'sender_realm_str': 'example',
'content': 'Something is rotten in the state of Denmark.',
'gravatar_hash': '17d93357cca1e793739836ecbc7a9bf7',
'recipient_id': 12314,
'client': 'website',
'subject_links': [],
@ -108,7 +107,6 @@
'sender_short_name': 'othello-bot',
'sender_realm_str': 'example',
'content': 'I come not, friends, to steal away your hearts.',
'gravatar_hash': '17d93357cca1e793739836ecbc7a9bf7',
'recipient_id': 18391,
'client': 'website',
'subject_links': [],

View File

@ -79,7 +79,7 @@ for msg in result['messages']:
if msg['type'] != 'stream':
continue
# Remove extraneous metadata
for k in ['flags', 'edit_history', 'subject_links', 'gravatar_hash',
for k in ['flags', 'edit_history', 'subject_links',
'avatar_url', 'recipient_id', 'sender_short_name',
'content_type', 'client', 'sender_realm_str', 'id', 'type']:
msg.pop(k, None)

View File

@ -29,7 +29,6 @@ import requests
from django.core import mail
from django.conf import settings
from zerver.lib.avatar_hash import gravatar_hash
from markdown.extensions import codehilite
from zerver.lib.bugdown import fenced_code
from zerver.lib.bugdown.fenced_code import FENCE_RE

View File

@ -10,7 +10,6 @@ from six import binary_type
from typing import Set, Text
from zerver.lib.avatar import avatar_url_from_dict
from zerver.lib.avatar_hash import gravatar_hash
import zerver.lib.bugdown as bugdown
from zerver.lib.cache import cache_with_key, to_dict_cache_key
from zerver.lib.request import JsonableError
@ -194,7 +193,6 @@ class MessageDict(object):
recipient_id = recipient_id,
subject = subject,
timestamp = datetime_to_timestamp(pub_date),
gravatar_hash = gravatar_hash(sender_email), # Deprecated June 2013
avatar_url = avatar_url,
client = sending_client_name)

View File

@ -444,7 +444,6 @@ class EventsRegisterTest(ZulipTestCase):
('content', check_string),
('content_type', equals('text/html')),
('display_recipient', check_string),
('gravatar_hash', check_string),
('is_mentioned', check_bool),
('reactions', check_list(None)),
('recipient_id', check_int),

View File

@ -413,8 +413,6 @@ class GetOldMessagesTest(ZulipTestCase):
"avatar_url", "recipient_id", "sender_full_name",
"sender_short_name", "timestamp", "reactions"):
self.assertIn(field, message)
# TODO: deprecate soon in favor of avatar_url
self.assertIn('gravatar_hash', message)
return result