From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#39965: [PATCH] Add support for multiple gravatar-like services Date: Tue, 17 Mar 2020 14:51:22 +0100 Message-ID: References: <20200307001141.10771-1-philip@warpmail.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="70709"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39965@debbugs.gnu.org To: Philip K. Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 17 14:52:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jECde-000IFc-O4 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Mar 2020 14:52:10 +0100 Original-Received: from localhost ([::1]:33192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jECdd-0007Gf-Nk for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Mar 2020 09:52:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58858) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jECdX-0007GZ-EA for bug-gnu-emacs@gnu.org; Tue, 17 Mar 2020 09:52:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jECdW-0000yt-A4 for bug-gnu-emacs@gnu.org; Tue, 17 Mar 2020 09:52:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60559) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jECdW-0000yl-4O for bug-gnu-emacs@gnu.org; Tue, 17 Mar 2020 09:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jECdW-0007Bp-2k for bug-gnu-emacs@gnu.org; Tue, 17 Mar 2020 09:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Mar 2020 13:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39965 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 39965-submit@debbugs.gnu.org id=B39965.158445309427594 (code B ref 39965); Tue, 17 Mar 2020 13:52:02 +0000 Original-Received: (at 39965) by debbugs.gnu.org; 17 Mar 2020 13:51:34 +0000 Original-Received: from localhost ([127.0.0.1]:38299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jECd4-0007Az-4m for submit@debbugs.gnu.org; Tue, 17 Mar 2020 09:51:34 -0400 Original-Received: from mail-wr1-f44.google.com ([209.85.221.44]:34314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jECd2-0007Am-Dx for 39965@debbugs.gnu.org; Tue, 17 Mar 2020 09:51:33 -0400 Original-Received: by mail-wr1-f44.google.com with SMTP id z15so25744743wrl.1 for <39965@debbugs.gnu.org>; Tue, 17 Mar 2020 06:51:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=IXbJB45oLxkvEqQinMfIYGMX8l15x40UB9eD02nydnI=; b=APMFWolAnuWWfcUyYk32s756SWA1Wl5b9zBz3jDNbNQKngEDmy8gUlpFZUTcxsu6Nw pFKjAzydFBTaTeKLyMFuvQLHTcsWYEG49umZOIIZ473Bqr4KGDy6Fmpq3UxrxL6VDfWX mTXM16iEsenzIUa09cfcHna+YoBpOoBR/0LIaGfjMX1UoggIdtRa4ezroEJ2MQQYxdoO T/wxuw2yy5GuTSV27D2xeXLwQQtXMS2ire15510aFSP5Tn7QJGqXlbYp3bpLwQ7tByNM FD9MV3fhsnrECy4FkqX2f7K1Z+7dSoFfK1CxM2vYPcaqGR0h3FGkqYeqip0UtQ/6rnUh qwUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=IXbJB45oLxkvEqQinMfIYGMX8l15x40UB9eD02nydnI=; b=k75DzNkv0ij+jWF/NUIlGZuUbKR6nKgWSJc7WGfyjpVlkATvwuSsrdpGp3SRo2DEbC pINgdnMinEqh+5WNX3YJDIZEdmXvPGQpn4bdfDB7JPnHQyoLSgWQaIllv4vch0V///Sl vn1R0lcTgZCWaJimqxUMlZvQZdwAqpFwasNqXc37K290KEOmSLwsC59/hHudfihtdtvi hIlPatR2jsU3nSBjKtg2j07z+1L2MJJ2EdL8rXCia8F8cnf76hYkv8GWASXCopSYxPF2 tVsZUb/Q/nN513Nj1ZMuLGqz3xS36NoQrjZSiRPaCgsLBTpCV7PN81rhyXxfseGho7oh /Y6g== X-Gm-Message-State: ANhLgQ3XeYVsRyhy4MfjzXZf6TOVogkaax6hztDw6fv04ZFSv8kPP1MM 1cR5OWtJlRWih8VZ9zUcexbMeSnI X-Google-Smtp-Source: ADFU+vtuEiWtZnjLOCXI0EFXLaE3GmfF4ndaZfQDpdjaNf2NY1VslH0bP9beF2oPK0hyxlXkTyvIMA== X-Received: by 2002:adf:9e8b:: with SMTP id a11mr6069018wrf.32.1584453086007; Tue, 17 Mar 2020 06:51:26 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:7800:e590:5d04:163a]) by smtp.gmail.com with ESMTPSA id y80sm4282927wmc.45.2020.03.17.06.51.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2020 06:51:24 -0700 (PDT) In-Reply-To: (Philip K.'s message of "Tue, 10 Mar 2020 10:31:27 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177449 Archived-At: >>>>> On Tue, 10 Mar 2020 10:31:27 +0100, Philip K. said: Philip> Sorry for the delay, I hope the commit message is ok now. Sorry for my delay in getting back to you. I have one question: Philip> +(defun gravatar--service-libravatar (addr) Philip> + "Find domain that hosts avatars for email address ADDR." Philip> + ;; implements https://wiki.libravatar.org/api/ Philip> + (require 'dns) Philip> + (let* ((domain (save-match-data Philip> + (unless (string-match ".+@\\(.+\\)" addr) Philip> + (error "%s is not an email address" addr)) Philip> + (match-string 1 addr))) Philip> + (result (dns-query (concat "_avatars._tcp." domain) '= SRV))) Philip> + (if result Philip> + (concat "http://" result "/address") Philip> + "https://seccdn.libravatar.org/avatar"))) Here you do the SRV lookup for the TCP service, but I believe there=CA=BCs an HTTPS service type available as well. Could you look that up first, then the TCP one, then fall back to the default libravatar URL? Robert