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)
#include <libsoup/soup.h>
+#include <stdlib.h>
+#include <stdio.h>
+
#ifndef USE_LIBSOUP_WEBSOCKETS
#include "chime-websocket-connection.h"
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);
#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,
#define __CHIME_CONNECTION_H__
#include <glib-object.h>
-#include <prpl.h>
#include <libsoup/soup.h>
#include <json-glib/json-glib.h>
struct _ChimeConnection {
GObject parent_instance;
- PurpleConnection *prpl_conn;
+ void *prpl_conn;
};
#define CHIME_ERROR (chime_error_quark())
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);
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)
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)
(((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 { \
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)
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)
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)
#include <glib.h>
+#include <prpl.h>
+
#include <libsoup/soup.h>
#include <json-glib/json-glib.h>