From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by gnuweeb.org (Postfix) with ESMTPS id 7CF597E7BE for ; Mon, 18 Jul 2022 11:20:49 +0000 (UTC) Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=qtaKeayV; dkim-atps=neutral Received: by mail-pf1-f177.google.com with SMTP id 70so10325405pfx.1 for ; Mon, 18 Jul 2022 04:20:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XC3PkfC7HHfqyH4ykrQpnIcZb6alFEv638BYD6Z1C1g=; b=qtaKeayVHm1llg3WM+30ORcyDz0oxZLSOgyz4kqVwiqSIAoH4d9s8G/1FbXpzVmUPs 10jw3uTB/orBkByZp5YZ55ZSA5+D3Ho+IH5dLBRhQWp/I18FJUe+fyGuvn/jQpas7kAD WTgqJDUBhuEcwqsUO2jfFCLpqX3bQYtR3YP2uDR5VpUGHwT4/fCoFqRcCtxdneaTkhwa H5TG0JCbPaEMqHXVKTonsh/h4ssTnOX34DSGj72TwFifL1Crw7gUh1DViy7XZUCzygp4 ZSwvXPoFHRorjKNcdo+QncnjaqokmutAz1bqqDJmzGaAUZykMPNNkLVZNqezgAbCO2sR erdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XC3PkfC7HHfqyH4ykrQpnIcZb6alFEv638BYD6Z1C1g=; b=wGQMYGaIIkwZL2JtX/GkcT2coHtU9tAAFwZts3UWmnlz4v56a+9EqJhEPnsD7h6bfP CBj+ydZFyRK248jC/1MPsfV5wsjnLINhuUuXXEXwSeh2H3ovN2CGwVTw9JKP6HEP8iLQ /Vl09911gImpmAw9DCHfGqM5T5ArLggI3ij6u+skl53krayg4Sosm7tfRDwMQNKDpXZC zwEFXsxXftuL+VnhzwgopOM79vWqgZkKz4lL0UbpGl/JgQqmvbqT8B/W3HjGrdrcCsUR cAao4wqkZfT/iRTThSkeLACDOS7681x8n3LcbMvI+3n4D/Bpa2xhePG4J9AaihyEwXQg SbHA== X-Gm-Message-State: AJIora8OjD6ysrT/nAmnY67fBoniDtKpabHvFb7muztyRXW18GpOHF5f meBgm1yuKkNDmDXRTbnGMbY= X-Google-Smtp-Source: AGRyM1s1pINK6FSqxYJrDQ/q+dhzJBSWjfndVn2unYneJoN8OmYLl4bAZD3rMt+W6uRYlkhzmG8sdA== X-Received: by 2002:aa7:9d8a:0:b0:52a:bb32:528f with SMTP id f10-20020aa79d8a000000b0052abb32528fmr28178617pfq.0.1658143248829; Mon, 18 Jul 2022 04:20:48 -0700 (PDT) Received: from localhost.localdomain ([101.128.125.134]) by smtp.gmail.com with ESMTPSA id z14-20020aa7948e000000b0052ad6d627a6sm8991072pfk.166.2022.07.18.04.20.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 04:20:48 -0700 (PDT) From: Muhammad Rizki To: Ammar Faizi Cc: GNU/Weeb Mailing List , Muhammad Rizki Subject: [PATCH v1 05/11] daemon: Fix raw lore URL on the inline keyboard button Date: Mon, 18 Jul 2022 18:20:01 +0700 Message-Id: <20220718112007.792-6-riskimuhammmad1@gmail.com> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20220718112007.792-1-riskimuhammmad1@gmail.com> References: <20220718112007.792-1-riskimuhammmad1@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: From: Ammar Faizi The current url contains "/raw" at the end of the link. This will give us the raw email. As this button is supposed to be read by users, we shouldn't give the raw version. Remove "/raw" at the end of URL before sending it to Telegram to make it more user friendly. Signed-off-by: Ammar Faizi Signed-off-by: Muhammad Rizki --- daemon/scraper/bot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/scraper/bot.py b/daemon/scraper/bot.py index c62c554..04caab6 100644 --- a/daemon/scraper/bot.py +++ b/daemon/scraper/bot.py @@ -115,6 +115,7 @@ class Bot(): text, files, is_patch = utils.create_template(mail) reply_to = self.get_tg_reply_to(mail, tg_chat_id) + url = str(re.sub(r"/raw$", "", url)) if is_patch: m = await self.__send_patch_msg(mail, tg_chat_id, -- Muhammad Rizki