changeset 3270:6231e0f0ee9e

[gaim-migrate @ 3288] Fix crash for checking ICQ info of people not in your contact list. (Thanks, Mark Doliner) committer: Tailor Script <tailor@pidgin.im>
author Jim Seymour <jseymour>
date Thu, 23 May 2002 00:06:01 +0000
parents 3ab37015a395
children 66445abf1736
files src/protocols/oscar/oscar.c
diffstat 1 files changed, 13 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c	Wed May 22 12:25:44 2002 +0000
+++ b/src/protocols/oscar/oscar.c	Thu May 23 00:06:01 2002 +0000
@@ -2503,19 +2503,22 @@
 	 * parse-icq-status-message function knows if it is putting it's message in 
 	 * an info window because the name will _not_ be in od->evilhack.  For getting 
 	 * only the away message the contact's UIN is put in od->evilhack. */
-	if ((budlight = find_buddy(gc, who)) && ((budlight->uc >> 7) & (AIM_ICQ_STATE_AWAY || AIM_ICQ_STATE_DND || AIM_ICQ_STATE_OUT || AIM_ICQ_STATE_BUSY || AIM_ICQ_STATE_CHAT))) {
-		if (budlight->caps & AIM_CAPS_ICQSERVERRELAY)
-			g_show_info_text(gc, who, 0, buf, NULL);
-		else {
+	if (budlight = find_buddy(gc, who)) {
+		if ((budlight->uc >> 7) & (AIM_ICQ_STATE_AWAY || AIM_ICQ_STATE_DND || AIM_ICQ_STATE_OUT || AIM_ICQ_STATE_BUSY || AIM_ICQ_STATE_CHAT)) {
+			if (budlight->caps & AIM_CAPS_ICQSERVERRELAY)
+				g_show_info_text(gc, who, 0, buf, NULL);
+			else {
+				char *state_msg = gaim_icq_status((budlight->uc & 0xff80) >> 7);
+				g_show_info_text(gc, who, 2, buf, "<B>Status:</B> ", state_msg, "<BR>\n<HR><BR><I>Remote client does not support sending status messages.</I><BR>\n", NULL);
+				free(state_msg);
+			}
+		} else {
 			char *state_msg = gaim_icq_status((budlight->uc & 0xff80) >> 7);
-			g_show_info_text(gc, who, 2, buf, "<B>Status:</B> ", state_msg, "<BR>\n<HR><BR><I>Remote client does not support sending status messages.</I><BR>\n", NULL);
+			g_show_info_text(gc, who, 2, buf, "<B>Status:</B> ", state_msg, NULL);
 			free(state_msg);
 		}
-	} else {
-		char *state_msg = gaim_icq_status((budlight->uc & 0xff80) >> 7);
-		g_show_info_text(gc, who, 2, buf, "<B>Status:</B> ", state_msg, NULL);
-		free(state_msg);
-	}
+	} else
+		g_show_info_text(gc, who, 2, buf, NULL);
 
 	return 1;
 }