Skip to content

Commit

Permalink
getMessages: Send client_gravatar.
Browse files Browse the repository at this point in the history
I'd thought we were already doing this, but apparently not. See doc
at https://zulipchat.com/api/get-messages#parameters.
  • Loading branch information
chrisbobbe committed Oct 28, 2020
1 parent aaca582 commit 52a88fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/api/messages/getMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export default async (
num_after: numAfter,
apply_markdown: true,
use_first_unread_anchor: useFirstUnread,
client_gravatar: true,
});
return migrateResponse(response, identityOfAuth(auth));
};
16 changes: 8 additions & 8 deletions src/utils/avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ export class AvatarURL {
// this case; it should be pretty rare.
return GravatarURL.validateAndConstructInstance({ email });
} else if (rawAvatarUrl === null) {
// If we announce `client_gravatar`, which we sometimes do,
// `rawAvatarUrl` might be null. In that case, we take
// responsibility for computing a hash for the user's email and
// using it to form a URL for an avatar served by Gravatar.
// If we announce `client_gravatar`, which we do, `rawAvatarUrl`
// might be null. In that case, we take responsibility for
// computing a hash for the user's email and using it to form a
// URL for an avatar served by Gravatar.
return GravatarURL.validateAndConstructInstance({ email });
} else if (typeof rawAvatarUrl === 'string') {
// If we don't announce `client_gravatar` (which we sometimes
// do), or if the server doesn't have
// EMAIL_ADDRESS_VISIBILITY_EVERYONE set, then `rawAvatarUrl`
// will be the absolute Gravatar URL string.
// If we don't announce `client_gravatar` (which we do), or if
// the server doesn't have EMAIL_ADDRESS_VISIBILITY_EVERYONE
// set, then `rawAvatarUrl` will be the absolute Gravatar URL
// string.
//
// (In the latter case, we won't have real email addresses with
// which to generate the correct hash; see
Expand Down

0 comments on commit 52a88fa

Please sign in to comment.