Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
afd89099
by lovetox at 2022-01-23T20:33:06+01:00
-
b9335eaf
by lovetox at 2022-01-23T20:33:06+01:00
-
28847ed8
by lovetox at 2022-01-23T20:41:05+01:00
11 changed files:
- gajim/common/app.py
- gajim/common/events.py
- gajim/common/jingle_ft.py
- gajim/common/jingle_session.py
- gajim/common/modules/mam.py
- gajim/common/modules/message.py
- gajim/common/modules/presence.py
- gajim/gtk/chat_list.py
- gajim/gtk/main.py
- gajim/gui_interface.py
- pyrightconfig.json
Changes:
| ... | ... | @@ -93,9 +93,6 @@ def __init__(self): |
| 93 | 93 |
# {account: {room_jid: {'invities': []}}}
|
| 94 | 94 |
automatic_rooms: dict[str, dict[str, dict[str, list[str]]]] = {}
|
| 95 | 95 |
|
| 96 |
-# list of contacts that has just signed in
|
|
| 97 |
-newly_added: dict[str, list[str]] = {}
|
|
| 98 |
- |
|
| 99 | 96 |
# list of contacts that has just signed out
|
| 100 | 97 |
to_be_removed: dict[str, list[str]] = {}
|
| 101 | 98 |
|
| ... | ... | @@ -37,6 +37,21 @@ |
| 37 | 37 |
from gajim.common.client import Client
|
| 38 | 38 |
|
| 39 | 39 |
|
| 40 |
+MainEventT = Union['PresenceReceived',
|
|
| 41 |
+ 'MessageSent',
|
|
| 42 |
+ 'MamMessageReceived',
|
|
| 43 |
+ 'GcMessageReceived',
|
|
| 44 |
+ 'MessageUpdated',
|
|
| 45 |
+ 'ReceiptReceived',
|
|
| 46 |
+ 'DisplayedReceived',
|
|
| 47 |
+ 'MessageError',
|
|
| 48 |
+ 'MucDiscoUpdate',
|
|
| 49 |
+ 'JingleConnectedReceived',
|
|
| 50 |
+ 'JingleDisconnectedReceived',
|
|
| 51 |
+ 'JingleErrorReceived',
|
|
| 52 |
+ 'FileRequestSent']
|
|
| 53 |
+ |
|
| 54 |
+ |
|
| 40 | 55 |
@dataclass
|
| 41 | 56 |
class ApplicationEvent:
|
| 42 | 57 |
name: str
|
| ... | ... | @@ -130,7 +145,7 @@ class MusicTrackChanged(ApplicationEvent): |
| 130 | 145 |
class MessageSent(ApplicationEvent):
|
| 131 | 146 |
name: str = field(init=False, default='message-sent')
|
| 132 | 147 |
account: str
|
| 133 |
- jid: str
|
|
| 148 |
+ jid: JID
|
|
| 134 | 149 |
message: str
|
| 135 | 150 |
message_id: str
|
| 136 | 151 |
chatstate: Optional[str]
|
| ... | ... | @@ -200,7 +215,7 @@ class FileRequestSent(ApplicationEvent): |
| 200 | 215 |
name: str = field(init=False, default='file-request-sent')
|
| 201 | 216 |
account: str
|
| 202 | 217 |
file_props: FileProp
|
| 203 |
- jid: str
|
|
| 218 |
+ jid: JID
|
|
| 204 | 219 |
|
| 205 | 220 |
|
| 206 | 221 |
@dataclass
|
| ... | ... | @@ -342,7 +357,7 @@ class ArchivingIntervalFinished(ApplicationEvent): |
| 342 | 357 |
class MessageUpdated(ApplicationEvent):
|
| 343 | 358 |
name: str = field(init=False, default='message-updated')
|
| 344 | 359 |
account: str
|
| 345 |
- jid: str
|
|
| 360 |
+ jid: JID
|
|
| 346 | 361 |
msgtxt: str
|
| 347 | 362 |
properties: Any
|
| 348 | 363 |
correct_id: str
|
| ... | ... | @@ -352,7 +367,7 @@ class MessageUpdated(ApplicationEvent): |
| 352 | 367 |
class MamMessageReceived(ApplicationEvent):
|
| 353 | 368 |
name: str = field(init=False, default='mam-message-received')
|
| 354 | 369 |
account: str
|
| 355 |
- jid: str
|
|
| 370 |
+ jid: JID
|
|
| 356 | 371 |
msgtxt: str
|
| 357 | 372 |
properties: Any
|
| 358 | 373 |
additional_data: AdditionalDataDict
|
| ... | ... | @@ -368,7 +383,7 @@ class MessageReceived(ApplicationEvent): |
| 368 | 383 |
conn: 'Client'
|
| 369 | 384 |
stanza: Any
|
| 370 | 385 |
account: str
|
| 371 |
- jid: str
|
|
| 386 |
+ jid: JID
|
|
| 372 | 387 |
msgtxt: str
|
| 373 | 388 |
properties: Any
|
| 374 | 389 |
additional_data: AdditionalDataDict
|
| ... | ... | @@ -392,7 +407,7 @@ class GcMessageReceived(MessageReceived): |
| 392 | 407 |
class MessageError(ApplicationEvent):
|
| 393 | 408 |
name: str = field(init=False, default='message-error')
|
| 394 | 409 |
account: str
|
| 395 |
- jid: str
|
|
| 410 |
+ jid: JID
|
|
| 396 | 411 |
room_jid: str
|
| 397 | 412 |
message_id: str
|
| 398 | 413 |
error: Any
|
| ... | ... | @@ -452,7 +467,7 @@ class SearchResultReceivedEvent(ApplicationEvent): |
| 452 | 467 |
class ReceiptReceived(ApplicationEvent):
|
| 453 | 468 |
name: str = field(init=False, default='receipt-received')
|
| 454 | 469 |
account: str
|
| 455 |
- jid: str
|
|
| 470 |
+ jid: JID
|
|
| 456 | 471 |
receipt_id: str
|
| 457 | 472 |
|
| 458 | 473 |
|
| ... | ... | @@ -462,7 +477,7 @@ class JingleEvent(ApplicationEvent): |
| 462 | 477 |
conn: 'Client'
|
| 463 | 478 |
account: str
|
| 464 | 479 |
fjid: str
|
| 465 |
- jid: str
|
|
| 480 |
+ jid: JID
|
|
| 466 | 481 |
sid: str
|
| 467 | 482 |
resource: str
|
| 468 | 483 |
jingle_session: Any
|
| ... | ... | @@ -571,7 +586,7 @@ class PresenceReceived(ApplicationEvent): |
| 571 | 586 |
need_add_in_roster: bool
|
| 572 | 587 |
popup: bool
|
| 573 | 588 |
ptype: str
|
| 574 |
- jid: str
|
|
| 589 |
+ jid: JID
|
|
| 575 | 590 |
resource: str
|
| 576 | 591 |
id_: str
|
| 577 | 592 |
fjid: str
|
| ... | ... | @@ -622,7 +637,7 @@ class FileRequestReceivedEvent(ApplicationEvent): |
| 622 | 637 |
id_: str
|
| 623 | 638 |
fjid: str
|
| 624 | 639 |
account: str
|
| 625 |
- jid: str
|
|
| 640 |
+ jid: JID
|
|
| 626 | 641 |
file_props: FileProp
|
| 627 | 642 |
|
| 628 | 643 |
|
| ... | ... | @@ -181,7 +181,7 @@ def _raise_event(self, stanza, content): |
| 181 | 181 |
fjid = con.get_module('Bytestream')._ft_get_from(stanza)
|
| 182 | 182 |
account = con.name
|
| 183 | 183 |
jid = app.get_jid_without_resource(fjid)
|
| 184 |
- |
|
| 184 |
+ jid = JID.from_string(jid)
|
|
| 185 | 185 |
if not content:
|
| 186 | 186 |
return
|
| 187 | 187 |
|
| ... | ... | @@ -902,7 +902,7 @@ def __transport_accept(self, transport): |
| 902 | 902 |
def _raise_event(self, name: str, **kwargs):
|
| 903 | 903 |
jid, resource = app.get_room_and_nick_from_fjid(
|
| 904 | 904 |
str(self.peerjid))
|
| 905 |
- |
|
| 905 |
+ jid = JID.from_string(jid)
|
|
| 906 | 906 |
event_class = JINGLE_EVENTS[name]
|
| 907 | 907 |
|
| 908 | 908 |
app.ged.raise_event(
|
| ... | ... | @@ -260,7 +260,7 @@ def _mam_message_received(self, _con, stanza, properties): |
| 260 | 260 |
|
| 261 | 261 |
event_attr = {
|
| 262 | 262 |
'account': self._account,
|
| 263 |
- 'jid': str(properties.jid.bare),
|
|
| 263 |
+ 'jid': properties.jid.new_as_bare(),
|
|
| 264 | 264 |
'msgtxt': properties.body,
|
| 265 | 265 |
'properties': properties,
|
| 266 | 266 |
'additional_data': additional_data,
|
| ... | ... | @@ -179,7 +179,7 @@ def _message_received(self, _con, stanza, properties): |
| 179 | 179 |
'account': self._account,
|
| 180 | 180 |
'additional_data': additional_data,
|
| 181 | 181 |
'fjid': fjid,
|
| 182 |
- 'jid': fjid if properties.is_muc_pm else jid,
|
|
| 182 |
+ 'jid': from_ if properties.is_muc_pm else from_.new_as_bare(),
|
|
| 183 | 183 |
'resource': resource,
|
| 184 | 184 |
'stanza_id': stanza_id,
|
| 185 | 185 |
'unique_id': stanza_id or message_id,
|
| ... | ... | @@ -125,7 +125,7 @@ def _presence_received(self, _con, stanza, properties): |
| 125 | 125 |
'need_add_in_roster': False,
|
| 126 | 126 |
'popup': False,
|
| 127 | 127 |
'ptype': properties.type.value,
|
| 128 |
- 'jid': properties.jid.bare,
|
|
| 128 |
+ 'jid': properties.jid.new_as_bare(),
|
|
| 129 | 129 |
'resource': properties.jid.resource,
|
| 130 | 130 |
'id_': properties.id,
|
| 131 | 131 |
'fjid': str(properties.jid),
|
| ... | ... | @@ -495,7 +495,7 @@ def _on_jingle_request_received(self, |
| 495 | 495 |
def _on_file_request_received(self,
|
| 496 | 496 |
event: events.FileRequestReceivedEvent
|
| 497 | 497 |
) -> None:
|
| 498 |
- row = self._chats.get((event.account, JID.from_string(event.jid)))
|
|
| 498 |
+ row = self._chats.get((event.account, event.jid))
|
|
| 499 | 499 |
if row is None:
|
| 500 | 500 |
return
|
| 501 | 501 |
row.set_timestamp(time.time())
|
| ... | ... | @@ -29,23 +29,12 @@ |
| 29 | 29 |
from nbxmpp import JID
|
| 30 | 30 |
|
| 31 | 31 |
from gajim.common import app
|
| 32 |
+from gajim.common import events
|
|
| 32 | 33 |
from gajim.common import ged
|
| 33 | 34 |
from gajim.common.const import Direction
|
| 34 |
-from gajim.common.events import ApplicationEvent
|
|
| 35 |
-from gajim.common.events import MucAdded
|
|
| 36 |
-from gajim.common.events import HttpAuth
|
|
| 37 |
-from gajim.common.events import PasswordRequired
|
|
| 38 |
-from gajim.common.events import PlainConnection
|
|
| 39 |
-from gajim.common.events import RosterItemExchangeEvent
|
|
| 40 |
-from gajim.common.events import AllowGajimUpdateCheck
|
|
| 41 |
-from gajim.common.events import GajimUpdateAvailable
|
|
| 42 |
-from gajim.common.events import AccountEnabled
|
|
| 43 |
-from gajim.common.events import AccountDisabled
|
|
| 44 |
-from gajim.common.events import ShowChanged
|
|
| 45 |
-from gajim.common.events import SignedIn
|
|
| 35 |
+from gajim.common.ged import EventHelper
|
|
| 46 | 36 |
from gajim.common.helpers import ask_for_status_message
|
| 47 | 37 |
from gajim.common.i18n import _
|
| 48 |
-from gajim.common.ged import EventHelper
|
|
| 49 | 38 |
from gajim.common.modules.bytestream import is_transfer_active
|
| 50 | 39 |
|
| 51 | 40 |
from .account_side_bar import AccountSideBar
|
| ... | ... | @@ -110,22 +99,19 @@ def __init__(self) -> None: |
| 110 | 99 |
self.register_events([
|
| 111 | 100 |
('presence-received', ged.GUI1, self._on_event),
|
| 112 | 101 |
('message-sent', ged.GUI1, self._on_event),
|
| 113 |
- ('message-received', ged.CORE, self._on_event),
|
|
| 102 |
+ ('message-received', ged.CORE, self._on_message_received),
|
|
| 114 | 103 |
('mam-message-received', ged.CORE, self._on_event),
|
| 115 | 104 |
('gc-message-received', ged.CORE, self._on_event),
|
| 116 | 105 |
('message-updated', ged.CORE, self._on_event),
|
| 117 | 106 |
('receipt-received', ged.GUI1, self._on_event),
|
| 118 | 107 |
('displayed-received', ged.GUI1, self._on_event),
|
| 119 | 108 |
('message-error', ged.GUI1, self._on_event),
|
| 120 |
- ('muc-creation-failed', ged.GUI1, self._on_event),
|
|
| 121 |
- ('muc-self-presence', ged.GUI1, self._on_event),
|
|
| 122 |
- ('muc-voice-request', ged.GUI1, self._on_event),
|
|
| 123 | 109 |
('muc-disco-update', ged.GUI1, self._on_event),
|
| 124 |
- ('jingle-request-received', ged.GUI1, self._on_event),
|
|
| 110 |
+ ('jingle-request-received', ged.GUI1, self._on_jingle_request),
|
|
| 125 | 111 |
('jingle-connected-received', ged.GUI1, self._on_event),
|
| 126 | 112 |
('jingle-disconnected-received', ged.GUI1, self._on_event),
|
| 127 | 113 |
('jingle-error-received', ged.GUI1, self._on_event),
|
| 128 |
- ('file-request-received', ged.GUI1, self._on_event),
|
|
| 114 |
+ ('file-request-received', ged.GUI1, self._on_file_request),
|
|
| 129 | 115 |
('file-request-sent', ged.GUI1, self._on_event),
|
| 130 | 116 |
('our-show', ged.GUI1, self._on_our_show),
|
| 131 | 117 |
('signed-in', ged.GUI1, self._on_signed_in),
|
| ... | ... | @@ -178,11 +164,11 @@ def _prepare_window(self) -> None: |
| 178 | 164 |
app.settings.get('trayicon') != 'always'):
|
| 179 | 165 |
self.show_all()
|
| 180 | 166 |
|
| 181 |
- def _on_account_enabled(self, event: AccountEnabled) -> None:
|
|
| 167 |
+ def _on_account_enabled(self, event: events.AccountEnabled) -> None:
|
|
| 182 | 168 |
self._account_side_bar.add_account(event.account)
|
| 183 | 169 |
self._main_stack.add_account_page(event.account)
|
| 184 | 170 |
|
| 185 |
- def _on_account_disabled(self, event: AccountDisabled) -> None:
|
|
| 171 |
+ def _on_account_disabled(self, event: events.AccountDisabled) -> None:
|
|
| 186 | 172 |
workspace_id = self._workspace_side_bar.get_first_workspace()
|
| 187 | 173 |
self.activate_workspace(workspace_id)
|
| 188 | 174 |
self._account_side_bar.remove_account(event.account)
|
| ... | ... | @@ -190,24 +176,26 @@ def _on_account_disabled(self, event: AccountDisabled) -> None: |
| 190 | 176 |
self._main_stack.remove_chats_for_account(event.account)
|
| 191 | 177 |
|
| 192 | 178 |
@staticmethod
|
| 193 |
- def _on_our_show(event: ShowChanged) -> None:
|
|
| 179 |
+ def _on_our_show(event: events.ShowChanged) -> None:
|
|
| 194 | 180 |
if event.show == 'offline':
|
| 195 | 181 |
app.app.set_account_actions_state(event.account)
|
| 196 | 182 |
app.app.update_app_actions_state()
|
| 197 | 183 |
|
| 198 | 184 |
@staticmethod
|
| 199 |
- def _on_signed_in(event: SignedIn) -> None:
|
|
| 185 |
+ def _on_signed_in(event: events.SignedIn) -> None:
|
|
| 200 | 186 |
app.app.set_account_actions_state(event.account, True)
|
| 201 | 187 |
app.app.update_app_actions_state()
|
| 202 | 188 |
|
| 203 |
- def _on_allow_gajim_update(self, event: AllowGajimUpdateCheck) -> None:
|
|
| 189 |
+ def _on_allow_gajim_update(self,
|
|
| 190 |
+ event: events.AllowGajimUpdateCheck) -> None:
|
|
| 204 | 191 |
self.add_app_message(event.name)
|
| 205 | 192 |
|
| 206 |
- def _on_gajim_update_available(self, event: GajimUpdateAvailable) -> None:
|
|
| 193 |
+ def _on_gajim_update_available(self,
|
|
| 194 |
+ event: events.GajimUpdateAvailable) -> None:
|
|
| 207 | 195 |
self.add_app_message(event.name, event.version)
|
| 208 | 196 |
|
| 209 | 197 |
@staticmethod
|
| 210 |
- def _on_roster_item_exchange(event: RosterItemExchangeEvent) -> None:
|
|
| 198 |
+ def _on_roster_item_exchange(event: events.RosterItemExchangeEvent) -> None:
|
|
| 211 | 199 |
open_window('RosterItemExchange',
|
| 212 | 200 |
account=event.client.account,
|
| 213 | 201 |
action=event.action,
|
| ... | ... | @@ -215,7 +203,7 @@ def _on_roster_item_exchange(event: RosterItemExchangeEvent) -> None: |
| 215 | 203 |
jid_from=event.jid)
|
| 216 | 204 |
|
| 217 | 205 |
@staticmethod
|
| 218 |
- def _on_plain_connection(event: PlainConnection) -> None:
|
|
| 206 |
+ def _on_plain_connection(event: events.PlainConnection) -> None:
|
|
| 219 | 207 |
ConfirmationDialog(
|
| 220 | 208 |
_('Insecure Connection'),
|
| 221 | 209 |
_('Insecure Connection'),
|
| ... | ... | @@ -233,11 +221,11 @@ def _on_plain_connection(event: PlainConnection) -> None: |
| 233 | 221 |
callback=event.connect)]).show()
|
| 234 | 222 |
|
| 235 | 223 |
@staticmethod
|
| 236 |
- def _on_password_required(event: PasswordRequired) -> None:
|
|
| 224 |
+ def _on_password_required(event: events.PasswordRequired) -> None:
|
|
| 237 | 225 |
open_window('PasswordDialog', event=event)
|
| 238 | 226 |
|
| 239 | 227 |
@staticmethod
|
| 240 |
- def _on_http_auth(event: HttpAuth) -> None:
|
|
| 228 |
+ def _on_http_auth(event: events.HttpAuth) -> None:
|
|
| 241 | 229 |
def _response(answer: str) -> None:
|
| 242 | 230 |
event.client.get_module('HTTPAuth').build_http_auth_answer(
|
| 243 | 231 |
event.stanza, answer)
|
| ... | ... | @@ -267,7 +255,7 @@ def _response(answer: str) -> None: |
| 267 | 255 |
callback=_response,
|
| 268 | 256 |
args=['yes'])]).show()
|
| 269 | 257 |
|
| 270 |
- def _on_muc_added(self, event: MucAdded) -> None:
|
|
| 258 |
+ def _on_muc_added(self, event: events.MucAdded) -> None:
|
|
| 271 | 259 |
if self.chat_exists(event.account, event.jid):
|
| 272 | 260 |
return
|
| 273 | 261 |
|
| ... | ... | @@ -523,7 +511,7 @@ def get_chat_list(self, workspace_id: str) -> ChatList: |
| 523 | 511 |
|
| 524 | 512 |
def _add_group_chat(self,
|
| 525 | 513 |
_action: Gio.SimpleAction,
|
| 526 |
- param: Optional[GLib.Variant]) -> None:
|
|
| 514 |
+ param: GLib.Variant) -> None:
|
|
| 527 | 515 |
|
| 528 | 516 |
account, jid, select = param.unpack()
|
| 529 | 517 |
self.add_group_chat(account, JID.from_string(jid), select)
|
| ... | ... | @@ -755,35 +743,41 @@ def _load_chats(self) -> None: |
| 755 | 743 |
|
| 756 | 744 |
self._set_startup_finished()
|
| 757 | 745 |
|
| 758 |
- def _on_event(self, event: ApplicationEvent) -> None:
|
|
| 759 |
- if event.name == 'update-roster-avatar':
|
|
| 746 |
+ def _on_event(self, event: events.MainEventT) -> None:
|
|
| 747 |
+ if not self.chat_exists(event.account, event.jid):
|
|
| 760 | 748 |
return
|
| 761 | 749 |
|
| 750 |
+ self._main_stack.process_event(event)
|
|
| 751 |
+ |
|
| 752 |
+ def _on_message_received(self, event: events.MessageReceived) -> None:
|
|
| 762 | 753 |
if not self.chat_exists(event.account, event.jid):
|
| 763 |
- if event.name == 'message-received':
|
|
| 764 |
- if not event.properties.body:
|
|
| 765 |
- # Don’t open control on chatstate etc.
|
|
| 766 |
- return
|
|
| 767 |
- if event.properties.is_muc_pm:
|
|
| 768 |
- self.add_private_chat(event.account,
|
|
| 769 |
- event.properties.jid)
|
|
| 770 |
- else:
|
|
| 771 |
- jid = event.properties.jid.new_as_bare()
|
|
| 772 |
- self.add_chat(event.account, jid, 'contact')
|
|
| 773 |
- elif event.name == 'jingle-request-received':
|
|
| 774 |
- content_types = []
|
|
| 775 |
- for item in event.contents:
|
|
| 776 |
- content_types.append(item.media)
|
|
| 777 |
- if 'audio' in content_types or 'video' in content_types:
|
|
| 778 |
- # AV Call received, open chat control
|
|
| 779 |
- self.add_chat(event.account, event.jid, 'contact')
|
|
| 780 |
- elif event.name == 'file-request-received':
|
|
| 781 |
- # Jingle file transfer, open chat control
|
|
| 782 |
- self.add_chat(event.account, event.jid, 'contact')
|
|
| 783 |
- else:
|
|
| 784 |
- # No chat is open, dont handle any gui events
|
|
| 754 |
+ if not event.properties.body:
|
|
| 755 |
+ # Don’t open control on chatstate etc.
|
|
| 785 | 756 |
return
|
| 786 | 757 |
|
| 758 |
+ if event.properties.is_muc_pm:
|
|
| 759 |
+ self.add_private_chat(event.account,
|
|
| 760 |
+ event.properties.jid)
|
|
| 761 |
+ |
|
| 762 |
+ else:
|
|
| 763 |
+ jid = event.properties.jid.new_as_bare()
|
|
| 764 |
+ self.add_chat(event.account, jid, 'contact')
|
|
| 765 |
+ |
|
| 766 |
+ self._main_stack.process_event(event)
|
|
| 767 |
+ |
|
| 768 |
+ def _on_jingle_request(self, event: events.JingleRequestReceived) -> None:
|
|
| 769 |
+ if not self.chat_exists(event.account, event.jid):
|
|
| 770 |
+ for item in event.contents:
|
|
| 771 |
+ if item.media in ('audio', 'video'):
|
|
| 772 |
+ self.add_chat(event.account, event.jid, 'contact')
|
|
| 773 |
+ break
|
|
| 774 |
+ |
|
| 775 |
+ self._main_stack.process_event(event)
|
|
| 776 |
+ |
|
| 777 |
+ def _on_file_request(self, event: events.FileRequestReceivedEvent) -> None:
|
|
| 778 |
+ if not self.chat_exists(event.account, event.jid):
|
|
| 779 |
+ self.add_chat(event.account, event.jid, 'contact')
|
|
| 780 |
+ |
|
| 787 | 781 |
self._main_stack.process_event(event)
|
| 788 | 782 |
|
| 789 | 783 |
def quit(self) -> None:
|
| ... | ... | @@ -807,8 +801,7 @@ def on_continue2(message: Optional[str]) -> None: |
| 807 | 801 |
app.app.start_shutdown(message=message)
|
| 808 | 802 |
return
|
| 809 | 803 |
# check if there is an active file transfer
|
| 810 |
- files_props = app.interface.instances['file_transfers'].\
|
|
| 811 |
- files_props
|
|
| 804 |
+ files_props = app.interface.instances['file_transfers'].files_props
|
|
| 812 | 805 |
transfer_active = False
|
| 813 | 806 |
for x in files_props:
|
| 814 | 807 |
for y in files_props[x]:
|
| ... | ... | @@ -118,7 +118,7 @@ def __init__(self): |
| 118 | 118 |
self._create_core_handlers_list()
|
| 119 | 119 |
self._register_core_handlers()
|
| 120 | 120 |
|
| 121 |
- self.instances = {}
|
|
| 121 |
+ self.instances: dict[str, Any] = {}
|
|
| 122 | 122 |
|
| 123 | 123 |
for acc in app.connections:
|
| 124 | 124 |
self.instances[acc] = {
|
| ... | ... | @@ -126,7 +126,6 @@ def __init__(self): |
| 126 | 126 |
'disco': {}
|
| 127 | 127 |
}
|
| 128 | 128 |
app.automatic_rooms[acc] = {}
|
| 129 |
- app.newly_added[acc] = []
|
|
| 130 | 129 |
app.to_be_removed[acc] = []
|
| 131 | 130 |
app.nicks[acc] = app.settings.get_account_setting(acc, 'name')
|
| 132 | 131 |
|
| ... | ... | @@ -531,7 +530,6 @@ def enable_account(self, account: str) -> None: |
| 531 | 530 |
}
|
| 532 | 531 |
|
| 533 | 532 |
app.automatic_rooms[account] = {}
|
| 534 |
- app.newly_added[account] = []
|
|
| 535 | 533 |
app.to_be_removed[account] = []
|
| 536 | 534 |
app.nicks[account] = app.settings.get_account_setting(account, 'name')
|
| 537 | 535 |
app.settings.set_account_setting(account, 'active', True)
|
| ... | ... | @@ -566,7 +564,6 @@ def disable_account(self, account: str) -> None: |
| 566 | 564 |
del app.nicks[account]
|
| 567 | 565 |
del app.automatic_rooms[account]
|
| 568 | 566 |
del app.to_be_removed[account]
|
| 569 |
- del app.newly_added[account]
|
|
| 570 | 567 |
|
| 571 | 568 |
def remove_account(self, account: str) -> None:
|
| 572 | 569 |
if app.settings.get_account_setting(account, 'active'):
|
| ... | ... | @@ -60,6 +60,7 @@ |
| 60 | 60 |
"gajim/gtk/groupchat_nick.py",
|
| 61 | 61 |
"gajim/gtk/groupchat_settings.py",
|
| 62 | 62 |
"gajim/gtk/groupchat_state.py",
|
| 63 |
+ "gajim/gtk/main.py",
|
|
| 63 | 64 |
"gajim/gtk/main_stack.py",
|
| 64 | 65 |
"gajim/gtk/manage_sounds.py",
|
| 65 | 66 |
"gajim/gtk/notification.py",
|