Now About Social Code
aboutsummaryrefslogtreecommitdiff
path: root/src/main.py
diff options
context:
space:
mode:
authorLucas Fryzek <lucas.fryzek@fryzekconcepts.com>2025-01-15 17:26:17 +0000
committerLucas Fryzek <lucas.fryzek@fryzekconcepts.com>2025-01-15 17:26:17 +0000
commit1310a03148eac23db565ca0c6bbd5ae490024637 (patch)
treea65e618360c8f7233fa994da593579c06178e0f0 /src/main.py
parentce0bada559e24501c31707dddd90f9d9b927a568 (diff)
network: Improve disconnect handling
Make sure disconnecting closes the SSH tunnel connection. Also add keep alive ping to check if connection to server is still there and time out if the keep alive ping does not respond.
Diffstat (limited to 'src/main.py')
-rw-r--r--src/main.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.py b/src/main.py
index cc5a966..a120031 100644
--- a/src/main.py
+++ b/src/main.py
@@ -350,6 +350,9 @@ class WeegtkApplication(Adw.Application):
self.network.desync_weechat()
elif message.msgid == '_upgrade_ended':
self.network.sync_weechat()
+ elif message.msgid == "_pong":
+ # For now don't do anything with pong messages
+ pass
else:
print(f"Unknown message with id {message.msgid}")
@@ -372,9 +375,8 @@ class WeegtkApplication(Adw.Application):
self.pages.insert(index, page)
def buffer_input(self, source_object, full_name, text):
- if self.network.is_connected():
- message = f"input {full_name} {text}\n"
- self.network.send_to_weechat(message)
+ message = f"input {full_name} {text}\n"
+ self.network.send_to_weechat(message)
def main(version):
"""The application's entry point."""