From 644842ab6d936ec24e66d4ac913817235e50470d Mon Sep 17 00:00:00 2001 From: "Schimon Jehudah, Adv." Date: Mon, 21 Oct 2024 17:01:31 +0300 Subject: [PATCH] Python : Handle situations in which FASI is unable to access to a group chat; SVG : Add Xabber; TOML : Add Xabber and update several descriptions; XHTML : Update note for Haiku. --- clients.toml | 59 +- fasi.py | 26 +- img/xabber.svg | 1213 ++++++++++++++++++++++++++++++++++++++++++ xhtml/download.xhtml | 11 +- 4 files changed, 1278 insertions(+), 31 deletions(-) create mode 100644 img/xabber.svg diff --git a/clients.toml b/clients.toml index 76b3e85..56d2f7b 100644 --- a/clients.toml +++ b/clients.toml @@ -31,7 +31,7 @@ features = ["chat", "console", "desktop"] #and a few enhancements. #""" #apple = "https://beagle.im/#about" -#features = ["chat", "desktop", "graphical"] +#features = ["chat", "desktop", "graphical", "omemo"] [blabber] title = "blabber.im" @@ -118,7 +118,7 @@ It is easy to use, reliable, battery friendly. With built-in support for \ images, group chats and e2e encryption. """ divestos = "https://f-droid.org/packages/eu.siacs.conversations" -features = ["chat", "fdroid", "graphical", "mobile", "omemo", "openpgp"] +features = ["chat", "fdroid", "graphical", "mobile", "omemo", "openpgp", "pwa"] [conversations-classic] title = "Conversations Classic" @@ -194,8 +194,8 @@ home = "https://gajim.org" about = """ Gajim aims to be an easy to use and fully-featured XMPP client. -Chat securely with End-to-End encryption with your friends or family; easily \ -share pictures and thoughts; or discuss the news with your groups. +Chat securely, using End-to-End encryption, with your friends or family; \ +easily share pictures and thoughts; or discuss the news with your groups. Gajim integrates well with your other devices: simply continue conversations \ on your mobile device. @@ -362,14 +362,14 @@ about = """ Poezio is a free console XMPP client (the protocol on which the Jabber IM \ network is built). -Its purpose is to let you connect very easily (no account creation needed) to \ -the network and join various chatrooms, immediately. It tries to look like the \ -most famous IRC clients (weechat, irssi, etc). Many commands are identical and \ -you will not be lost if you already know these clients. Configuration can be \ -made in a configuration file or directly from the client. +It allows you to connect very easily (no account creation needed) to the \ +XMPP network, and join to various of chatrooms, immediately. -You will find the light, fast, geeky and anonymous spirit of IRC while using a \ -powerful, standard and open protocol. +It mimics the appearance of the most famous IRC clients (weechat, irssi, etc), \ +and it includes many identical commands. You will be immediately familiar, if \ +you already know these clients. Configuration can be made in a configuration \ +file or directly from the client. You will find the light, fast, geeky and \ +anonymous spirit of IRC while using a powerful, standard and open protocol. """ haiku = "https://depot.haiku-os.org/poezio" posix = "https://poez.io/en/#download" @@ -409,7 +409,7 @@ supported operating system. apple = "https://psi-im.org" linux = "https://psi-im.org" reactos = "https://psi-im.org" -features = ["adhoc", "admin", "chat", "desktop", "graphical", "openpgp", "otr"] +features = ["adhoc", "admin", "chat", "desktop", "graphical", "omemo", "openpgp", "otr"] [psi-plus] title = "Psi+" @@ -425,7 +425,7 @@ apple = "https://psi-plus.com/wiki/en:downloads#macos" haiku = "https://depot.haiku-os.org/psi_plus" linux = "https://psi-plus.com/wiki/en:downloads#linux" reactos = "https://psi-plus.com/wiki/en:downloads#ms_windows" -features = ["adhoc", "admin", "chat", "desktop", "graphical", "haikudepot", "openpgp", "otr"] +features = ["adhoc", "admin", "chat", "desktop", "graphical", "haikudepot", "omemo", "openpgp", "otr"] [reeder] title = "Reeder" @@ -532,19 +532,19 @@ features = ["chat", "desktop", "graphical"] title = "UWPX" home = "https://uwpx.org" about = """ -UWPX is a app for your UWP (Windows 10 and Windows 11) devices. It implements \ -the Extensible Messaging and Presence Protocol (XMPP). At the moment UWPX is \ -in BETA stage so expect unexpected behavior sometimes. +UWPX is a Windows app for your UWP (Windows 10 and Windows 11) devices. -By default every connection between you and your server is encrypted via \ -TLS 1.2. This prevents attackers from reading your chat messages or metadata. +At the moment, development on UWPX has stopped, and we are looking for a new \ +maintainer. -OMEMO support is actively being worked on. Once implemented, OMEMO will \ -provide a multi-client end-to-end encryption so not even your own server can \ -read your chat messages. +There is support for a wide range of features link bookmarks, user avatars, \ +chat markers and experimental OMEMO support. + +For a complete list of features, please refer to the project: \ +https://github.com/UWPX/UWPX-Client?tab=readme-ov-file#features """ reactos = "https://uwpx.org" -features = ["chat", "desktop", "graphical", "mobile"] +features = ["chat", "desktop", "graphical", "mobile", "omemo"] [weechat] title = "WeeChat" @@ -560,6 +560,21 @@ haiku = "https://depot.haiku-os.org/weechat" posix = "https://github.com/bqv/weechat-xmpp" features = ["chat", "console", "desktop", "omemo", "openpgp"] +[xabber] +title = "Xabber" +home = "https://xabber.com" +about = """ +Open source Jabber (XMPP) client with multi-account support, and a clean \ +interface to provide you with a first-class chat experience. + +Free (as in freedom!) and ad-free, Xabber looks and works great, and is built \ +to provide people with a simple, fast and secure messaging, based on \ +interoperable open standards. +""" +browser = "https://xabber.com" +divestos = "https://xabber.com" +features = ["chat", "desktop", "graphical", "omemo", "mobile"] + #[xmpp-web] #title = "XMPP Web" #home = "https://github.com/nioc/xmpp-web" diff --git a/fasi.py b/fasi.py index fe8f4a1..0dd17fa 100644 --- a/fasi.py +++ b/fasi.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +from asyncio import TimeoutError from datetime import datetime from email.utils import parseaddr from fastapi import FastAPI, Form, HTTPException, Request, Response @@ -681,6 +682,12 @@ class HttpInstance: title = 'Internal Server Error' return result_get(request, action, title) + @self.app.exception_handler(504) + def time_out_exception_handler(request: Request, exc: HTTPException): + action = 'Warning' + title = 'Time Out' + return result_get(request, action, title) + def result_get(request: Request, action: str, title: str): template_file = 'result.xhtml' template_dict = { @@ -850,12 +857,17 @@ class FileUtilities: node_title = jid_info['condition'] node_note = jid_info['text'] services = services_sorted = None - elif isinstance(room_info_muc, IqTimeout): + elif isinstance(room_info_muc['iq'], TimeoutError): + action = 'Warning' + node_title = 'Timeout' + node_note = 'Request timeout has reached' + services = services_sorted = None + elif isinstance(room_info_muc['iq'], IqTimeout): action = 'Warning' node_title = 'Timeout' node_note = 'Timeout error' services = services_sorted = None - elif isinstance(room_info_muc, IqError): + elif isinstance(room_info_muc['iq'], IqError): action = 'Warning' breakpoint() node_title = room_info_muc['condition'] @@ -1366,11 +1378,17 @@ class XmppXep0045: #presence_options = {"pfrom" : jid_from}, #seconds=seconds, #since=since, - #timeout=30 + timeout=5 ) + except TimeoutError as e: + #raise HTTPException(status_code=504, detail='request-timeout-reached') + error = True + iq = e + condition = 'Request timeout reached' + text = str(e) except (IqError, IqTimeout, PresenceError) as e: error = True - iq = None + iq = e condition = e.iq['error']['condition'] text = e.iq['error']['text'] result = { diff --git a/img/xabber.svg b/img/xabber.svg new file mode 100644 index 0000000..9c12af8 --- /dev/null +++ b/img/xabber.svg @@ -0,0 +1,1213 @@ + + + + + logo/xabber.com/regular + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + logo/xabber.com/regular + + + + diff --git a/xhtml/download.xhtml b/xhtml/download.xhtml index 7effb77..d590381 100644 --- a/xhtml/download.xhtml +++ b/xhtml/download.xhtml @@ -60,8 +60,9 @@ - Please refer to this page, if - you are using the Haiku operating system. + Please refer to the section XMPP + Clients For Haiku, if you are using the Haiku operating + system. @@ -124,7 +125,7 @@ Please refer to this page, if - you are prefer text based (i.e. console) interface. + you prefer software with text based (i.e. console) interface. @@ -183,8 +184,8 @@ XMPP is the decentralized, free, open, and private messaging and publishing protocol that drives the world's top-tier and largest open IM network which allows for end-to-end - encrypted messaging, group chats, voice calls, video calls - and more. Join to the community! (est. 1999) + encrypted messaging, group chats, voice calls, video + conferences and more. Join to the community! (est. 1999)