changeset 13605:77e61dc1b525

[gaim-migrate @ 15991] Show the "Direct IM" context menu item for ICQ buddies (direct IM works between AIM and ICQ people) committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 10 Apr 2006 02:34:08 +0000
parents 7337e7968654
children c1157497b32c
files src/protocols/oscar/oscar.c
diffstat 1 files changed, 38 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c	Sun Apr 09 23:16:31 2006 +0000
+++ b/src/protocols/oscar/oscar.c	Mon Apr 10 02:34:08 2006 +0000
@@ -251,8 +251,6 @@
 
 	/*
 	 * Can we get away with using our custom encoding?
-	 * TODO: This should actually try using the encoding specified in
-	 *       the account editor.
 	 */
 	while (utf8[i])
 	{
@@ -5724,54 +5722,60 @@
 
 static GList *oscar_buddy_menu(GaimBuddy *buddy) {
 
-	GaimConnection *gc = gaim_account_get_connection(buddy->account);
-	OscarData *od = gc->proto_data;
-
-	GList *m = NULL;
+	GaimConnection *gc;
+	OscarData *od;
+	GList *m;
 	GaimMenuAction *act;
+	aim_userinfo_t *userinfo;
+
+	gc = gaim_account_get_connection(buddy->account);
+	od = gc->proto_data;
+	userinfo = aim_locate_finduserinfo(od, buddy->name);
+	m = NULL;
 
 	act = gaim_menu_action_new(_("Edit Buddy Comment"),
 	                           GAIM_CALLBACK(oscar_buddycb_edit_comment),
 	                           NULL, NULL);
 	m = g_list_append(m, act);
 
-	if (od->icq) {
 #if 0
+	if (od->icq)
+	{
 		act = gaim_menu_action_new(_("Get Status Msg"),
 		                           GAIM_CALLBACK(oscar_get_icqstatusmsg),
 		                           NULL, NULL);
 		m = g_list_append(m, act);
+	}
 #endif
-	} else {
-		aim_userinfo_t *userinfo;
-		userinfo = aim_locate_finduserinfo(od, buddy->name);
-
-		if (userinfo &&
-			aim_sncmp(gaim_account_get_username(buddy->account), buddy->name) &&
-			GAIM_BUDDY_IS_ONLINE(buddy))
+
+	if (userinfo &&
+		aim_sncmp(gaim_account_get_username(buddy->account), buddy->name) &&
+		GAIM_BUDDY_IS_ONLINE(buddy))
+	{
+		if (userinfo->capabilities & OSCAR_CAPABILITY_DIRECTIM)
 		{
-			if (userinfo->capabilities & OSCAR_CAPABILITY_DIRECTIM)
-			{
-				act = gaim_menu_action_new(_("Direct IM"),
-				                           GAIM_CALLBACK(oscar_ask_directim),
-				                           NULL, NULL);
-				m = g_list_append(m, act);
-			}
+			act = gaim_menu_action_new(_("Direct IM"),
+			                           GAIM_CALLBACK(oscar_ask_directim),
+			                           NULL, NULL);
+			m = g_list_append(m, act);
+		}
 #if 0
-			/* TODO: This menu item should be added by the core */
-			if (userinfo->capabilities & OSCAR_CAPABILITY_GETFILE) {
-				act = gaim_menu_action_new(_("Get File"),
-				                           GAIM_CALLBACK(oscar_ask_getfile),
-				                           NULL, NULL);
-				m = g_list_append(m, act);
-			}
+		/* TODO: This menu item should be added by the core */
+		if (userinfo->capabilities & OSCAR_CAPABILITY_GETFILE) {
+			act = gaim_menu_action_new(_("Get File"),
+			                           GAIM_CALLBACK(oscar_ask_getfile),
+			                           NULL, NULL);
+			m = g_list_append(m, act);
+		}
 #endif
-		}
-	}
-
-	if (od->ssi.received_data) {
-		char *gname = aim_ssi_itemlist_findparentname(od->ssi.local, buddy->name);
-		if (gname && aim_ssi_waitingforauth(od->ssi.local, gname, buddy->name)) {
+	}
+
+	if (od->ssi.received_data)
+	{
+		char *gname;
+		gname = aim_ssi_itemlist_findparentname(od->ssi.local, buddy->name);
+		if (gname && aim_ssi_waitingforauth(od->ssi.local, gname, buddy->name))
+		{
 			act = gaim_menu_action_new(_("Re-request Authorization"),
 			                           GAIM_CALLBACK(gaim_auth_sendrequest_menu),
 			                           NULL, NULL);