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.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from localhost.localdomain (unknown [101.128.125.57]) by gnuweeb.org (Postfix) with ESMTPSA id 0CF207E7BE; Tue, 19 Jul 2022 00:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1658189892; bh=D9dcY6QVSZFzFSB55wECMPFck6+RflS7gQbQtzlO260=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m6yM0JB80lDdS2VLtDGRZ2aj3ej7hacimVwudayiuECQ1YBChQ6TRwrDqSZKGGVpd 6be5r4vb3Dx+mdLvSFg17zZDPP0EqUlAb/9HJ6wbG1PNV5OczrLtm/8on7A++8G7yO 2xLqA2GGsqeFYouSNT+aufK4xYAdmgrEzs/chgMHJwMyHNcEdUSSpXon6rRCg7p61x Q+/UcsTHby/btoQMvi27XIUt8SUb+TJ+B3g10YjeQpA84CUtG4n7cSVGGNlH1ir2S9 Q/iIQm40pZfg/5FJbP1EZcGafK3PSSdFq6beuiINvPToJJA/GRHaPRPkNq72yk+9fi UMj7m2+rc6Wcw== From: Muhammad Rizki To: Ammar Faizi Cc: GNU/Weeb Mailing List , Muhammad Rizki Subject: [PATCH v2 05/18] daemon: Fix raw lore URL on the inline keyboard button Date: Tue, 19 Jul 2022 07:17:31 +0700 Message-Id: <20220719001744.1950-6-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20220719001744.1950-1-kiizuha@gnuweeb.org> References: <20220719001744.1950-1-kiizuha@gnuweeb.org> 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