]> www.infradead.org Git - pidgin-chime.git/commitdiff
Stop using purple headers, make cxn->prpl_conn a 'void *'.
authorDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 5 Apr 2018 13:48:39 +0000 (14:48 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 5 Apr 2018 13:48:39 +0000 (14:48 +0100)
It's only used by the login code now, which is going to be cleaned
up. For now though let's just make it a void pointer.

Makefile.am
chime/chime-connection-private.h
chime/chime-connection.c
chime/chime-connection.h
login-amazon.c
login-private.h
login-warpdrive.c
prpl/chime.h

index ab1f79b886f7c9c5ba1a507a945d957b5dc81812..f7908d042635fe5d8f32bd8c79a0f9a977b985ab 100644 (file)
@@ -33,8 +33,8 @@ CHIME_SRCS =  chime/chime-connection.c chime/chime-connection.h \
 noinst_LTLIBRARIES = libchime.la
 
 libchime_la_SOURCES = $(CHIME_SRCS) $(WEBSOCKET_SRCS) $(PROTOBUF_SRCS)
-libchime_la_CFLAGS = $(PURPLE_CFLAGS) $(SOUP_CFLAGS) $(JSON_CFLAGS) $(LIBXML_CFLAGS) $(PROTOBUF_CFLAGS) $(MARKDOWN_CFLAGS) $(GSTREAMER_CFLAGS) -Ichime
-libchime_la_LIBADD = $(PURPLE_LIBS) $(SOUP_LIBS) $(JSON_LIBS) $(LIBXML_LIBS) $(PROTOBUF_LIBS) $(MARKDOWN_LIBS) $(GSTREAMER_LIBS)
+libchime_la_CFLAGS = $(SOUP_CFLAGS) $(JSON_CFLAGS) $(LIBXML_CFLAGS) $(PROTOBUF_CFLAGS) $(MARKDOWN_CFLAGS) $(GSTREAMER_CFLAGS) -Ichime
+libchime_la_LIBADD = $(SOUP_LIBS) $(JSON_LIBS) $(LIBXML_LIBS) $(PROTOBUF_LIBS) $(MARKDOWN_LIBS) $(GSTREAMER_LIBS)
 libchime_la_LDFLAGS = -module -avoid-version -no-undefined
 
 libchimeprpl_la_SOURCES = $(PRPL_SRCS) $(LOGIN_SRCS)
index 06b7e5e39efc8faf11e04f9deaa4fc325841456f..14f2dd7a92405abddf85d0f268ac285b0857924d 100644 (file)
@@ -28,6 +28,9 @@
 
 #include <libsoup/soup.h>
 
+#include <stdlib.h>
+#include <stdio.h>
+
 #ifndef USE_LIBSOUP_WEBSOCKETS
 #include "chime-websocket-connection.h"
 
@@ -228,7 +231,6 @@ void chime_jugg_subscribe(ChimeConnection *cxn, const gchar *channel,
 void chime_jugg_unsubscribe(ChimeConnection *cxn, const gchar *channel,
                            const gchar *klass, JuggernautCallback cb,
                            gpointer cb_data);
-void chime_purple_keepalive(PurpleConnection *conn);
 
 /* chime-rooms.c */
 void chime_init_rooms(ChimeConnection *cxn);
index 59ba14e7449816c6738aa17ea102b1fa612664f2..f2b89011d0e1d10df1263d6054c989ae1c839498 100644 (file)
@@ -336,14 +336,14 @@ chime_connection_init(ChimeConnection *self)
 #define SIGNIN_DEFAULT "https://signin.id.ue1.app.chime.aws/"
 
 ChimeConnection *
-chime_connection_new(PurpleConnection *connection, const gchar *server,
+chime_connection_new(void *prpl_conn, const gchar *server,
                     const gchar *device_token, const gchar *session_token)
 {
        if (!server || !*server)
                server = SIGNIN_DEFAULT;
 
        return g_object_new (CHIME_TYPE_CONNECTION,
-                            "purple-connection", connection,
+                            "purple-connection", prpl_conn,
                             "server", server ? server : SIGNIN_DEFAULT,
                             "device-token", device_token,
                             "session-token", session_token,
index 83970ff44cc10732a583d0cc43f9ce1bc339d51c..21f668fca36969aaf0cdbc42170a74c533c096ea 100644 (file)
@@ -19,7 +19,6 @@
 #define __CHIME_CONNECTION_H__
 
 #include <glib-object.h>
-#include <prpl.h>
 #include <libsoup/soup.h>
 #include <json-glib/json-glib.h>
 
@@ -31,7 +30,7 @@ G_DECLARE_FINAL_TYPE (ChimeConnection, chime_connection, CHIME, CONNECTION, GObj
 struct _ChimeConnection {
        GObject parent_instance;
 
-       PurpleConnection *prpl_conn;
+       void *prpl_conn;
 };
 
 #define CHIME_ERROR (chime_error_quark())
@@ -58,7 +57,7 @@ typedef void (*ChimeSoupMessageCallback)(ChimeConnection *cxn,
                                         JsonNode *node,
                                         gpointer cb_data);
 
-ChimeConnection *chime_connection_new                        (PurpleConnection *connection,
+ChimeConnection *chime_connection_new                        (void *prpl_conn,
                                                              const gchar *server,
                                                              const gchar *device_token,
                                                              const gchar *session_token);
index 33234ea267fbe6b326e25eb99d591d45aebabc99..ebf51a14f7657c934ff1ec8426327ef5484beb66 100644 (file)
@@ -136,8 +136,7 @@ static void request_credentials_with_fields(struct login_amzn *state, gboolean r
                              PASS_TITLE, text, retry ? PASS_FAIL : NULL, fields,
                              PASS_OK, G_CALLBACK(gather_credentials_and_send),
                              PASS_CANCEL, G_CALLBACK(chime_login_cancel_ui),
-                             login_connection(state)->prpl_conn->account,
-                             NULL, NULL, state);
+                             login_account(state), NULL, NULL, state);
 }
 
 static void request_credentials_with_input(struct login_amzn *state, gboolean retry)
@@ -151,8 +150,7 @@ static void request_credentials_with_input(struct login_amzn *state, gboolean re
                             FALSE, TRUE, (gchar *) "password",
                             PASS_OK, G_CALLBACK(send_credentials),
                             PASS_CANCEL, G_CALLBACK(chime_login_cancel_ui),
-                            login_connection(state)->prpl_conn->account,
-                            NULL, NULL, state);
+                            login_account(state), NULL, NULL, state);
 }
 
 static void request_credentials(struct login_amzn *state, gboolean retry)
index 85bd97847108df81d2eabffc173a016c14cbad62..f639e99d3ccbf51e68578fb0545be69fc161f1e4 100644 (file)
@@ -59,8 +59,12 @@ void chime_login_warpdrive(SoupSession *sessioin, SoupMessage *msg, gpointer dat
        (((struct login *) (state))->session)
 #define login_connection(state)                        \
        (((struct login *) (state))->connection)
-#define login_account_email(state)                             \
-       (((struct login *) (state))->connection->prpl_conn->account->username)
+#define login_prplconn(state)                  \
+       ((PurpleConnection *)login_connection(state)->prpl_conn)
+#define login_account(state)                   \
+       (login_prplconn(state)->account)
+#define login_account_email(state)             \
+       (login_account(state)->username)
 
 #define login_fail_on_error(msg, state)                                \
        do {                                                            \
index eb80e536e21ef6750d9998e0cbe2c640704b8a75..052eba1e7881399e212004538db67181269fb256 100644 (file)
@@ -342,8 +342,7 @@ static void request_credentials_with_fields(struct login_wd *state, gboolean ret
                              retry ? AUTH_FAIL : NULL, fields,
                              AUTH_SEND, G_CALLBACK(gather_credentials_and_send),
                              AUTH_CANCEL, G_CALLBACK(chime_login_cancel_ui),
-                             login_connection(state)->prpl_conn->account,
-                             NULL, NULL, state);
+                             login_account(state), NULL, NULL, state);
 }
 
 static void request_password_with_input(struct login_wd *state, const gchar *username)
@@ -360,8 +359,7 @@ static void request_password_with_input(struct login_wd *state, const gchar *use
                             NULL, FALSE, TRUE, (gchar *) "password",
                             AUTH_SEND, G_CALLBACK(send_credentials),
                             AUTH_CANCEL, G_CALLBACK(chime_login_cancel_ui),
-                            login_connection(state)->prpl_conn->account,
-                            NULL, NULL, state);
+                            login_account(state), NULL, NULL, state);
 }
 
 static void request_username_with_input(struct login_wd *state, gboolean retry)
@@ -371,8 +369,7 @@ static void request_username_with_input(struct login_wd *state, gboolean retry)
                             NULL, FALSE, FALSE, NULL,
                             _("OK"), G_CALLBACK(request_password_with_input),
                             AUTH_CANCEL, G_CALLBACK(chime_login_cancel_ui),
-                            login_connection(state)->prpl_conn->account,
-                            NULL, NULL, state);
+                            login_account(state), NULL, NULL, state);
 }
 
 static void request_credentials(struct login_wd *state, gboolean retry)
index add68ea24a1c0bd05e8eafceb688b07f34ce6794..219702a6631d22cc63d27d4efe1e8eaafdc6a1c9 100644 (file)
@@ -20,6 +20,8 @@
 
 #include <glib.h>
 
+#include <prpl.h>
+
 #include <libsoup/soup.h>
 #include <json-glib/json-glib.h>