aboutsummaryrefslogtreecommitdiffstats
path: root/libmatrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmatrix.c')
-rw-r--r--libmatrix.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/libmatrix.c b/libmatrix.c
index 6712119..1a2a45f 100644
--- a/libmatrix.c
+++ b/libmatrix.c
@@ -45,7 +45,7 @@
#include "util.h"
#include "version.h"
-#include "matrix-login.h"
+#include "matrix-connection.h"
#include "matrix-room.h"
/**
@@ -62,6 +62,26 @@ static const char *matrixprpl_list_icon(PurpleAccount *acct, PurpleBuddy *buddy)
return "matrix";
}
+/**
+ * Start the connection to a matrix account
+ */
+void matrixprpl_login(PurpleAccount *acct)
+{
+ PurpleConnection *pc = purple_account_get_connection(acct);
+ matrix_connection_new(pc);
+ matrix_connection_start_login(pc);
+}
+
+
+/**
+ * Called to handle closing the connection to an account
+ */
+static void matrixprpl_close(PurpleConnection *pc)
+{
+ matrix_connection_free(pc);
+}
+
+
/* Get the list of information we need to add a chat to our buddy list */
static GList *matrixprpl_chat_info(PurpleConnection *gc)
{
@@ -396,12 +416,6 @@ static GList *matrixprpl_blist_node_menu(PurpleBlistNode *node) {
}
}
-static void matrixprpl_close(PurpleConnection *gc)
-{
- /* notify other matrixprpl accounts */
- foreach_matrixprpl_gc(report_status_change, gc, NULL);
-}
-
static int matrixprpl_send_im(PurpleConnection *gc, const char *who,
const char *message, PurpleMessageFlags flags)
{