Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
🔥 Remove Gravatar support (#2780)
Luke Vella28793c2a9c1a
diff --git a/apps/web/src/lib/utils/gravatar.ts b/apps/web/src/lib/utils/gravatar.tsdeleted file mode 100644index f0f6fdcd9..000000000--- a/apps/web/src/lib/utils/gravatar.ts+++ /dev/null@@ -1,21 +0,0 @@-import { createHash } from "node:crypto";-import { isSelfHosted } from "@/lib/constants";--/**- * Builds a Gravatar URL for an email address. Returns `null` when no email is- * provided, or for self-hosted instances — which often must keep personal data- * (email hashes, client IPs) within the EU, so we don't send anything to a- * third party there. `d=404` makes Gravatar respond with a 404 when no avatar- * exists so the client falls back to initials.- */-export function getGravatarUrl(email?: string | null) {- if (!email || isSelfHosted) {- return null;- }-- const hash = createHash("sha256")- .update(email.trim().toLowerCase())- .digest("hex");-- return `https://0.gravatar.com/avatar/${hash}?d=404&s=128&r=g`;-}diff --git a/apps/web/src/trpc/routers/polls/participants.ts b/apps/web/src/trpc/routers/polls/participants.tsindex dbb6c7352..c6a92af53 100644--- a/apps/web/src/trpc/routers/polls/participants.ts+++ b/apps/web/src/trpc/routers/polls/participants.ts@@ -11,7 +11,6 @@ import { getInstanceBranding, getSpaceBranding } from "@/emails/branding";import { getNotificationRecipient } from "@/features/notifications/data";import { hasPollAdminAccess } from "@/features/poll/data";import { track } from "@/lib/posthog";-import { getGravatarUrl } from "@/lib/utils/gravatar";import {createRateLimitMiddleware,publicProcedure,@@ -36,7 +35,7 @@ function createParticipantFullDTO(const { votes, user, ...rest } = participant;return {...rest,- image: user?.image ?? getGravatarUrl(rest.email),+ image: user?.image ?? null,votes,hidden: false,};