diff src/protocols/oscar/oscar.c @ 8092:697221d5d0ff

[gaim-migrate @ 8791] Give a nice little warning if you add an AIM or ICQ buddy with an invalid name. I'm thinking some of those bug reports on SF about "Could not add buddy with no name" are caused by this. Hopefully. Sometime before the next release I'll probably actually remove invalid people from the local list. Also recognize the WinAIM Video and Camera caps. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 13 Jan 2004 05:44:37 +0000
parents abee07bc573f
children 8633dc570442
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c	Tue Jan 13 03:02:59 2004 +0000
+++ b/src/protocols/oscar/oscar.c	Tue Jan 13 05:44:37 2004 +0000
@@ -2383,7 +2383,7 @@
 					   "unknown rendezvous status!\n");
 		}
 	} else if (args->reqclass & AIM_CAPS_GETFILE) {
-	} else if (args->reqclass & AIM_CAPS_VOICE) {
+	} else if (args->reqclass & AIM_CAPS_TALK) {
 	} else if (args->reqclass & AIM_CAPS_BUDDYICON) {
 		gaim_buddy_icons_set_for_user(gaim_connection_get_account(gc),
 									  userinfo->sn, args->info.icon.icon,
@@ -3077,7 +3077,7 @@
 			case AIM_CAPS_BUDDYICON:
 				tmp = _("Buddy Icon");
 				break;
-			case AIM_CAPS_VOICE:
+			case AIM_CAPS_TALK:
 				tmp = _("Voice");
 				break;
 			case AIM_CAPS_DIRECTIM:
@@ -3096,7 +3096,7 @@
 			case AIM_CAPS_GAMES2:
 				tmp = _("Games");
 				break;
-			case AIM_CAPS_SAVESTOCKS:
+			case AIM_CAPS_ADDINS:
 				tmp = _("Add-Ins");
 				break;
 			case AIM_CAPS_SENDBUDDYLIST:
@@ -3135,9 +3135,16 @@
 			case AIM_CAPS_VIDEO:
 				tmp = _("Video Chat");
 				break;
+			/* Not actually sure about this one... WinAIM doesn't show anything */
 			case AIM_CAPS_ICHATAV:
 				tmp = _("iChat AV");
 				break;
+			case AIM_CAPS_LIVEVIDEO:
+				tmp = _("Live Video");
+				break;
+			case AIM_CAPS_CAMERA:
+				tmp = _("Camera");
+				break;
 			default:
 				tmp = NULL;
 				break;
@@ -4650,6 +4657,16 @@
 
 static void oscar_add_buddy(GaimConnection *gc, const char *name, GaimGroup *g) {
 	OscarData *od = (OscarData *)gc->proto_data;
+
+	if (!aim_snvalid(name)) {
+		gchar *buf;
+		buf = g_strdup_printf(_("Could not add the buddy %s because the screen name is invalid.  Screen names must either start with a letter and contain only letters, numbers and spaces, or contain only numbers.  The buddy will be removed from your buddy list."), name);
+		gaim_notify_error(gc, NULL, _("Unable To Add"), buf);
+		g_free(buf);
+		/* ABC - Remove from locate list! */
+		return;
+	}
+
 #ifdef NOSSI
 	aim_add_buddy(od->sess, od->conn, name);
 #else
@@ -4684,7 +4701,7 @@
 #else
 	if (od->sess->ssi.received_data) {
 		while (buddies) {
-			oscar_add_buddy(gc, (const char *)buddies->data, NULL);
+			oscar_add_buddy(gc, buddies->data, NULL);
 			buddies = buddies->next;
 		}
 	}
@@ -4978,7 +4995,7 @@
 							} else {
 								gaim_debug(GAIM_DEBUG_INFO, "oscar",
 										"ssi: adding buddy %s from local list to server list\n", buddy->name);
-								aim_ssi_addbuddy(sess, buddy->name, group->name, gaim_get_buddy_alias_only(buddy), NULL, NULL, 0);
+								oscar_add_buddy(gc, buddy->name, group);
 							}
 						}
 					}