hikariatama / Hikka

The most fresh and updateable developer-oriented Telegram userbot
https://hikka.pw
GNU Affero General Public License v3.0
318 stars 516 forks source link

Remove adware #80

Closed rfoxxxy closed 1 year ago

rfoxxxy commented 1 year ago

Since the Hikka userbot is based on FTG, GeekTG, etc., and there are no so-called "advertising Trojans" in them, it also shouldn’t have functions that make the user a slave of his own bot, forcing him to subscribe to the channel to install module and automatically putting reactions to posts with modules in the developer channel of these modules.

This functionality isn’t spelled out anywhere (for the end user), except in the code and changelogs, therefore he does not even think about it when he installs the bot according to the instructions.

Based on the absence of this functionality in other userbots on which Hikka is based, you should equate them and not add functionality hidden from the end user without notifying him in advance even before installing the userbot, or notify the user of the presence of such functionality in any most noticeable way, or implement the possibility of disabling this functionality if user doesn't want to subscribe on any channels, and even more so doesn’t want to put reactions without knowing it.

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.30%.

Quality metrics Before After Change
Complexity 29.46 😞 29.50 😞 0.04 👎
Method Length 93.59 🙂 93.05 🙂 -0.54 👍
Working memory 6.41 🙂 6.41 🙂 0.00
Quality 49.19% 😞 48.89% 😞 -0.30% 👎
Other metrics Before After Change
Lines 4140 4077 -63
Changed files Quality Before Quality After Quality Change
hikka/loader.py 48.51% 😞 48.79% 😞 0.28% 👍
hikka/types.py 81.17% ⭐ 81.17% ⭐ 0.00%
hikka/modules/hikka_settings.py 50.67% 🙂 49.19% 😞 -1.48% 👎
hikka/modules/loader.py 33.46% 😞 32.30% 😞 -1.16% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
hikka/modules/loader.py LoaderMod.load_module 146 ⛔ 1890 ⛔ 0.02% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
hikka/loader.py Modules._mod_import_lib 49 ⛔ 808 ⛔ 5.06% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
hikka/loader.py replace_all_refs 67 ⛔ 317 ⛔ 6.20% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
hikka/modules/hikka_settings.py HikkaSettingsMod.invoke 19 😞 450 ⛔ 20 ⛔ 21.08% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
hikka/loader.py translatable_docstring 27 😞 290 ⛔ 22.25% ⛔ Refactor to reduce nesting. Try splitting into smaller methods

Legend and Explanation

The emojis denote the absolute quality of the code:

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

SecondThundeR commented 1 year ago

I agree with the author of PR, the fact of having such implicit, more like hidden, functionality puts into question the credibility of the author and his projects. After all, no one knows for sure what may appear in the next commit for the end user (perhaps even the appearance of a hidden user session stealer, which the user will not be able to guess about at all). Either you should put it in README with a big header and in the beginning or not add such functionality at all

hikariatama commented 1 year ago

I can agree with only in aspect of reactions - they are not listed anywhere. But if you read the code, removed by this PR you can notice, that this function (omg) asks user to join the channel, which is required for module to work. Hikka does not join any channels without your knowledge \ explicit action (e.g. .support). I will add warning about automatic reactions to README.md. This functionality will not be removed, because now it's the only credit to module authors.

And, btw, removing the entire blocks of source code is not the right solution. This totally breaks the full concept of backward compatibility and is kinda useless, because it breaks things...