diff libpurple/protocols/oscar/oscar.c @ 27578:3bb1085235d0

propagate from branch 'im.pidgin.pidgin' (head 90138fae4d2350d166f730736ecea9ee8e20ecdb) to branch 'im.pidgin.cpw.darkrain42.roster' (head 04af1d94534183574e72b50b268b425b4cac2a33)
author Paul Aurich <paul@darkrain42.org>
date Sun, 12 Jul 2009 02:56:06 +0000
parents 5048054d319a
children bff61dad9a6b bd9df4e45904
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.c	Mon Jul 06 04:37:41 2009 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Sun Jul 12 02:56:06 2009 +0000
@@ -1111,7 +1111,7 @@
 	{
 		/* This only happens when connecting with the old-style BUCP login */
 		gchar *msg;
-		msg = g_strdup_printf(_("Could not connect to authentication server:\n%s"),
+		msg = g_strdup_printf(_("Unable to connect to authentication server: %s"),
 				error_message);
 		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
 		g_free(msg);
@@ -1119,7 +1119,7 @@
 	else if (conn->type == SNAC_FAMILY_LOCATE)
 	{
 		gchar *msg;
-		msg = g_strdup_printf(_("Could not connect to BOS server:\n%s"),
+		msg = g_strdup_printf(_("Unable to connect to BOS server: %s"),
 				error_message);
 		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
 		g_free(msg);
@@ -1521,7 +1521,7 @@
 
 	if (!oscar_util_valid_name(purple_account_get_username(account))) {
 		gchar *buf;
-		buf = g_strdup_printf(_("Unable to login: Could not sign on as %s because the username is invalid.  Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), purple_account_get_username(account));
+		buf = g_strdup_printf(_("Unable to sign on as %s because the username is invalid.  Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), purple_account_get_username(account));
 		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, buf);
 		g_free(buf);
 		return;
@@ -1605,7 +1605,7 @@
 
 		if (newconn->gsc == NULL && newconn->connect_data == NULL) {
 			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-					_("Couldn't connect to host"));
+					_("Unable to connect"));
 			return;
 		}
 	}
@@ -1673,10 +1673,9 @@
 	}
 	if (in != '\n') {
 		char buf[256];
-		GHashTable *ui_info = purple_core_get_ui_info();
 		g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly.  "
 				"If so, check %s for updates."),
-				((ui_info && g_hash_table_lookup(ui_info, "website")) ? (char *)g_hash_table_lookup(ui_info, "website") : PURPLE_WEBSITE));
+				oscar_get_ui_info_string("website", PURPLE_WEBSITE));
 		purple_notify_warning(pos->gc, NULL,
 							_("Unable to get a valid AIM login hash."),
 							buf);
@@ -1715,10 +1714,9 @@
 	pos->fd = source;
 
 	if (source < 0) {
-		GHashTable *ui_info = purple_core_get_ui_info();
 		buf = g_strdup_printf(_("You may be disconnected shortly.  "
-				"Check %s for updates."),
-				((ui_info && g_hash_table_lookup(ui_info, "website")) ? (char *)g_hash_table_lookup(ui_info, "website") : PURPLE_WEBSITE));
+				"If so, check %s for updates."),
+				oscar_get_ui_info_string("website", PURPLE_WEBSITE));
 		purple_notify_warning(pos->gc, NULL,
 							_("Unable to get a valid AIM login hash."),
 							buf);
@@ -1814,13 +1812,12 @@
 			straight_to_hell, pos) == NULL)
 	{
 		char buf[256];
-		GHashTable *ui_info = purple_core_get_ui_info();
 		g_free(pos->modname);
 		g_free(pos);
 
 		g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly.  "
-			"Check %s for updates."),
-			((ui_info && g_hash_table_lookup(ui_info, "website")) ? (char *)g_hash_table_lookup(ui_info, "website") : PURPLE_WEBSITE));
+			"If so, check %s for updates."),
+			oscar_get_ui_info_string("website", PURPLE_WEBSITE));
 		purple_notify_warning(pos->gc, NULL,
 							_("Unable to get a valid login hash."),
 							buf);
@@ -1841,7 +1838,7 @@
 			connection_established_cb, conn);
 	if (conn->connect_data == NULL)
 	{
-		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Could Not Connect"));
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect"));
 		return 0;
 	}
 
@@ -1887,11 +1884,11 @@
 			/* Incorrect password */
 			if (!purple_account_get_remember_password(account))
 				purple_account_set_password(account, NULL);
-			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Incorrect password."));
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Incorrect password"));
 			break;
 		case 0x11:
 			/* Suspended account */
-			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Your account is currently suspended."));
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Your account is currently suspended"));
 			break;
 		case 0x02:
 		case 0x14:
@@ -1905,9 +1902,8 @@
 		case 0x1c:
 		{
 			/* client too old */
-			GHashTable *ui_info = purple_core_get_ui_info();
 			g_snprintf(buf, sizeof(buf), _("The client version you are using is too old. Please upgrade at %s"),
-					   ((ui_info && g_hash_table_lookup(ui_info, "website")) ? (char *)g_hash_table_lookup(ui_info, "website") : PURPLE_WEBSITE));
+					oscar_get_ui_info_string("website", PURPLE_WEBSITE));
 			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, buf);
 			break;
 		}
@@ -1963,7 +1959,7 @@
 	g_free(host);
 	if (newconn->connect_data == NULL)
 	{
-		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Could Not Connect"));
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect"));
 		return 0;
 	}
 
@@ -1996,7 +1992,7 @@
 	/* Disconnect */
 	purple_connection_error_reason(gc,
 		PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
-		_("The SecurID key entered is invalid."));
+		_("The SecurID key entered is invalid"));
 }
 
 /**
@@ -2222,7 +2218,7 @@
 		message = oscar_encoding_to_utf8(account, info->status_encoding,
 										 info->status, info->status_len);
 
-	tmp2 = tmp = (message ? g_markup_escape_text(message, -1) : NULL);
+	tmp2 = tmp = (message ? purple_markup_escape_text(message, -1) : NULL);
 
 	if (strcmp(status_id, OSCAR_STATUS_ID_AVAILABLE) == 0) {
 		if (info->itmsurl_encoding && info->itmsurl && info->itmsurl_len)
@@ -3931,6 +3927,7 @@
 	PurpleConnection *gc;
 	PurpleAccount *account;
 	PurpleStatus *status;
+	gboolean is_available;
 	PurplePresence *presence;
 	const char *username, *message, *itmsurl;
 	char *tmp;
@@ -3971,13 +3968,14 @@
 
 	/* Set our available message based on the current status */
 	status = purple_account_get_active_status(account);
-	if (purple_status_is_available(status))
+	is_available = purple_status_is_available(status);
+	if (is_available)
 		message = purple_status_get_attr_string(status, "message");
 	else
 		message = NULL;
 	tmp = purple_markup_strip_html(message);
 	itmsurl = purple_status_get_attr_string(status, "itmsurl");
-	aim_srv_setextrainfo(od, FALSE, 0, TRUE, tmp, itmsurl);
+	aim_srv_setextrainfo(od, FALSE, 0, is_available, tmp, itmsurl);
 	g_free(tmp);
 
 	presence = purple_status_get_presence(status);
@@ -4976,7 +4974,7 @@
 
 	if (!oscar_util_valid_name(bname)) {
 		gchar *buf;
-		buf = g_strdup_printf(_("Could not add the buddy %s because the username is invalid.  Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), bname);
+		buf = g_strdup_printf(_("Unable to add the buddy %s because the username is invalid.  Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), bname);
 		if (!purple_conv_present_error(bname, account, buf))
 			purple_notify_error(gc, NULL, _("Unable to Add"), buf);
 		g_free(buf);
@@ -5461,7 +5459,7 @@
 
 			case 0x000c: { /* you are over the limit, the cheat is to the limit, come on fhqwhgads */
 				gchar *buf;
-				buf = g_strdup_printf(_("Could not add the buddy %s because you have too many buddies in your buddy list.  Please remove one and try again."), (retval->name ? retval->name : _("(no name)")));
+				buf = g_strdup_printf(_("Unable to add the buddy %s because you have too many buddies in your buddy list.  Please remove one and try again."), (retval->name ? retval->name : _("(no name)")));
 				if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf))
 					purple_notify_error(gc, NULL, _("Unable to Add"), buf);
 				g_free(buf);
@@ -5475,7 +5473,7 @@
 			default: { /* La la la */
 				gchar *buf;
 				purple_debug_error("oscar", "ssi: Action 0x%04hx was unsuccessful with error 0x%04hx\n", retval->action, retval->ack);
-				buf = g_strdup_printf(_("Could not add the buddy %s for an unknown reason."),
+				buf = g_strdup_printf(_("Unable to add the buddy %s for an unknown reason."),
 						(retval->name ? retval->name : _("(no name)")));
 				if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf))
 					purple_notify_error(gc, NULL, _("Unable to Add"), buf);
@@ -7104,15 +7102,6 @@
 	purple_prefs_add_none("/plugins/prpl/oscar");
 	purple_prefs_add_bool("/plugins/prpl/oscar/recent_buddies", FALSE);
 
-	/*
-	 * These two preferences will normally not be changed.  UIs can optionally
-	 * use them to override these two version fields which are sent to the
-	 * server when logging in.  AOL requested this change to allow clients to
-	 * use custom values.
-	 */
-	purple_prefs_add_string("/plugins/prpl/oscar/clientstring", NULL);
-	purple_prefs_add_int("/plugins/prpl/oscar/distid", -1);
-
 	purple_prefs_remove("/plugins/prpl/oscar/show_idle");
 	purple_prefs_remove("/plugins/prpl/oscar/always_use_rv_proxy");