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.94]) by gnuweeb.org (Postfix) with ESMTPSA id 10E4A7E254; Thu, 21 Jul 2022 23:30:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1658446206; bh=D9dcY6QVSZFzFSB55wECMPFck6+RflS7gQbQtzlO260=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D4mgG9A0Ucy2zBMJI0/ffWOwQjGyGS9Sq+kWSh50KPOxs6nhjfva2PSn4256UvIfs C6I9OWthkHfeBopkyEpbbX+o7WYB1xTxKWd8ygFbFz1qWbdf3acQlw+j+XSSUNDxak F74dxIpzo+a5qrtnGe6IO79t2EJmw/RHnN+Gx6JwK95L6m01t6EI15eHeuqXfwv4pE 6zIoNSCkELm1QBLtdNuEDTIwgkUKNt3SIwZSt0jCUzcb89TyYsqSESBJkjlt1vr7lI 3RDBCM7b5yyzcdQ1OiFTEeaSg+wbXMMyyH2sLWzD1IAf09WhHHn4SoCC21ravYKyMD L3RgZzSnFLj5A== From: Muhammad Rizki To: Ammar Faizi Cc: GNU/Weeb Mailing List , Muhammad Rizki Subject: [PATCH v3 05/17] daemon: Fix raw lore URL on the inline keyboard button Date: Fri, 22 Jul 2022 06:29:26 +0700 Message-Id: <20220721232938.503-6-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20220721232938.503-1-kiizuha@gnuweeb.org> References: <20220721232938.503-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