# HG changeset patch # User andrew.victor@mxit.com # Date 1318972628 0 # Node ID 6135b24cdc8aae30d4a7a41f905bb7739f3e12f9 # Parent a78523019e7a6989f6108372b06b3afe973a2a9b Samtime: Move the "inpa" input watcher into protocol_data. diff -r a78523019e7a -r 6135b24cdc8a libpurple/connection.h --- a/libpurple/connection.h Tue Oct 18 21:11:40 2011 +0000 +++ b/libpurple/connection.h Tue Oct 18 21:17:08 2011 +0000 @@ -235,7 +235,7 @@ PurpleAccount *account; /**< The account being connected to. */ char *password; /**< The password used. */ - int inpa; /**< The input watcher. */ + int inpa_; /**< The input watcher. */ GSList *buddy_chats; /**< A list of active chats (#PurpleConversation structs of type diff -r a78523019e7a -r 6135b24cdc8a libpurple/protocols/sametime/sametime.c --- a/libpurple/protocols/sametime/sametime.c Tue Oct 18 21:11:40 2011 +0000 +++ b/libpurple/protocols/sametime/sametime.c Tue Oct 18 21:17:08 2011 +0000 @@ -217,6 +217,7 @@ /** socket fd */ int socket; + guint inpa; /* input watcher */ gint outpa; /* like inpa, but the other way */ /** circular buffer for outgoing data */ @@ -449,9 +450,9 @@ pd->socket = 0; } - if(gc->inpa) { - purple_input_remove(gc->inpa); - gc->inpa = 0; + if(pd->inpa) { + purple_input_remove(pd->inpa); + pd->inpa = 0; } } @@ -1760,9 +1761,9 @@ pd->socket = 0; } - if(pd->gc->inpa) { - purple_input_remove(pd->gc->inpa); - pd->gc->inpa = 0; + if(pd->inpa) { + purple_input_remove(pd->inpa); + pd->inpa = 0; } if(! ret) { @@ -1791,7 +1792,6 @@ static void connect_cb(gpointer data, gint source, const gchar *error_message) { struct mwPurplePluginData *pd = data; - PurpleConnection *gc = pd->gc; if(source < 0) { /* connection failed */ @@ -1819,7 +1819,7 @@ } pd->socket = source; - gc->inpa = purple_input_add(source, PURPLE_INPUT_READ, + pd->inpa = purple_input_add(source, PURPLE_INPUT_READ, read_cb, pd); mwSession_start(pd->session); @@ -3794,9 +3794,9 @@ purple_connection_set_protocol_data(gc, NULL); /* stop watching the socket */ - if(gc->inpa) { - purple_input_remove(gc->inpa); - gc->inpa = 0; + if(pd->inpa) { + purple_input_remove(pd->inpa); + pd->inpa = 0; } /* clean up the rest */ diff -r a78523019e7a -r 6135b24cdc8a libpurple/protocols/silc/silc.c --- a/libpurple/protocols/silc/silc.c Tue Oct 18 21:11:40 2011 +0000 +++ b/libpurple/protocols/silc/silc.c Tue Oct 18 21:17:08 2011 +0000 @@ -528,7 +528,7 @@ g_snprintf(prd, sizeof(prd), "%s" G_DIR_SEPARATOR_S "private_key.prv", silcpurple_silcdir()); if (!silc_load_key_pair((char *)purple_account_get_string(account, "public-key", pkd), (char *)purple_account_get_string(account, "private-key", prd), - (gc->password == NULL) ? "" : gc->password, + (purple_connection_get_password(gc) == NULL) ? "" : purple_connection_get_password(gc), &sg->public_key, &sg->private_key)) { if (!purple_account_get_password(account)) { purple_account_request_password(account, G_CALLBACK(silcpurple_got_password_cb), diff -r a78523019e7a -r 6135b24cdc8a libpurple/protocols/silc/util.c --- a/libpurple/protocols/silc/util.c Tue Oct 18 21:11:40 2011 +0000 +++ b/libpurple/protocols/silc/util.c Tue Oct 18 21:17:08 2011 +0000 @@ -210,8 +210,7 @@ SILCPURPLE_DEF_PKCS_LEN, file_public_key, file_private_key, NULL, - (gc->password == NULL) - ? "" : gc->password, + (purple_connection_get_password(gc) == NULL) ? "" : purple_connection_get_password(gc), NULL, NULL, FALSE)) { purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("Unable to create SILC key pair")); @@ -253,8 +252,7 @@ SILCPURPLE_DEF_PKCS_LEN, file_public_key, file_private_key, NULL, - (gc->password == NULL) - ? "" : gc->password, + (purple_connection_get_password(gc) == NULL) ? "" : purple_connection_get_password(gc), NULL, NULL, FALSE)) { purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("Unable to create SILC key pair"));