changeset 4450:2f225b92a933

[gaim-migrate @ 4725] sean puts up really long away messages. that reminded me that jabber doesn't show linebreaks in away messages correctly I also removed the "gjab_send_raw: \t " lines from the debug window, because they're useless and annoying. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Tue, 28 Jan 2003 18:37:05 +0000
parents faa9b636707a
children ce5b64fac95d
files src/protocols/jabber/jabber.c
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/jabber/jabber.c	Tue Jan 28 16:57:58 2003 +0000
+++ b/src/protocols/jabber/jabber.c	Tue Jan 28 18:37:05 2003 +0000
@@ -98,6 +98,8 @@
 
 #define JABBER_TYPING_NOTIFY_INT 15	/* Delay (in seconds) between sending typing notifications */
 
+#define JABBER_KEEPALIVE_STRING "  \t  "
+
 /*
  * Note: "was_connected" may seem redundant, but it was needed and I
  * didn't want to touch the Jabber state stuff not specific to Gaim.
@@ -579,7 +581,9 @@
 			fprintf(stderr, "DBG: Problem sending.  Error: %d\n", errno);
 			fflush(stderr);
 		}
-		debug_printf("gjab_send_raw: %s\n", str);
+		/* printing keepalives to the debug window is really annoying */
+		if(strcmp(str, JABBER_KEEPALIVE_STRING))
+			debug_printf("gjab_send_raw: %s\n", str);
 	}
 }
 
@@ -3184,9 +3188,12 @@
 	for(i=0; i<num_resources; i++)
 	{
 		jab_res_info jri = resources->data;
+		char *status;
 		realwho = g_strdup_printf("%s/%s", buddy, jri->name);
+		status = strdup_withhtml(jabber_lookup_away(gjc, realwho));
 		*ap++ = g_strdup_printf("<B>Jabber ID:</B> %s<BR>\n", realwho);
-		*ap++ = g_strdup_printf("<B>Status:</B> %s<BR>\n", jabber_lookup_away(gjc, realwho));
+		*ap++ = g_strdup_printf("<B>Status:</B> %s<BR>\n", status);
+		g_free(status);
 		g_free(realwho);
 		resources = resources->next;
 	}
@@ -3405,7 +3412,7 @@
 
 static void jabber_keepalive(struct gaim_connection *gc) {
 	struct jabber_data *jd = (struct jabber_data *)gc->proto_data;
-	gjab_send_raw(jd->gjc, "  \t  ");
+	gjab_send_raw(jd->gjc, JABBER_KEEPALIVE_STRING);
 }
 
 /*---------------------------------------*/
@@ -3586,9 +3593,9 @@
 		}
 	}
 
-	status = jabber_lookup_away(gjc, buddy);
-
+	status = strdup_withhtml(jabber_lookup_away(gjc, buddy));
 	*ap++ = g_strdup_printf("<B>Status:</B> %s<BR>\n", status);
+	g_free(status);
 
 	/*
 	 * "Description" handled as a special case: get a copy of the