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=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [192.168.1.2] (unknown [101.128.126.198]) by gnuweeb.org (Postfix) with ESMTPSA id BB441804D1; Mon, 7 Nov 2022 01:24:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1667784270; bh=6JwNPrYKJeOKUV6E64BFxtzntSjN9WHwEOq9nF2Wn7Y=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=HRoVr1diqpedbwj28sr7D0Rb+8sETlTFxea4pDm9O9gd3payVomYWLnTcJZwWs7tq vEYEDAHJRQv0/hlXhthT4O2uNSlsxP5LgYvHF5HJ4Al5L54SyimTZMMbCJe3f7xfuh t2ydcUjPlPG1jWHqNNgTTVZ7gORQoh3HuoiHzidf5Z4qXYVBCWdSN1FctJWm3jPQ1T IzO+XrzrchjeVTDnPlHNQhldfxUWIwGIjUvn4TKazF7R/XqmYex33kQ7bmei6u++4i L6qSu9IPn11X9Yun7Jp+F80xNXQi9YK9VDXenp3UZ0gloDg3KH1v9HWkMUaezut7uM nlsARY2PP4Oyw== Message-ID: Date: Mon, 7 Nov 2022 08:24:26 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH v1 03/16] utils: Change on max for TO/CC header list Content-Language: en-US To: Ammar Faizi Cc: Alviro Iskandar Setiawan , GNU/Weeb Mailing List References: <20221104180931.3852-1-kiizuha@gnuweeb.org> <20221104180931.3852-4-kiizuha@gnuweeb.org> <0c2c7b6e-3b0c-db90-7202-54e468331565@gnuweeb.org> <064c6352-4b26-c859-caec-25015642bd7a@gnuweeb.org> From: Muhammad Rizki In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 07/11/2022 08.15, Ammar Faizi wrote: > On 11/7/22 8:08 AM, Muhammad Rizki wrote: >> When I tested the bot, one of the patch email causing >> MediaCaptionTooLong error, the problem is from the CC is too long, >> while I set the max to 15 it's fixed the error. > > Yes, it works with your case. But how do you guarantee that 15 participants > always yield a total of characters less than 1024? Uhh, sorry my bad. I could just use this method instead, like the non-patch substr. # from the atom/utils.py in create_template() if is_patch: ret += content if len(ret) >= substr: ret = ret[:substr] + "..." else: ret += content.strip().replace("\t", " ") if len(ret) >= substr: ret = ret[:substr] + "..."