changeset 1795:ca53277c0204

[gaim-migrate @ 1805] handles resources for conversations better, mid. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 02 May 2001 08:55:17 +0000
parents 60b3fd819cce
children 5728118a8d4c
files plugins/jabber/jabber.c
diffstat 1 files changed, 10 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/jabber/jabber.c	Wed May 02 03:59:42 2001 +0000
+++ b/plugins/jabber/jabber.c	Wed May 02 08:55:17 2001 +0000
@@ -591,13 +591,18 @@
 		} else if (msg) {
 			struct conversation *b;
 			struct jabber_chat *jc;
-			from = g_strdup_printf("%s@%s", p->from->user, p->from->server);
-				g_snprintf(m, sizeof(m), "%s", msg);
+			g_snprintf(m, sizeof(m), "%s", msg);
 			if ((jc = find_existing_chat(GJ_GC(j), p->from)) != NULL) /* whisper */
 				serv_got_chat_in(GJ_GC(j), jc->b->id, p->from->resource, 1, m, time(NULL));
-			else
-				serv_got_im(GJ_GC(j), from, m, 0, time(NULL));
-			g_free(from);
+			else {
+				if (find_conversation(jid_full(p->from)))
+					serv_got_im(GJ_GC(j), jid_full(p->from), m, 0, time(NULL));
+				else {
+					from = g_strdup_printf("%s@%s", p->from->user, p->from->server);
+					serv_got_im(GJ_GC(j), from, m, 0, time(NULL));
+					g_free(from);
+				}
+			}
 		}
 
 		if (msg)
@@ -1767,16 +1772,6 @@
 	gtk_object_set_user_data(GTK_OBJECT(button), gc);
 	gtk_menu_append(GTK_MENU(menu), button);
 	gtk_widget_show(button);
-	
-	status = g_hash_table_lookup(jd->hash, b->name);
-	if (!status || !strcasecmp("Online", status))
-	   return;
-
-	g_snprintf(buf, sizeof buf, "Status: %s",status);
-
-	button = gtk_menu_item_new_with_label(buf);
-	gtk_menu_append(GTK_MENU(menu), button);
-	gtk_widget_show(button);
 }
 
 static GList *jabber_away_states() {