comparison src/protocols/bonjour/bonjour.c @ 13909:8264f52a1142

[gaim-migrate @ 16406] More of sf patch #1490646, from Jonty Wareing & Jono Cole "The screen name + hostname of the sending user is sent in the outgoing jabber message, fixing a sporadic problem with iChat. The port in use has been fixed to the one described in the Bonjour specification and can no longer be changed in the prpl preferences - modifiying this just stops the client from being able to start a chat. The option for a buddy icon has been removed for now as no code actually uses it yet - we plan to change this in the future. This update also introduces automatic local port retry for up to ten attempts if the port is in use (e.g. if multiple instances of gaim are running)." committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 03 Jul 2006 00:37:41 +0000
parents b986b6e2441b
children 6c907830a45f
comparison
equal deleted inserted replaced
13908:cab785a7c766 13909:8264f52a1142
101 gc->proto_data = g_new0(BonjourData, 1); 101 gc->proto_data = g_new0(BonjourData, 1);
102 bd = gc->proto_data; 102 bd = gc->proto_data;
103 103
104 /* Start waiting for jabber connections (iChat style) */ 104 /* Start waiting for jabber connections (iChat style) */
105 bd->jabber_data = g_new(BonjourJabber, 1); 105 bd->jabber_data = g_new(BonjourJabber, 1);
106 bd->jabber_data->port = gaim_account_get_int(account, "port", BONJOUR_DEFAULT_PORT_INT); 106 bd->jabber_data->port = BONJOUR_DEFAULT_PORT_INT;
107 bd->jabber_data->account = account; 107 bd->jabber_data->account = account;
108 108
109 if (bonjour_jabber_start(bd->jabber_data) == -1) { 109 if (bonjour_jabber_start(bd->jabber_data) == -1) {
110 /* Send a message about the connection error */ 110 /* Send a message about the connection error */
111 gaim_connection_error(gc, _("Unable to listen for incoming IM connections\n")); 111 gaim_connection_error(gc, _("Unable to listen for incoming IM connections\n"));
121 bd->dns_sd_data->name = (sw_string)gaim_account_get_username(account); 121 bd->dns_sd_data->name = (sw_string)gaim_account_get_username(account);
122 bd->dns_sd_data->txtvers = g_strdup("1"); 122 bd->dns_sd_data->txtvers = g_strdup("1");
123 bd->dns_sd_data->version = g_strdup("1"); 123 bd->dns_sd_data->version = g_strdup("1");
124 bd->dns_sd_data->first = g_strdup(gaim_account_get_string(account, "first", default_firstname)); 124 bd->dns_sd_data->first = g_strdup(gaim_account_get_string(account, "first", default_firstname));
125 bd->dns_sd_data->last = g_strdup(gaim_account_get_string(account, "last", default_lastname)); 125 bd->dns_sd_data->last = g_strdup(gaim_account_get_string(account, "last", default_lastname));
126 bd->dns_sd_data->port_p2pj = gaim_account_get_int(account, "port", BONJOUR_DEFAULT_PORT_INT); 126 bd->dns_sd_data->port_p2pj = bd->jabber_data->port;
127 bd->dns_sd_data->phsh = g_strdup(""); 127 bd->dns_sd_data->phsh = g_strdup("");
128 bd->dns_sd_data->email = g_strdup(gaim_account_get_string(account, "email", "")); 128 bd->dns_sd_data->email = g_strdup(gaim_account_get_string(account, "email", ""));
129 bd->dns_sd_data->vc = g_strdup(""); 129 bd->dns_sd_data->vc = g_strdup("");
130 bd->dns_sd_data->jid = g_strdup(gaim_account_get_string(account, "jid", "")); 130 bd->dns_sd_data->jid = g_strdup(gaim_account_get_string(account, "jid", ""));
131 bd->dns_sd_data->AIM = g_strdup(gaim_account_get_string(account, "AIM", "")); 131 bd->dns_sd_data->AIM = g_strdup(gaim_account_get_string(account, "AIM", ""));
354 static GaimPluginProtocolInfo prpl_info = 354 static GaimPluginProtocolInfo prpl_info =
355 { 355 {
356 OPT_PROTO_NO_PASSWORD, 356 OPT_PROTO_NO_PASSWORD,
357 NULL, /* user_splits */ 357 NULL, /* user_splits */
358 NULL, /* protocol_options */ 358 NULL, /* protocol_options */
359 {"png", 0, 0, 96, 96, GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */ 359 /* {"png", 0, 0, 96, 96, GAIM_ICON_SCALE_DISPLAY}, */ /* icon_spec */
360 NO_BUDDY_ICONS, /* not yet */ /* icon_spec */
360 bonjour_list_icon, /* list_icon */ 361 bonjour_list_icon, /* list_icon */
361 bonjour_list_emblems, /* list_emblems */ 362 bonjour_list_emblems, /* list_emblems */
362 bonjour_status_text, /* status_text */ 363 bonjour_status_text, /* status_text */
363 bonjour_tooltip_text, /* tooltip_text */ 364 bonjour_tooltip_text, /* tooltip_text */
364 bonjour_status_types, /* status_types */ 365 bonjour_status_types, /* status_types */
574 /* Creating the user splits */ 575 /* Creating the user splits */
575 split = gaim_account_user_split_new(_("Hostname"), default_hostname, '@'); 576 split = gaim_account_user_split_new(_("Hostname"), default_hostname, '@');
576 prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); 577 prpl_info.user_splits = g_list_append(prpl_info.user_splits, split);
577 578
578 /* Creating the options for the protocol */ 579 /* Creating the options for the protocol */
579 option = gaim_account_option_int_new(_("Port"), "port", 5298);
580 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
581
582 option = gaim_account_option_string_new(_("First name"), "first", default_firstname); 580 option = gaim_account_option_string_new(_("First name"), "first", default_firstname);
583 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); 581 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
584 582
585 option = gaim_account_option_string_new(_("Last name"), "last", default_lastname); 583 option = gaim_account_option_string_new(_("Last name"), "last", default_lastname);
586 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); 584 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);