changeset 1907:42584a17de9a

[gaim-migrate @ 1917] alrighty committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 28 May 2001 21:21:23 +0000
parents 42aa9434800a
children 038aeba90fd6
files plugins/jabber/jabber.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/jabber/jabber.c	Mon May 28 20:37:58 2001 +0000
+++ b/plugins/jabber/jabber.c	Mon May 28 21:21:23 2001 +0000
@@ -613,10 +613,10 @@
 			room = xmlnode_get_attrib(xmlns, "jid");
 
 			serv_got_chat_invite(GJ_GC(j), room, 0, from, msg);
-		} else if (msg) {
+		} else if (msg) { /* whisper */
 			struct jabber_chat *jc;
 			g_snprintf(m, sizeof(m), "%s", msg);
-			if ((jc = find_existing_chat(GJ_GC(j), p->from)) != NULL) /* whisper */
+			if (((jc = find_existing_chat(GJ_GC(j), p->from)) != NULL) && jc->b)
 				serv_got_chat_in(GJ_GC(j), jc->b->id, p->from->resource, 1, m, time(NULL));
 			else {
 				if (find_conversation(jid_full(p->from)))
@@ -799,7 +799,7 @@
 					return;
 				}
 				jd = jc->gc->proto_data;
-				if (strcmp(who->resource, jc->Jid->resource)) {
+				if (strcmp(who->resource, jc->Jid->resource) && jc->b) {
 					remove_chat_buddy(jc->b, who->resource);
 					return;
 				}
@@ -808,7 +808,7 @@
 				serv_got_chat_left(GJ_GC(j), jc->b->id);
 				g_free(jc);
 			} else {
-				if (!jc && !(jc = find_existing_chat(GJ_GC(j), who))) {
+				if ((!jc && !(jc = find_existing_chat(GJ_GC(j), who))) || !jc->b) {
 					g_free(buddy);
 					return;
 				}
@@ -1449,6 +1449,7 @@
 	xmlnode_put_attrib(x, "type", "unavailable");
 	gjab_send(j, x);
 	xmlnode_free(x);
+	jc->b = NULL;
 }
 
 static void jabber_chat_send(struct gaim_connection *gc, int id, char *message)