From: Don S. <ri...@us...> - 2005-02-03 15:12:59
|
Update of /cvsroot/gaim-bnet/gaim-bnet/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18198/src Modified Files: chat.c conn.h proto.c Log Message: Patch 1111122 from evew to fix Bug 1111086 about multiple chats and text going to wrong chan Index: proto.c =================================================================== RCS file: /cvsroot/gaim-bnet/gaim-bnet/src/proto.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** proto.c 27 Jan 2005 21:26:41 -0000 1.19 --- proto.c 3 Feb 2005 15:12:48 -0000 1.20 *************** *** 590,594 **** g_hash_table_foreach_remove(conn->users, bnet_hash_destroy_all, NULL); ! serv_got_joined_chat(gc, 1, chan); } --- 590,594 ---- g_hash_table_foreach_remove(conn->users, bnet_hash_destroy_all, NULL); ! serv_got_joined_chat(gc, ++conn->chan_id, chan); } *************** *** 680,683 **** --- 680,685 ---- gaim_debug_info("bnet", "EMOTE FROM %s - %s\n", nick, msg); } + + g_free(buf); } Index: chat.c =================================================================== RCS file: /cvsroot/gaim-bnet/gaim-bnet/src/chat.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** chat.c 13 Jan 2005 08:25:39 -0000 1.4 --- chat.c 3 Feb 2005 15:12:48 -0000 1.5 *************** *** 71,74 **** --- 71,75 ---- bnet_chat_join(GaimConnection *gc, GHashTable *data) { const gchar *chan; + GaimConversation *convo; BNetConn *conn; *************** *** 80,90 **** conn = BNET_CONN(gc->proto_data); chan = g_hash_table_lookup(data, "channel"); if (!strcmp(conn->chan, chan)) { - GaimConversation *convo; - /* We are already on chan, simply show the window and populate it! */ ! ! serv_got_joined_chat(gc, 1, chan); convo = gaim_find_conversation_with_account(conn->chan, conn->account); --- 81,89 ---- conn = BNET_CONN(gc->proto_data); chan = g_hash_table_lookup(data, "channel"); + convo = gaim_find_conversation_with_account(conn->chan, conn->account); if (!strcmp(conn->chan, chan)) { /* We are already on chan, simply show the window and populate it! */ ! serv_got_joined_chat(gc, ++conn->chan_id, chan); convo = gaim_find_conversation_with_account(conn->chan, conn->account); *************** *** 94,97 **** --- 93,106 ---- } else { + convo = gaim_find_conversation_with_account(conn->chan, conn->account); + + if (convo) { + gaim_conv_chat_write(GAIM_CONV_CHAT(convo), + "", + _("Left channel."), + GAIM_MESSAGE_SYSTEM, + time(0)); + } + bnet_conn_send(conn, "/join %s\n", chan); } *************** *** 120,126 **** } ! bnet_conn_send(conn, "%s\n", what); ! ! gaim_conv_chat_write(GAIM_CONV_CHAT(convo), conn->nick, what, 0, time(0)); return 0; --- 129,142 ---- } ! if (id == conn->chan_id) { ! bnet_conn_send(conn, "%s\n", what); ! gaim_conv_chat_write(GAIM_CONV_CHAT(convo), conn->nick, what, 0, time(0)); ! } else { ! gaim_conv_chat_write(GAIM_CONV_CHAT(convo), ! "", ! _("You are not in channel."), ! GAIM_MESSAGE_ERROR, ! time(0)); ! } return 0; Index: conn.h =================================================================== RCS file: /cvsroot/gaim-bnet/gaim-bnet/src/conn.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** conn.h 27 Jan 2005 21:26:41 -0000 1.7 --- conn.h 3 Feb 2005 15:12:48 -0000 1.8 *************** *** 63,66 **** --- 63,67 ---- gchar *nick; gchar *chan; + guint chan_id; GHashTable *users; |