Added submodule
This commit is contained in:
parent
5a96b2005f
commit
b3cd5e1203
@ -1,3 +1,4 @@
|
||||
DIST chatty-v0.6.7.tar.gz 576407 BLAKE2B a6d6d2db170f689b30fb81c7ed3b6e66145eb559b6baf48cd0c2db7a3c4d70b1a16b7735ca7de552d5fbbd28219377676d0128debece9eb2fdba59fa18c7aa5f SHA512 3029843ad6064001e87f8a8a8af82b23cfc7d5dc2ffd35e3506b178a2dbd88046d88c4a22cd2b65f9a279a5ed2199f5dc5cfcbe657c36b79738d4bc0777de6f1
|
||||
DIST chatty-v0.7.0_rc1.tar.gz 548140 BLAKE2B 0c2f4b4161beaaa543fa275848d0f15841343124ea42ca997c888f27023c2fad1e3ad93634ee73ffa96ab2320f996c3b21c4c66320f6b4d519b6770515075369 SHA512 df696f4ba0a06a2d3bf1478c6ab72bf6671f26b0b3c505873c4aa125813867fbcda8b79a2365f58d3d382cf6a3f2cb8c2eb4dcdf99d1dad80fb49ca210130188
|
||||
DIST libcmatrix-13bdda3e2b6ef4747feeccbb0a9ddcfafb63f898.tar.gz 154080 BLAKE2B b0208b9c039b5915f1ef99f513f7079288caacdae0e38485af97ec31dfae20f117763e7d2565e62138e46e5af4cb76613aea7efdbffaf196cbaa5bba8cb08a38 SHA512 001f44aa70bab9e5115b4f325d5e091693b757f2cb51318e77df474bd0671c067a9231674636855d8ba5fe57ef39102fca4ee8680d6e27db8445c07c6576463c
|
||||
DIST libgd-c7c7ff4e05d3fe82854219091cf116cce6b19de0.tar.gz 58318 BLAKE2B f6e02c179340431655965e84f6fb8fac0543b220c2915c111eb7dc32c16d3d595d42c6cf5d303c20e02ebbbc5f01493b830eb99e3e4337a805f6f8b48fd27377 SHA512 681cc23b5a33df88a92e3aac33d0dba1c6ebb69a2bd6f15b6ae31f0b444c108f7bfd1391e604433be58d82c0032028b112652d3d0c473abe4db02d66c55cdef3
|
||||
|
@ -7,11 +7,13 @@ inherit meson gnome2-utils xdg
|
||||
|
||||
COMMIT="37e96593d4accb1c637e992daa8466d444365db5"
|
||||
LIBGD_COMMIT="c7c7ff4e05d3fe82854219091cf116cce6b19de0"
|
||||
LIBCM_COMMIT="13bdda3e2b6ef4747feeccbb0a9ddcfafb63f898"
|
||||
|
||||
DESCRIPTION="XMPP and SMS messaging via libpurple and Modemmanager"
|
||||
HOMEPAGE="https://source.puri.sm/Librem5/chatty"
|
||||
SRC_URI="
|
||||
https://gitlab.gnome.org/GNOME/libgd/-/archive/${LIBGD_COMMIT}/libgd-${LIBGD_COMMIT}.tar.gz
|
||||
https://source.puri.sm/Librem5/libcmatrix/-/archive/${LIBCM_COMMIT}/libcmatrix-${LIBCM_COMMIT}.tar.gz
|
||||
https://source.puri.sm/Librem5/chatty/-/archive/v${PV}/${PN}-v${PV}.tar.gz
|
||||
"
|
||||
|
||||
@ -40,6 +42,8 @@ src_prepare() {
|
||||
eapply_user
|
||||
rm -r "${S}"/subprojects/libgd || die
|
||||
mv "${WORKDIR}"/libgd-"${LIBGD_COMMIT}" "${S}"/subprojects/libgd || die
|
||||
rm -r "${S}"/subprojects/libcmatrix || die
|
||||
mv "${WORKDIR}"/libcmatrix-"${LIBCM_COMMIT}" "${S}"/subprojects/libcmatrix || die
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
|
180
net-im/chatty/files/chatty-0001-Port-to-libsoup-3.0.patch
Normal file
180
net-im/chatty/files/chatty-0001-Port-to-libsoup-3.0.patch
Normal file
@ -0,0 +1,180 @@
|
||||
From 74c5f76718a93bf13d12e53432eb7348d4b91e28 Mon Sep 17 00:00:00 2001
|
||||
From: marcin <marcin@ipv8.pl>
|
||||
Date: Tue, 9 Aug 2022 07:02:06 +0200
|
||||
Subject: [PATCH] Port to libsoup-3.0
|
||||
|
||||
---
|
||||
src/dialogs/chatty-settings-dialog.c | 8 ++--
|
||||
src/matrix/chatty-ma-account.c | 5 +--
|
||||
src/matrix/matrix-utils.c | 58 ++++++++--------------------
|
||||
src/matrix/matrix-utils.h | 3 --
|
||||
4 files changed, 23 insertions(+), 51 deletions(-)
|
||||
|
||||
diff --git a/src/dialogs/chatty-settings-dialog.c b/src/dialogs/chatty-settings-dialog.c
|
||||
index a2dbd1c..1b677d1 100644
|
||||
--- a/src/dialogs/chatty-settings-dialog.c
|
||||
+++ b/src/dialogs/chatty-settings-dialog.c
|
||||
@@ -693,13 +693,13 @@ settings_homeserver_entry_changed (ChattySettingsDialog *self,
|
||||
server = gtk_entry_get_text (entry);
|
||||
|
||||
if (server && *server) {
|
||||
- g_autoptr(SoupURI) uri = NULL;
|
||||
+ g_autoptr(GUri) uri = NULL;
|
||||
|
||||
- uri = soup_uri_new (gtk_entry_get_text (entry));
|
||||
+ uri = g_uri_parse (gtk_entry_get_text (entry), SOUP_HTTP_URI_FLAGS, NULL);
|
||||
|
||||
- valid = SOUP_URI_VALID_FOR_HTTP (uri);
|
||||
+ valid = !!uri;
|
||||
/* We need an absolute path URI */
|
||||
- valid = valid && *uri->host && g_str_equal (soup_uri_get_path (uri), "/");
|
||||
+ valid = valid && *g_uri_get_host(uri) && g_str_equal (g_uri_get_path (uri), "/");
|
||||
}
|
||||
|
||||
if (valid)
|
||||
diff --git a/src/matrix/chatty-ma-account.c b/src/matrix/chatty-ma-account.c
|
||||
index ba4838f..d9d8337 100644
|
||||
--- a/src/matrix/chatty-ma-account.c
|
||||
+++ b/src/matrix/chatty-ma-account.c
|
||||
@@ -340,9 +340,8 @@ cm_account_sync_cb (ChattyMaAccount *self,
|
||||
error->code, error->message);
|
||||
|
||||
if (error &&
|
||||
- ((error->domain == SOUP_HTTP_ERROR &&
|
||||
- error->code <= SOUP_STATUS_TLS_FAILED &&
|
||||
- error->code > SOUP_STATUS_CANCELLED) ||
|
||||
+ (error->domain == SOUP_TLD_ERROR ||
|
||||
+ error->domain == G_TLS_ERROR ||
|
||||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NETWORK_UNREACHABLE) ||
|
||||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_TIMED_OUT) ||
|
||||
error->domain == G_RESOLVER_ERROR ||
|
||||
diff --git a/src/matrix/matrix-utils.c b/src/matrix/matrix-utils.c
|
||||
index 33c9c32..aec49f4 100644
|
||||
--- a/src/matrix/matrix-utils.c
|
||||
+++ b/src/matrix/matrix-utils.c
|
||||
@@ -362,37 +362,6 @@ matrix_utils_json_object_get_array (JsonObject *object,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
-JsonObject *
|
||||
-matrix_utils_get_message_json_object (SoupMessage *message,
|
||||
- const char *member)
|
||||
-{
|
||||
- g_autoptr(JsonParser) parser = NULL;
|
||||
- g_autoptr(SoupBuffer) buffer = NULL;
|
||||
- JsonObject *object = NULL;
|
||||
- gboolean is_json;
|
||||
-
|
||||
- if (!message || !message->response_body)
|
||||
- return NULL;
|
||||
-
|
||||
- buffer = soup_message_body_flatten (message->response_body);
|
||||
- parser = json_parser_new ();
|
||||
- is_json = json_parser_load_from_data (parser, buffer->data, buffer->length, NULL);
|
||||
-
|
||||
- if (is_json) {
|
||||
- JsonNode *root;
|
||||
-
|
||||
- root = json_parser_get_root (parser);
|
||||
-
|
||||
- if (root && JSON_NODE_HOLDS_OBJECT (root))
|
||||
- object = json_node_get_object (root);
|
||||
-
|
||||
- if (member && object)
|
||||
- object = json_object_get_object_member (object, member);
|
||||
- }
|
||||
-
|
||||
- return object ? json_object_ref (object) : NULL;
|
||||
-}
|
||||
-
|
||||
static gboolean
|
||||
cancel_read_uri (gpointer user_data)
|
||||
{
|
||||
@@ -446,16 +415,17 @@ matrix_utils_handle_ssl_error (SoupMessage *message)
|
||||
GApplication *app;
|
||||
GtkWidget *dialog;
|
||||
GtkWindow *window = NULL;
|
||||
- SoupURI *uri;
|
||||
+ GUri *uri;
|
||||
g_autofree char *msg = NULL;
|
||||
const char *host;
|
||||
GTlsCertificateFlags err_flags;
|
||||
gboolean cancelled = FALSE;
|
||||
|
||||
if (!SOUP_IS_MESSAGE (message) ||
|
||||
- !soup_message_get_https_status (message, &cert, &err_flags) ||
|
||||
- !err_flags)
|
||||
+ !(err_flags = soup_message_get_tls_peer_certificate_errors (message)))
|
||||
return cancelled;
|
||||
+
|
||||
+ cert = soup_message_get_tls_peer_certificate(message);
|
||||
|
||||
app = g_application_get_default ();
|
||||
if (app)
|
||||
@@ -465,7 +435,7 @@ matrix_utils_handle_ssl_error (SoupMessage *message)
|
||||
return cancelled;
|
||||
|
||||
uri = soup_message_get_uri (message);
|
||||
- host = soup_uri_get_host (uri);
|
||||
+ host = g_uri_get_host (uri);
|
||||
|
||||
switch (err_flags) {
|
||||
case G_TLS_CERTIFICATE_UNKNOWN_CA:
|
||||
@@ -548,11 +518,8 @@ uri_file_read_cb (GObject *object,
|
||||
return;
|
||||
}
|
||||
|
||||
- soup_message_get_https_status (message, NULL, &err_flags);
|
||||
-
|
||||
if (message &&
|
||||
- soup_message_get_https_status (message, NULL, &err_flags) &&
|
||||
- err_flags) {
|
||||
+ (err_flags = soup_message_get_tls_peer_certificate_errors (message))) {
|
||||
guint timeout_id, timeout;
|
||||
|
||||
timeout = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (task), "timeout"));
|
||||
@@ -594,6 +561,14 @@ message_network_event_cb (SoupMessage *msg,
|
||||
g_object_set_data_full (user_data, "address", address, g_object_unref);
|
||||
}
|
||||
|
||||
+static gboolean
|
||||
+accept_certificate_callback (SoupMessage *msg, GTlsCertificate *certificate,
|
||||
+ GTlsCertificateFlags tls_errors, gpointer user_data)
|
||||
+{
|
||||
+ // Returning TRUE trusts it anyway.
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
void
|
||||
matrix_utils_read_uri_async (const char *uri,
|
||||
guint timeout,
|
||||
@@ -640,9 +615,10 @@ matrix_utils_read_uri_async (const char *uri,
|
||||
G_CALLBACK (message_network_event_cb), task,
|
||||
G_CONNECT_AFTER);
|
||||
session = soup_session_new ();
|
||||
- g_object_set (G_OBJECT (session), SOUP_SESSION_SSL_STRICT, FALSE, NULL);
|
||||
+ /* Accept invalid certificates */
|
||||
+ g_signal_connect (message, "accept-certificate", G_CALLBACK (accept_certificate_callback), NULL);
|
||||
|
||||
- soup_session_send_async (session, message, cancel,
|
||||
+ soup_session_send_async (session, message, 0, cancel,
|
||||
uri_file_read_cb,
|
||||
g_steal_pointer (&task));
|
||||
}
|
||||
diff --git a/src/matrix/matrix-utils.h b/src/matrix/matrix-utils.h
|
||||
index 7eff06a..2451581 100644
|
||||
--- a/src/matrix/matrix-utils.h
|
||||
+++ b/src/matrix/matrix-utils.h
|
||||
@@ -43,9 +43,6 @@ JsonObject *matrix_utils_json_object_get_object (JsonObject *object,
|
||||
JsonArray *matrix_utils_json_object_get_array (JsonObject *object,
|
||||
const char *member);
|
||||
|
||||
-JsonObject *matrix_utils_get_message_json_object (SoupMessage *message,
|
||||
- const char *member);
|
||||
-
|
||||
void matrix_utils_read_uri_async (const char *uri,
|
||||
guint timeout,
|
||||
GCancellable *cancellable,
|
||||
--
|
||||
2.37.1
|
||||
|
Loading…
Reference in New Issue
Block a user