libpurple/protocols/sametime/sametime.c

changeset 41799
d567f89d6a9b
parent 41775
82c861678f39
child 41803
3f96e2b2b03d
--- a/libpurple/protocols/sametime/sametime.c	Sun Oct 09 02:20:18 2022 -0500
+++ b/libpurple/protocols/sametime/sametime.c	Sun Oct 09 04:43:37 2022 -0500
@@ -3523,8 +3523,8 @@
 
 
 static void
-mw_protocol_login(G_GNUC_UNUSED PurpleProtocol *protocol,
-                  PurpleAccount *account)
+mw_protocol_login(PurpleProtocol *protocol, PurpleAccount *account,
+                  const char *password)
 {
   PurpleConnection *gc;
   struct mwPurpleProtocolData *pd;
@@ -3534,7 +3534,7 @@
 
   GError *error = NULL;
 
-  gc = purple_account_get_connection(account);
+  gc = purple_connection_new(protocol, account, password);
   pd = mwPurpleProtocolData_new(gc);
 
   /* while we do support images, the default is to not offer it */
@@ -3561,7 +3561,7 @@
     purple_connection_error(gc,
             PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
             _("A server is required to connect this account"));
-    return;
+    return gc;
   }
 
   pass = g_strdup(purple_connection_get_password(gc));
@@ -3603,13 +3603,15 @@
   pd->client = purple_gio_socket_client_new(account, &error);
   if (pd->client == NULL) {
     purple_connection_take_error(gc, error);
-    return;
+    return gc;
   }
 
   g_socket_client_connect_to_host_async(
           pd->client, host,
           port, pd->cancellable,
           connect_cb, pd);
+
+  return gc;
 }
 
 

mercurial