Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
4587ceae by wurstsalat at 2022-07-31T21:27:51+02:00
chore: Settings: Use correct type for set_contact_settings
- - - - -
426cc3ee by wurstsalat at 2022-07-31T21:28:18+02:00
chore: ConversationView: Add type annotations
- - - - -
3 changed files:
- gajim/common/modules/contacts.py
- gajim/common/settings.py
- gajim/gtk/conversation/view.py
Changes:
=====================================
gajim/common/modules/contacts.py
=====================================
@@ -20,8 +20,6 @@
from typing import Union
from typing import overload
-from functools import partial
-
import cairo
from nbxmpp.const import Affiliation
from nbxmpp.const import Chatstate
=====================================
gajim/common/settings.py
=====================================
@@ -1029,7 +1029,7 @@ def set_contact_setting(self,
def set_contact_settings(self,
setting: str,
- value: AllContactSettings) -> None:
+ value: SETTING_TYPE) -> None:
for account, acc_settings in self._account_settings.items():
for jid in acc_settings['contact']:
=====================================
gajim/gtk/conversation/view.py
=====================================
@@ -43,6 +43,7 @@
from gajim.common.helpers import AdditionalDataDict
from gajim.common.helpers import to_user_string
from gajim.common.helpers import get_start_of_day
+from gajim.common.modules.contacts import GroupchatContact
from gajim.common.modules.httpupload import HTTPFileTransfer
from gajim.common.storage.archive import ConversationRow
from gajim.common.modules.contacts import BareContact
@@ -183,6 +184,7 @@ def add_muc_user_left(self,
nick: str,
reason: str,
error: bool = False) -> None:
+ assert isinstance(self._contact, GroupchatContact)
if not self._contact.settings.get('print_join_left'):
return
join_left = MUCJoinLeft('muc-user-left',
@@ -193,6 +195,7 @@ def add_muc_user_left(self,
self._insert_message(join_left)
def add_muc_user_joined(self, nick: str) -> None:
+ assert isinstance(self._contact, GroupchatContact)
if not self._contact.settings.get('print_join_left'):
return
join_left = MUCJoinLeft('muc-user-joined',
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/f77737b0049e996e7443d868aecc10348ff15587...426cc3eed3f6d6ba949a21ac06026c4fb05d5dd3
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/f77737b0049e996e7443d868aecc10348ff15587...426cc3eed3f6d6ba949a21ac06026c4fb05d5dd3
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits