Commit 161e7203 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Client: Add type annotations

parent 5e448f25
......@@ -55,6 +55,7 @@
from gajim.common.idle import Monitor
from gajim.common.idle import IdleMonitorManager
from gajim.common.i18n import _
from gajim.common.structs import OutgoingMessage
from gajim.gui.util import open_window
......@@ -471,13 +472,13 @@ def _finish_connect(self) -> None:
app.ged.raise_event(SignedIn(account=self._account, conn=self))
modules.send_stored_publish(self._account)
def send_stanza(self, stanza):
def send_stanza(self, stanza: Any) -> None:
"""
Send a stanza untouched
"""
return self._client.send_stanza(stanza)
def send_message(self, message):
def send_message(self, message: OutgoingMessage) -> None:
if not self._state.is_available:
log.warning('Trying to send message while offline')
return
......@@ -504,7 +505,7 @@ def send_message(self, message):
message,
self._send_message)
def _send_message(self, message):
def _send_message(self, message: OutgoingMessage) -> None:
message.set_sent_timestamp()
message.message_id = self.send_stanza(message.stanza)
......@@ -525,7 +526,7 @@ def _send_message(self, message):
self.get_module('Message').log_message(message)
def send_messages(self, jids, message):
def send_messages(self, jids: list[JID], message: OutgoingMessage) -> None:
if not self._state.is_available:
log.warning('Trying to send message while offline')
return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment