- Fix custom security rules cleaner
- Fix: use old lib if its version is higher than new one
pull/1/head
hikariatama 2022-08-21 16:53:22 +00:00
parent 33c3d3b72b
commit 1ba0d34c7e
3 changed files with 4 additions and 3 deletions

View File

@ -9,6 +9,7 @@
- Fix `.uninstall_hikka` being accessible by sudo
- Fix `utils.find_caller` for :method:`hikka.inline.utils.Utils._find_caller_sec_map`
- Fix `.eval`
- Fix: use old lib if its version is higher than new one
- Add more animated emojis to modules
- Add targeted security for users and chats (`.tsec`)
- Add support for `tg_level` in `.config Tester`

View File

@ -1149,7 +1149,7 @@ class Modules:
if old_lib.name == lib_obj.name and (
not isinstance(getattr(old_lib, "version", None), tuple)
and not isinstance(getattr(lib_obj, "version", None), tuple)
or old_lib.version == lib_obj.version
or old_lib.version >= lib_obj.version
):
logging.debug(f"Using existing instance of library {old_lib.name}")
return old_lib

View File

@ -173,11 +173,11 @@ class SecurityManager:
self._support = list(set(self._db.get(__name__, "support", []).copy()))
for info in self._tsec_user.copy():
if info["expires"] < time.time():
self._tsec_user.pop(info)
self._tsec_user.remove(info)
for info in self._tsec_chat.copy():
if info["expires"] < time.time():
self._tsec_chat.pop(info)
self._tsec_chat.remove(info)
async def init(self, client):
self._client = client