public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH v3 0/9] Fix some bugs and add some features
@ 2022-10-21 13:45 Muhammad Rizki
  2022-10-21 13:45 ` [PATCH v3 1/9] discord: Add send_text_mail_interaction() Muhammad Rizki
                   ` (8 more replies)
  0 siblings, 9 replies; 40+ messages in thread
From: Muhammad Rizki @ 2022-10-21 13:45 UTC (permalink / raw)
  To: Ammar Faizi
  Cc: Muhammad Rizki, Alviro Iskandar Setiawan, GNU/Weeb Mailing List

Hi sir,

This is v3 revision of fix some bugs and add some features.
This series contain add Platform class enumeration and improve
manage_payload() utils function to handle the transfer encodings.

This series is to fix some bugs, improve some codes and add some new
features. These bugs should have been fixed now, and the email file
attachments should have been removed after all attachments have been
sent.

Known bugs:
1. Email payload extraction result become unicode if the email payload
   contain non-UTF8 characters like chinese, japanese, and similar
   like that.
2. remove_patch() doesn't remove all file attachments properly.

Improvements:
1. Improve remove_patch() to make it all file attachments removed
   after sending them.
2. Fix `/lore {raw atom url}` to add a "telegram" onto the
   create_template() platform parameter.
3. Improvement on extract_body() to ignore whenever the email contain
   text/html content-type.

New features:
1. Add send_text_mail_interaction() for the `/lore {raw atom url}` slash
   command.
2. Add send_patch_mail_interaction() for the `/lore {raw atom url}`
   slash command.
3. Add `/lore {raw atom url}` slash command.
4. Platform class enumeration

There are 9 patches in this series:
- Patch 1 is to add send_text_mail_interaction()
- Patch 2 is to add send_patch_mail_interaction()
- Patch 3 is to add `/lore` slash command
- Patch 4 is to improve remove_patch() code to make it more stable
- Patch 5 is to add manage_payload() for manage email payload extraction
- Patch 6 is to fix the Telegram `/lore` command
- Patch 7 is to improve extract_body() to ignore text/html content-type
- Patch 8 is to add initial Platform class enumeration
- Patch 9 is to use the created Platform class enumeration

How to use:
1. Execute the db.sql file in the daemon directory,
2. Setup .env file, the example is there with suffix .example, this
   file name must remove the suffix name .example,
3. Set up the config.py in each bot directory, such as dscord and
   telegram. The example is there with suffix .example & the file name
   must remove suffix name .example,
4. Run `pip3 install -r requirements.txt` in each bot directory,
5. STORAGE_DIR env value must `storage` to make it work fine,
6. Run the bot by `python3 dc.py` or `python3 tg.py`.

Tested and works, what do you think with this patch?

## Changelog

v2 -> v3:
- Add Platform class enumeration
- Use the old one of fix_utf8_char() instead
- Add Content-Transfer-Encoding handler in manage_payload()

v1 -> v2:
- Remove re.sub() in the fix_utf8_char() when set unescape to True
- Add if statement logic to ignore text/html in the extract_body()

Signed-off-by: Muhammad Rizki <[email protected]>
---

Muhammad Rizki (9):
  discord: Add send_text_mail_interaction()
  discord: Add send_patch_mail_interaction()
  discord: Add get lore mail slash command
  atom: Improve remove_patch()
  atom: add manage_payload()
  telegram: Fix get lore command
  atom: Improve extract_body()
  enum: Add Platform enumeration
  enum: Use the created Platform class enumeration

 daemon/atom/utils.py                          | 57 ++++++++++++-------
 daemon/dscord/gnuweeb/client.py               | 26 ++++++++-
 .../plugins/slash_commands/__init__.py        |  2 +
 .../plugins/slash_commands/get_lore_mail.py   | 40 +++++++++++++
 daemon/dscord/mailer/listener.py              |  7 ++-
 daemon/enums/__init__.py                      |  1 +
 daemon/enums/base.py                          |  9 +++
 daemon/enums/platform.py                      |  7 +++
 daemon/telegram/mailer/listener.py            |  7 +--
 daemon/telegram/packages/client.py            |  3 +-
 .../packages/plugins/commands/scrape.py       |  7 +--
 11 files changed, 133 insertions(+), 33 deletions(-)
 create mode 100644 daemon/dscord/gnuweeb/plugins/slash_commands/get_lore_mail.py
 create mode 100644 daemon/enums/__init__.py
 create mode 100644 daemon/enums/base.py
 create mode 100644 daemon/enums/platform.py


base-commit: d9b20dab81202b93f48d5365ad680796e5839d80
--
Muhammad Rizki

^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2022-10-21 19:25 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-21 13:45 [PATCH v3 0/9] Fix some bugs and add some features Muhammad Rizki
2022-10-21 13:45 ` [PATCH v3 1/9] discord: Add send_text_mail_interaction() Muhammad Rizki
2022-10-21 13:45 ` [PATCH v3 2/9] discord: Add send_patch_mail_interaction() Muhammad Rizki
2022-10-21 13:45 ` [PATCH v3 3/9] discord: Add get lore mail slash command Muhammad Rizki
2022-10-21 13:45 ` [PATCH v3 4/9] atom: Improve remove_patch() Muhammad Rizki
2022-10-21 13:45 ` [PATCH v3 5/9] atom: add manage_payload() Muhammad Rizki
2022-10-21 14:01   ` Ammar Faizi
2022-10-21 14:02     ` Muhammad Rizki
2022-10-21 14:06       ` Ammar Faizi
2022-10-21 14:07         ` Muhammad Rizki
2022-10-21 13:45 ` [PATCH v3 6/9] telegram: Fix get lore command Muhammad Rizki
2022-10-21 13:45 ` [PATCH v3 7/9] atom: Improve extract_body() Muhammad Rizki
2022-10-21 14:34   ` Alviro Iskandar Setiawan
2022-10-21 13:45 ` [PATCH v3 8/9] enum: Add Platform enumeration Muhammad Rizki
2022-10-21 14:02   ` Ammar Faizi
2022-10-21 14:04     ` Muhammad Rizki
2022-10-21 14:21       ` Ammar Faizi
2022-10-21 14:34         ` Muhammad Rizki
2022-10-21 14:45           ` Ammar Faizi
2022-10-21 14:54             ` Muhammad Rizki
2022-10-21 15:07               ` Ammar Faizi
2022-10-21 15:10                 ` Muhammad Rizki
2022-10-21 15:08               ` Ammar Faizi
2022-10-21 15:12                 ` Muhammad Rizki
2022-10-21 15:21                   ` Ammar Faizi
2022-10-21 15:35                     ` Muhammad Rizki
2022-10-21 15:37                       ` Ammar Faizi
2022-10-21 15:54                         ` Muhammad Rizki
2022-10-21 15:59                           ` Ammar Faizi
2022-10-21 15:39                       ` Ammar Faizi
2022-10-21 15:45                         ` Muhammad Rizki
2022-10-21 15:48                           ` Ammar Faizi
2022-10-21 18:29                             ` Muhammad Rizki
2022-10-21 18:53                               ` Ammar Faizi
2022-10-21 19:05                                 ` Alviro Iskandar Setiawan
2022-10-21 19:15                                   ` Ammar Faizi
2022-10-21 19:24                                     ` Alviro Iskandar Setiawan
2022-10-21 19:07                                 ` Muhammad Rizki
2022-10-21 17:03                     ` Alviro Iskandar Setiawan
2022-10-21 13:45 ` [PATCH v3 9/9] enum: Use the created Platform class enumeration Muhammad Rizki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox