Mercurial > pidgin.yaz
annotate src/buddy_chat.c @ 1927:1a9867e1bfd5
[gaim-migrate @ 1937]
gah.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 31 May 2001 01:22:21 +0000 |
parents | 352bd24e03ef |
children | eee309c0de93 |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
344
diff
changeset
|
22 #ifdef HAVE_CONFIG_H |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
344
diff
changeset
|
23 #include "../config.h" |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
344
diff
changeset
|
24 #endif |
1 | 25 #include <string.h> |
26 #include <sys/time.h> | |
27 #include <unistd.h> | |
28 #include <stdio.h> | |
29 #include <stdlib.h> | |
30 #include <gtk/gtk.h> | |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1398
diff
changeset
|
31 #include "gtkimhtml.h" |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1109
diff
changeset
|
32 #include "gtkspell.h" |
300
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
226
diff
changeset
|
33 #include <gdk/gdkkeysyms.h> |
1 | 34 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
35 #include "convo.h" |
1235
a9cf2f61a7b1
[gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1228
diff
changeset
|
36 #include "prpl.h" |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
37 |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
38 #include "pixmaps/tb_forward.xpm" |
604
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
39 #include "pixmaps/join.xpm" |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
40 #include "pixmaps/close.xpm" |
604
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
41 |
1819
47e064712091
[gaim-migrate @ 1829]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1815
diff
changeset
|
42 GtkWidget *joinchat; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
43 static struct gaim_connection *joinchatgc; |
1 | 44 static GtkWidget *entry; |
45 static GtkWidget *invite; | |
46 static GtkWidget *inviteentry; | |
47 static GtkWidget *invitemess; | |
1807
ba8f463744c0
[gaim-migrate @ 1817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1806
diff
changeset
|
48 static GtkWidget *jc_vbox = NULL; |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
49 extern int state_lock; |
1 | 50 |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
51 GList *chats = NULL; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
52 GtkWidget *all_chats = NULL; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
53 GtkWidget *chat_notebook = NULL; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
54 |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
55 |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
56 static void destroy_prev_jc() |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
57 { |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
58 if (!jc_vbox) |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
59 return; |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
60 |
1828
643872269616
[gaim-migrate @ 1838]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1827
diff
changeset
|
61 while (GTK_BOX(jc_vbox)->children) |
643872269616
[gaim-migrate @ 1838]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1827
diff
changeset
|
62 gtk_container_remove(GTK_CONTAINER(jc_vbox), |
643872269616
[gaim-migrate @ 1838]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1827
diff
changeset
|
63 ((GtkBoxChild *)GTK_BOX(jc_vbox)->children->data)->widget); |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
64 } |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
65 |
1 | 66 static void destroy_join_chat() |
67 { | |
68 if (joinchat) | |
69 gtk_widget_destroy(joinchat); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
70 joinchat = NULL; |
1 | 71 } |
72 | |
73 static void destroy_invite() | |
74 { | |
75 if (invite) | |
76 gtk_widget_destroy(invite); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
77 invite = NULL; |
1 | 78 } |
79 | |
80 | |
1819
47e064712091
[gaim-migrate @ 1829]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1815
diff
changeset
|
81 void do_join_chat() |
1 | 82 { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
83 if (joinchat) { |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
84 if (joinchatgc->prpl->draw_join_chat) |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
85 serv_join_chat(joinchatgc, 0, NULL); |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
86 else |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
87 serv_join_chat(joinchatgc, 0, gtk_entry_get_text(GTK_ENTRY(entry))); |
1 | 88 gtk_widget_destroy(joinchat); |
89 } | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
90 joinchat = NULL; |
1 | 91 } |
92 | |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
93 static void default_draw_join_chat(struct gaim_connection *gc, GtkWidget *fbox) { |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
94 GtkWidget *label; |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
95 GtkWidget *rowbox; |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
96 |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
97 if (!joinchat || !fbox) |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
98 return; |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
99 |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
100 rowbox = gtk_hbox_new(FALSE, 5); |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
101 gtk_box_pack_start(GTK_BOX(fbox), rowbox, TRUE, TRUE, 0); |
1819
47e064712091
[gaim-migrate @ 1829]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1815
diff
changeset
|
102 gtk_widget_show(rowbox); |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
103 |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
104 label = gtk_label_new(_("Join what group:")); |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
105 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0); |
1819
47e064712091
[gaim-migrate @ 1829]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1815
diff
changeset
|
106 gtk_widget_show(label); |
47e064712091
[gaim-migrate @ 1829]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1815
diff
changeset
|
107 |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
108 entry = gtk_entry_new(); |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
109 gtk_box_pack_start(GTK_BOX(rowbox), entry, TRUE, TRUE, 0); |
1827
bb115612a2ed
[gaim-migrate @ 1837]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1819
diff
changeset
|
110 gtk_widget_grab_focus(entry); |
1819
47e064712091
[gaim-migrate @ 1829]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1815
diff
changeset
|
111 gtk_signal_connect(GTK_OBJECT(entry), "activate", GTK_SIGNAL_FUNC(do_join_chat), NULL); |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
112 gtk_widget_show(entry); |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
113 } |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
114 |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
115 static void rebuild_jc() |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
116 { |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
117 if (!joinchatgc) |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
118 return; |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
119 |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
120 destroy_prev_jc(); |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
121 if (joinchatgc->prpl->draw_join_chat) |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
122 (*joinchatgc->prpl->draw_join_chat)(joinchatgc, jc_vbox); |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
123 else |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
124 default_draw_join_chat(joinchatgc, jc_vbox); |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
125 } |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
126 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
127 static void joinchat_choose(GtkWidget *w, struct gaim_connection *g) |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
128 { |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
129 if (joinchatgc == g) |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
130 return; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
131 joinchatgc = g; |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
132 rebuild_jc(); |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
133 } |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
134 |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
135 static void create_joinchat_menu(GtkWidget *box) |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
136 { |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
137 GtkWidget *optmenu; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
138 GtkWidget *menu; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
139 GtkWidget *opt; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
140 GSList *c = connections; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
141 struct gaim_connection *g; |
1235
a9cf2f61a7b1
[gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1228
diff
changeset
|
142 char buf[2048]; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
143 |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
144 optmenu = gtk_option_menu_new(); |
1210 | 145 gtk_box_pack_start(GTK_BOX(box), optmenu, FALSE, FALSE, 0); |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
146 |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
147 menu = gtk_menu_new(); |
1793
00c753b86710
[gaim-migrate @ 1803]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1780
diff
changeset
|
148 joinchatgc = NULL; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
149 |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
150 while (c) { |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
151 g = (struct gaim_connection *)c->data; |
1356
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
152 c = c->next; |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
153 if (!g->prpl->join_chat) |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
154 continue; |
1793
00c753b86710
[gaim-migrate @ 1803]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1780
diff
changeset
|
155 if (!joinchatgc) |
00c753b86710
[gaim-migrate @ 1803]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1780
diff
changeset
|
156 joinchatgc = g; |
1235
a9cf2f61a7b1
[gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1228
diff
changeset
|
157 g_snprintf(buf, sizeof buf, "%s (%s)", g->username, (*g->prpl->name)()); |
a9cf2f61a7b1
[gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1228
diff
changeset
|
158 opt = gtk_menu_item_new_with_label(buf); |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
159 gtk_object_set_user_data(GTK_OBJECT(opt), g); |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
160 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(joinchat_choose), g); |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
161 gtk_menu_append(GTK_MENU(menu), opt); |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
162 gtk_widget_show(opt); |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
163 } |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
164 |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
165 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
166 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), 0); |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
167 } |
1 | 168 |
169 void join_chat() | |
170 { | |
1210 | 171 GtkWidget *mainbox; |
172 GtkWidget *frame; | |
173 GtkWidget *fbox; | |
174 GtkWidget *rowbox; | |
1 | 175 GtkWidget *bbox; |
1210 | 176 GtkWidget *join; |
177 GtkWidget *cancel; | |
178 GtkWidget *label; | |
1356
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
179 GSList *c = connections; |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
180 struct gaim_connection *gc = NULL; |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
181 |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
182 while (c) { |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
183 gc = c->data; |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
184 if (gc->prpl->join_chat) |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
185 break; |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
186 gc = NULL; |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
187 c = c->next; |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
188 } |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
189 if (gc == NULL) { |
1358
3c87aa8efdc9
[gaim-migrate @ 1368]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1356
diff
changeset
|
190 do_error_dialog("You are not currently signed on with any protocols that have " |
1356
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
191 "the ability to chat.", "Unable to chat"); |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
192 return; |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
193 } |
456 | 194 |
1 | 195 if (!joinchat) { |
457 | 196 joinchat = gtk_window_new(GTK_WINDOW_DIALOG); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
197 gtk_window_set_wmclass(GTK_WINDOW(joinchat), "joinchat", "Gaim"); |
1210 | 198 gtk_window_set_policy(GTK_WINDOW(joinchat), FALSE, TRUE, TRUE); |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
199 gtk_widget_realize(joinchat); |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
200 gtk_signal_connect(GTK_OBJECT(joinchat), "delete_event", |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
201 GTK_SIGNAL_FUNC(destroy_join_chat), joinchat); |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
202 gtk_window_set_title(GTK_WINDOW(joinchat), _("Join Chat")); |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
203 aol_icon(joinchat->window); |
1 | 204 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
205 mainbox = gtk_vbox_new(FALSE, 5); |
1210 | 206 gtk_container_set_border_width(GTK_CONTAINER(mainbox), 5); |
207 gtk_container_add(GTK_CONTAINER(joinchat), mainbox); | |
456 | 208 |
1211 | 209 frame = gtk_frame_new(_("Buddy Chat")); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
210 gtk_box_pack_start(GTK_BOX(mainbox), frame, TRUE, TRUE, 0); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
211 |
1210 | 212 fbox = gtk_vbox_new(FALSE, 5); |
213 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5); | |
214 gtk_container_add(GTK_CONTAINER(frame), fbox); | |
456 | 215 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1018
diff
changeset
|
216 #ifndef NO_MULTI |
1210 | 217 rowbox = gtk_hbox_new(FALSE, 5); |
218 gtk_box_pack_start(GTK_BOX(fbox), rowbox, TRUE, TRUE, 0); | |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
219 |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
220 label = gtk_label_new(_("Join Chat As:")); |
1210 | 221 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0); |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
222 |
1210 | 223 create_joinchat_menu(rowbox); |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
224 |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
225 { |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
226 GtkWidget *tmp = fbox; |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
227 fbox = gtk_vbox_new(FALSE, 5); |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
228 gtk_container_add(GTK_CONTAINER(tmp), fbox); |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
229 gtk_container_set_border_width(GTK_CONTAINER(fbox), 0); |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
230 jc_vbox = fbox; |
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
231 } |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1018
diff
changeset
|
232 #else |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1018
diff
changeset
|
233 joinchatgc = connections->data; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1018
diff
changeset
|
234 #endif |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
235 rebuild_jc(); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
236 /* buttons */ |
692
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
237 |
1210 | 238 bbox = gtk_hbox_new(FALSE, 5); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
239 gtk_box_pack_start(GTK_BOX(mainbox), bbox, FALSE, FALSE, 0); |
1210 | 240 |
241 cancel = picture_button(joinchat, _("Cancel"), cancel_xpm); | |
242 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 0); | |
243 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
244 GTK_SIGNAL_FUNC(destroy_join_chat), joinchat); |
1 | 245 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
246 join = picture_button(joinchat, _("Join"), join_xpm); |
1210 | 247 gtk_box_pack_end(GTK_BOX(bbox), join, FALSE, FALSE, 0); |
1819
47e064712091
[gaim-migrate @ 1829]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1815
diff
changeset
|
248 gtk_signal_connect(GTK_OBJECT(join), "clicked", GTK_SIGNAL_FUNC(do_join_chat), NULL); |
1 | 249 } |
1210 | 250 gtk_widget_show_all(joinchat); |
1 | 251 } |
252 | |
253 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
254 static void do_invite(GtkWidget *w, struct conversation *b) |
1 | 255 { |
256 char *buddy; | |
257 char *mess; | |
258 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
259 if (!b->is_chat) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
260 debug_printf("do_invite: expecting chat, got IM\n"); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
261 return; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
262 } |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
263 |
1 | 264 buddy = gtk_entry_get_text(GTK_ENTRY(inviteentry)); |
265 mess = gtk_entry_get_text(GTK_ENTRY(invitemess)); | |
266 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
267 if (invite) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
268 serv_chat_invite(b->gc, b->id, mess, buddy); |
1 | 269 gtk_widget_destroy(invite); |
270 } | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
271 invite = NULL; |
1 | 272 } |
273 | |
274 | |
275 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
276 void invite_callback(GtkWidget *w, struct conversation *b) |
1 | 277 { |
278 GtkWidget *cancel; | |
279 GtkWidget *invite_btn; | |
280 GtkWidget *label; | |
281 GtkWidget *bbox; | |
282 GtkWidget *vbox; | |
283 GtkWidget *topbox; | |
284 if (!invite) { | |
285 invite = gtk_window_new(GTK_WINDOW_DIALOG); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
286 cancel = gtk_button_new_with_label(_("Cancel")); |
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
287 invite_btn = gtk_button_new_with_label(_("Invite")); |
1 | 288 bbox = gtk_hbox_new(TRUE, 10); |
289 topbox = gtk_hbox_new(FALSE, 5); | |
290 vbox = gtk_vbox_new(FALSE, 5); | |
291 inviteentry = gtk_entry_new(); | |
292 invitemess = gtk_entry_new(); | |
293 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
294 if (display_options & OPT_DISP_COOL_LOOK) { |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
295 gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
296 gtk_button_set_relief(GTK_BUTTON(invite_btn), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
297 } |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
298 |
1 | 299 /* Put the buttons in the box */ |
300 gtk_box_pack_start(GTK_BOX(bbox), invite_btn, TRUE, TRUE, 10); | |
301 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 10); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
302 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
303 label = gtk_label_new(_("Invite who?")); |
1 | 304 gtk_widget_show(label); |
305 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5); | |
306 gtk_box_pack_start(GTK_BOX(topbox), inviteentry, FALSE, FALSE, 5); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
307 label = gtk_label_new(_("With message:")); |
1 | 308 gtk_widget_show(label); |
309 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5); | |
310 gtk_box_pack_start(GTK_BOX(topbox), invitemess, FALSE, FALSE, 5); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
311 |
1 | 312 /* And the boxes in the box */ |
313 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5); | |
314 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
315 |
1 | 316 /* Handle closes right */ |
317 gtk_signal_connect(GTK_OBJECT(invite), "delete_event", | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
318 GTK_SIGNAL_FUNC(destroy_invite), invite); |
1 | 319 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
320 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_invite), b); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
321 gtk_signal_connect(GTK_OBJECT(invite_btn), "clicked", GTK_SIGNAL_FUNC(do_invite), b); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
322 gtk_signal_connect(GTK_OBJECT(inviteentry), "activate", GTK_SIGNAL_FUNC(do_invite), b); |
1 | 323 /* Finish up */ |
324 gtk_widget_show(invite_btn); | |
325 gtk_widget_show(cancel); | |
326 gtk_widget_show(inviteentry); | |
327 gtk_widget_show(invitemess); | |
328 gtk_widget_show(topbox); | |
329 gtk_widget_show(bbox); | |
330 gtk_widget_show(vbox); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
331 gtk_window_set_title(GTK_WINDOW(invite), _("Invite to Buddy Chat")); |
1 | 332 gtk_window_set_focus(GTK_WINDOW(invite), inviteentry); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
333 gtk_container_add(GTK_CONTAINER(invite), vbox); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
334 gtk_widget_realize(invite); |
1 | 335 aol_icon(invite->window); |
336 | |
337 } | |
338 gtk_widget_show(invite); | |
339 } | |
340 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
341 gboolean meify(char *message) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
342 { |
415
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
343 /* read /me-ify : if the message (post-HTML) starts with /me, remove |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
344 * the "/me " part of it (including that space) and return TRUE */ |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
345 char *c = message; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
346 int inside_HTML = 0; /* i really don't like descriptive names */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
347 if (!c) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
348 return FALSE; /* um... this would be very bad if this happens */ |
415
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
349 while (*c) { |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
350 if (inside_HTML) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
351 if (*c == '>') |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
352 inside_HTML = 0; |
415
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
353 } else { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
354 if (*c == '<') |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
355 inside_HTML = 1; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
356 else |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
357 break; |
415
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
358 } |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
359 c++; /* i really don't like c++ either */ |
415
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
360 } |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
361 /* k, so now we've gotten past all the HTML crap. */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
362 if (!*c) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
363 return FALSE; |
1860
91a74da87252
[gaim-migrate @ 1870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1828
diff
changeset
|
364 if (!strncasecmp(c, "/me ", 4)) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
365 sprintf(c, "%s", c + 4); |
415
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
366 return TRUE; |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
367 } else |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
368 return FALSE; |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
369 } |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
370 |
1764 | 371 void chat_write(struct conversation *b, char *who, int flag, char *message, time_t mtime) |
1 | 372 { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
373 GList *ignore = b->ignored; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
374 char *str; |
1 | 375 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
376 if (!b->is_chat) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
377 debug_printf("chat_write: expecting chat, got IM\n"); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
378 return; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
379 } |
1 | 380 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
381 while (ignore) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
382 if (!strcasecmp(who, ignore->data)) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
383 return; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
384 ignore = ignore->next; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
385 } |
371
9d22acf6db73
[gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
368
diff
changeset
|
386 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
387 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
388 if (!(flag & WFLAG_WHISPER)) { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
389 str = g_strdup(normalize(who)); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
915
diff
changeset
|
390 if (!strcasecmp(str, normalize(b->gc->username))) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
391 debug_printf("%s %s\n", normalize(who), normalize(b->gc->username)); |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
392 if (b->makesound && (sound_options & OPT_SOUND_CHAT_YOU_SAY)) |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
393 play_sound(CHAT_YOU_SAY); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
394 flag |= WFLAG_SEND; |
371
9d22acf6db73
[gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
368
diff
changeset
|
395 } else { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
396 if (b->makesound && (sound_options & OPT_SOUND_CHAT_SAY)) |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
397 play_sound(CHAT_SAY); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
398 flag |= WFLAG_RECV; |
371
9d22acf6db73
[gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
368
diff
changeset
|
399 } |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
400 g_free(str); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
401 } |
1 | 402 |
1764 | 403 write_to_conv(b, message, flag, who, mtime); |
1 | 404 } |
405 | |
406 | |
368
9bf1f77985d2
[gaim-migrate @ 378]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
363
diff
changeset
|
407 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
408 void whisper_callback(GtkWidget *widget, struct conversation *b) |
1 | 409 { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
410 char buf[BUF_LEN * 4]; |
1 | 411 char buf2[BUF_LONG]; |
412 GList *selected; | |
413 char *who; | |
414 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
415 strncpy(buf, gtk_editable_get_chars(GTK_EDITABLE(b->entry), 0, -1), sizeof(buf) / 2); |
1 | 416 if (!strlen(buf)) |
417 return; | |
418 | |
419 selected = GTK_LIST(b->list)->selection; | |
420 | |
421 if (!selected) | |
422 return; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
423 |
1 | 424 |
425 who = GTK_LABEL(gtk_container_children(GTK_CONTAINER(selected->data))->data)->label; | |
426 | |
427 if (!who) | |
428 return; | |
429 | |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
300
diff
changeset
|
430 gtk_editable_delete_text(GTK_EDITABLE(b->entry), 0, -1); |
1 | 431 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
432 escape_text(buf); /* it's ok to leave this here because oscar can't whisper */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
433 serv_chat_whisper(b->gc, b->id, who, buf); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
434 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
915
diff
changeset
|
435 g_snprintf(buf2, sizeof(buf2), "%s->%s", b->gc->username, who); |
1 | 436 |
1764 | 437 chat_write(b, buf2, WFLAG_WHISPER, buf, time((time_t)NULL)); |
1 | 438 |
439 gtk_widget_grab_focus(GTK_WIDGET(b->entry)); | |
440 | |
441 | |
442 } | |
443 | |
1920
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
444 void topic_callback(GtkWidget *widget, struct conversation *b) { |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
445 char *buf = gtk_entry_get_text(GTK_ENTRY(widget));; |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
446 |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
447 serv_chat_set_topic(b->gc, b->id, buf); |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
448 |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
449 g_free(buf); |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
450 } |
1 | 451 |
1223
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
452 static gint insertname(gconstpointer one, gconstpointer two) |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
453 { |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
454 const char *a = (const char *)one; |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
455 const char *b = (const char *)two; |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
456 |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
457 if (*a == '@') { |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
458 if (*b != '@') |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
459 return -1; |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
460 return (strcmp(a + 1, b + 1)); |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
461 } else if (*a == '+') { |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
462 if (*b == '@') |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
463 return 1; |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
464 if (*b != '+') |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
465 return -1; |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
466 return (strcmp(a + 1, b + 1)); |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
467 } else { |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
468 if (*b == '@' || *b == '+') |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
469 return 1; |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
470 return strcmp(a, b); |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
471 } |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
472 } |
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
473 |
1398
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
474 static void chat_press_im(GtkObject *obj, struct conversation *b) |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
475 { |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
476 struct conversation *c; |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
477 |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
478 c = find_conversation(gtk_object_get_user_data(obj)); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
479 |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
480 if (c != NULL) |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
481 gdk_window_show(c->window->window); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
482 else { |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
483 c = new_conversation(gtk_object_get_user_data(obj)); |
1898
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1860
diff
changeset
|
484 set_convo_gc(c, b->gc); |
1398
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
485 } |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
486 } |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
487 |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
488 static void chat_press_ign(GtkWidget *obj, struct conversation *b) |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
489 { |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
490 gtk_list_select_child(GTK_LIST(b->list), gtk_object_get_user_data(GTK_OBJECT(obj))); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
491 ignore_callback(obj, b); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
492 } |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
493 |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
494 static void chat_press_info(GtkObject *obj, struct conversation *b) |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
495 { |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
496 (*b->gc->prpl->get_info)(b->gc, gtk_object_get_user_data(obj)); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
497 } |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
498 |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
499 static gint right_click_chat(GtkObject *obj, GdkEventButton *event, struct conversation *b) |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
500 { |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
501 if (event->button == 3 && event->type == GDK_BUTTON_PRESS) { |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
502 GtkWidget *menu; |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
503 GtkWidget *button; |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
504 |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
505 menu = gtk_menu_new(); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
506 |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
507 button = gtk_menu_item_new_with_label(_("IM")); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
508 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(chat_press_im), b); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
509 gtk_object_set_user_data(GTK_OBJECT(button), gtk_object_get_user_data(obj)); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
510 gtk_menu_append(GTK_MENU(menu), button); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
511 gtk_widget_show(button); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
512 |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
513 button = gtk_menu_item_new_with_label(_("Ignore")); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
514 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(chat_press_ign), b); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
515 gtk_object_set_user_data(GTK_OBJECT(button), obj); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
516 gtk_menu_append(GTK_MENU(menu), button); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
517 gtk_widget_show(button); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
518 |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
519 if (b->gc->prpl->get_info) { |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
520 button = gtk_menu_item_new_with_label(_("Info")); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
521 gtk_signal_connect(GTK_OBJECT(button), "activate", |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
522 GTK_SIGNAL_FUNC(chat_press_info), b); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
523 gtk_object_set_user_data(GTK_OBJECT(button), gtk_object_get_user_data(obj)); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
524 gtk_menu_append(GTK_MENU(menu), button); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
525 gtk_widget_show(button); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
526 } |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
527 |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
528 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time); |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
529 return TRUE; |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
530 } |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
531 return TRUE; |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
532 } |
1 | 533 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
534 void add_chat_buddy(struct conversation *b, char *buddy) |
1 | 535 { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
536 char *name = g_strdup(buddy); |
612
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
537 char tmp[BUF_LONG]; |
1053
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
538 GtkWidget *list_item; |
1223
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
539 int pos; |
1303
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
540 GList *ignored; |
1 | 541 |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
542 plugin_event(event_chat_buddy_join, b->gc, b->name, name, 0); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
543 b->in_room = g_list_insert_sorted(b->in_room, name, insertname); |
1223
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
544 pos = g_list_index(b->in_room, name); |
1 | 545 |
1303
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
546 ignored = b->ignored; |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
547 while (ignored) { |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
548 if (!strcasecmp(name, ignored->data)) |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
549 break; |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
550 ignored = ignored->next; |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
551 } |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
552 |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
553 if (ignored) { |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
554 g_snprintf(tmp, sizeof(tmp), "X %s", name); |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
555 list_item = gtk_list_item_new_with_label(tmp); |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
556 } else |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
557 list_item = gtk_list_item_new_with_label(name); |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
558 |
1053
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
559 gtk_object_set_user_data(GTK_OBJECT(list_item), name); |
1398
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
560 gtk_signal_connect(GTK_OBJECT(list_item), "button_press_event", |
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1390
diff
changeset
|
561 GTK_SIGNAL_FUNC(right_click_chat), b); |
1223
96ab3e7b7035
[gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1211
diff
changeset
|
562 gtk_list_insert_items(GTK_LIST(b->list), g_list_append(NULL, list_item), pos); |
1053
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
563 gtk_widget_show(list_item); |
1 | 564 |
1390
a437240b9771
[gaim-migrate @ 1400]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1389
diff
changeset
|
565 g_snprintf(tmp, sizeof(tmp), _("%d %s in room"), g_list_length(b->in_room), g_list_length(b->in_room) == 1 ? "person" : "people"); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
566 gtk_label_set_text(GTK_LABEL(b->count), tmp); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
567 |
371
9d22acf6db73
[gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
368
diff
changeset
|
568 if (b->makesound && (sound_options & OPT_SOUND_CHAT_JOIN)) |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
569 play_sound(CHAT_JOIN); |
612
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
570 |
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
571 if (display_options & OPT_DISP_CHAT_LOGON) { |
1735
00f74db70f2d
[gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1732
diff
changeset
|
572 g_snprintf(tmp, sizeof(tmp), _("%s entered the room."), name); |
1764 | 573 write_to_conv(b, tmp, WFLAG_SYSTEM, NULL, time((time_t)NULL)); |
612
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
574 } |
1 | 575 } |
576 | |
577 | |
1504
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
578 void rename_chat_buddy(struct conversation *b, char *old, char *new) |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
579 { |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
580 GList *names = b->in_room; |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
581 GList *items = GTK_LIST(b->list)->children; |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
582 |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
583 char *name = g_strdup(new); |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
584 GtkWidget *list_item; |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
585 int pos; |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
586 GList *ignored = b->ignored; |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
587 |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
588 char tmp[BUF_LONG]; |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
589 |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
590 while (names) { |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
591 if (!strcasecmp((char *)names->data, old)) { |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
592 char *tmp2 = names->data; |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
593 b->in_room = g_list_remove(b->in_room, names->data); |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
594 while (items) { |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
595 if (tmp2 == gtk_object_get_user_data(items->data)) { |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
596 gtk_list_remove_items(GTK_LIST(b->list), |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
597 g_list_append(NULL, items->data)); |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
598 break; |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
599 } |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
600 items = items->next; |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
601 } |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
602 g_free(tmp2); |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
603 break; |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
604 } |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
605 names = names->next; |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
606 } |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
607 |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
608 if (!names) |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
609 return; |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
610 |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
611 b->in_room = g_list_insert_sorted(b->in_room, name, insertname); |
1505
171c64f70b66
[gaim-migrate @ 1515]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1504
diff
changeset
|
612 pos = g_list_index(b->in_room, name); |
1504
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
613 |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
614 while (ignored) { |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
615 if (!strcasecmp(old, ignored->data)) |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
616 break; |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
617 ignored = ignored->next; |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
618 } |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
619 |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
620 if (ignored) { |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
621 b->ignored = g_list_remove(b->ignored, ignored->data); |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
622 b->ignored = g_list_append(b->ignored, name); |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
623 g_snprintf(tmp, sizeof(tmp), "X %s", name); |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
624 list_item = gtk_list_item_new_with_label(tmp); |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
625 } else |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
626 list_item = gtk_list_item_new_with_label(name); |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
627 |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
628 gtk_object_set_user_data(GTK_OBJECT(list_item), name); |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
629 gtk_signal_connect(GTK_OBJECT(list_item), "button_press_event", |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
630 GTK_SIGNAL_FUNC(right_click_chat), b); |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
631 gtk_list_insert_items(GTK_LIST(b->list), g_list_append(NULL, list_item), pos); |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
632 gtk_widget_show(list_item); |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
633 |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
634 if (display_options & OPT_DISP_CHAT_LOGON) { |
1735
00f74db70f2d
[gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1732
diff
changeset
|
635 g_snprintf(tmp, sizeof(tmp), _("%s is now known as %s"), old, new); |
1764 | 636 write_to_conv(b, tmp, WFLAG_SYSTEM, NULL, time((time_t)NULL)); |
1504
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
637 } |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
638 } |
1 | 639 |
640 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
641 void remove_chat_buddy(struct conversation *b, char *buddy) |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
642 { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
643 GList *names = b->in_room; |
1053
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
644 GList *items = GTK_LIST(b->list)->children; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
645 |
612
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
646 char tmp[BUF_LONG]; |
1 | 647 |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
648 plugin_event(event_chat_buddy_leave, b->gc, b->name, buddy, 0); |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
375
diff
changeset
|
649 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
650 while (names) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
651 if (!strcasecmp((char *)names->data, buddy)) { |
1053
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
652 char *tmp = names->data; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
653 b->in_room = g_list_remove(b->in_room, names->data); |
1053
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
654 while (items) { |
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
655 if (tmp == gtk_object_get_user_data(items->data)) { |
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
656 gtk_list_remove_items(GTK_LIST(b->list), |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
657 g_list_append(NULL, items->data)); |
1053
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
658 break; |
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
659 } |
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
660 items = items->next; |
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
661 } |
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
662 g_free(tmp); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
663 break; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
664 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
665 names = names->next; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
666 } |
371
9d22acf6db73
[gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
368
diff
changeset
|
667 |
1504
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
668 if (!names) |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
669 return; |
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
670 |
1390
a437240b9771
[gaim-migrate @ 1400]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1389
diff
changeset
|
671 g_snprintf(tmp, sizeof(tmp), _("%d %s in room"), g_list_length(b->in_room), g_list_length(b->in_room) == 1 ? "person" : "people"); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
672 gtk_label_set_text(GTK_LABEL(b->count), tmp); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
673 |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
674 if (b->makesound && (sound_options & OPT_SOUND_CHAT_PART)) |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
675 play_sound(CHAT_LEAVE); |
612
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
676 |
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
677 if (display_options & OPT_DISP_CHAT_LOGON) { |
1735
00f74db70f2d
[gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1732
diff
changeset
|
678 g_snprintf(tmp, sizeof(tmp), _("%s left the room."), buddy); |
1764 | 679 write_to_conv(b, tmp, WFLAG_SYSTEM, NULL, time((time_t)NULL)); |
612
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
680 } |
1 | 681 } |
682 | |
683 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
684 void im_callback(GtkWidget *w, struct conversation *b) |
1 | 685 { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
686 char *name; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
687 GList *i; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
688 struct conversation *c; |
1 | 689 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
690 i = GTK_LIST(b->list)->selection; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
691 if (i) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
692 name = (char *)gtk_object_get_user_data(GTK_OBJECT(i->data)); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
693 else |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
694 return; |
1 | 695 |
696 c = find_conversation(name); | |
697 | |
698 if (c != NULL) { | |
699 gdk_window_raise(c->window->window); | |
700 } else { | |
701 c = new_conversation(name); | |
702 } | |
703 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
704 |
1 | 705 } |
706 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
707 void ignore_callback(GtkWidget *w, struct conversation *b) |
1 | 708 { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
709 char *name; |
1303
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
710 GList *i, *ignored; |
1053
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
711 int pos; |
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
712 GtkWidget *list_item; |
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
713 char tmp[80]; |
1 | 714 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
715 i = GTK_LIST(b->list)->selection; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
716 if (i) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
717 name = (char *)gtk_object_get_user_data(GTK_OBJECT(i->data)); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
718 else |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
719 return; |
1 | 720 |
1053
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
721 pos = gtk_list_child_position(GTK_LIST(b->list), i->data); |
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
722 |
1303
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
723 ignored = b->ignored; |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
724 while (ignored) { |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
725 if (!strcasecmp(name, ignored->data)) |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
726 break; |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
727 ignored = ignored->next; |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
728 } |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
729 |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
730 if (ignored) { |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
731 b->ignored = g_list_remove(b->ignored, ignored->data); |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
732 g_snprintf(tmp, sizeof tmp, "%s", name); |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
733 } else { |
9c34f99af79e
[gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
734 b->ignored = g_list_append(b->ignored, g_strdup(name)); |
1053
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
735 g_snprintf(tmp, sizeof tmp, "X %s", name); |
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
736 } |
1 | 737 |
1053
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
738 list_item = gtk_list_item_new_with_label(tmp); |
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
739 gtk_object_set_user_data(GTK_OBJECT(list_item), name); |
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
740 gtk_list_insert_items(GTK_LIST(b->list), g_list_append(NULL, list_item), pos); |
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
741 gtk_widget_destroy(i->data); |
864f4aae0b60
[gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
742 gtk_widget_show(list_item); |
1 | 743 } |
744 | |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
745 static gint delete_all_chats(GtkWidget *w, GdkEventAny *e, gpointer d) |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
746 { |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
747 while (chats) { |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
748 struct conversation *c = chats->data; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
749 close_callback(c->close, c); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
750 } |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
751 return FALSE; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
752 } |
1 | 753 |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
754 static void chat_switch(GtkNotebook *notebook, GtkWidget *page, gint page_num, gpointer data) |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
755 { |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
756 GtkWidget *label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(chat_notebook), |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
757 gtk_notebook_get_nth_page(GTK_NOTEBOOK(chat_notebook), page_num)); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
758 GtkStyle *style; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
759 struct conversation *b = g_list_nth_data(chats, page_num); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
760 if (b && b->window && b->entry) |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
761 gtk_window_set_focus(GTK_WINDOW(b->window), b->entry); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
762 if (!GTK_WIDGET_REALIZED(label)) |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
763 return; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
764 style = gtk_style_new(); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
765 gdk_font_unref(style->font); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
766 style->font = gdk_font_ref(label->style->font); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
767 gtk_widget_set_style(label, style); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
768 gtk_style_unref(style); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
769 b->unseen = FALSE; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
770 } |
1 | 771 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
772 void show_new_buddy_chat(struct conversation *b) |
1 | 773 { |
774 GtkWidget *win; | |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
775 GtkWidget *cont; |
1 | 776 GtkWidget *text; |
777 GtkWidget *send; | |
778 GtkWidget *list; | |
779 GtkWidget *invite_btn; | |
780 GtkWidget *whisper; | |
781 GtkWidget *close; | |
782 GtkWidget *chatentry; | |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
783 GtkWidget *lbox; |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
784 GtkWidget *bbox; |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
785 GtkWidget *bbox2; |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
786 GtkWidget *im, *ignore, *info; |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
787 GtkWidget *sw; |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
788 GtkWidget *sw2; |
1 | 789 GtkWidget *vbox; |
223 | 790 GtkWidget *vpaned; |
791 GtkWidget *hpaned; | |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
792 GtkWidget *toolbar; |
1380
638af9a58e39
[gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1358
diff
changeset
|
793 char buf[BUF_LONG]; |
844 | 794 |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
795 int dispstyle = set_dispstyle(1); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
796 |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
797 if (display_options & OPT_DISP_ONE_CHAT_WINDOW) { |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
798 if (!all_chats) { |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
799 win = all_chats = b->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
800 gtk_window_set_wmclass(GTK_WINDOW(win), "buddy_chat", "Gaim"); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
801 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
802 gtk_container_border_width(GTK_CONTAINER(win), 0); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
803 gtk_widget_realize(win); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
804 aol_icon(win->window); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
805 gtk_window_set_title(GTK_WINDOW(win), _("Gaim - Group Chats")); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
806 gtk_signal_connect(GTK_OBJECT(win), "delete_event", |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
807 GTK_SIGNAL_FUNC(delete_all_chats), NULL); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
808 |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
809 chat_notebook = gtk_notebook_new(); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
810 if (display_options & OPT_DISP_CHAT_SIDE_TAB) { |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
811 if (display_options & OPT_DISP_CHAT_BR_TAB) { |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
812 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
813 GTK_POS_RIGHT); |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
814 } else { |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
815 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
816 GTK_POS_LEFT); |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
817 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
818 } else { |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
819 if (display_options & OPT_DISP_CHAT_BR_TAB) { |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
820 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
821 GTK_POS_BOTTOM); |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
822 } else { |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
823 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
824 GTK_POS_TOP); |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
825 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
826 } |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
827 gtk_notebook_set_scrollable(GTK_NOTEBOOK(chat_notebook), TRUE); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
828 gtk_notebook_popup_enable(GTK_NOTEBOOK(chat_notebook)); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
829 gtk_container_add(GTK_CONTAINER(win), chat_notebook); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
830 gtk_signal_connect(GTK_OBJECT(chat_notebook), "switch-page", |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
831 GTK_SIGNAL_FUNC(chat_switch), NULL); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
832 gtk_widget_show(chat_notebook); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
833 } else |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
834 win = b->window = all_chats; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
835 |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
836 cont = gtk_vbox_new(FALSE, 5); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
837 gtk_container_set_border_width(GTK_CONTAINER(cont), 5); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
838 gtk_notebook_append_page(GTK_NOTEBOOK(chat_notebook), cont, gtk_label_new(b->name)); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
839 gtk_widget_show(cont); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
840 } else { |
1920
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
841 win = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
842 b->window = win; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
843 gtk_object_set_user_data(GTK_OBJECT(win), b); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
844 gtk_window_set_wmclass(GTK_WINDOW(win), "buddy_chat", "Gaim"); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
845 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
846 gtk_container_border_width(GTK_CONTAINER(win), 10); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
847 gtk_widget_realize(win); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
848 aol_icon(win->window); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
849 g_snprintf(buf, sizeof(buf), "Gaim - %s (chat)", b->name); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
850 gtk_window_set_title(GTK_WINDOW(win), buf); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
851 gtk_signal_connect(GTK_OBJECT(win), "destroy", GTK_SIGNAL_FUNC(close_callback), b); |
1920
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
852 |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
853 cont = gtk_vbox_new(FALSE,5); |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
854 gtk_container_add(GTK_CONTAINER(win), cont); |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
855 gtk_widget_show(cont); |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
856 } |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
857 |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
858 if (b->gc->prpl->options & OPT_PROTO_CHAT_TOPIC) { |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
859 GtkWidget *hbox; |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
860 GtkWidget *label; |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
861 |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
862 hbox = gtk_hbox_new(FALSE, 0); |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
863 gtk_box_pack_start(GTK_BOX(cont), hbox, FALSE, FALSE, 5); |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
864 gtk_widget_show(hbox); |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
865 |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
866 label = gtk_label_new(_("Topic:")); |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
867 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
868 gtk_widget_show(label); |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
869 |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
870 b->topic_text = gtk_entry_new(); |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
871 gtk_signal_connect(GTK_OBJECT(b->topic_text), "activate", |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
872 GTK_SIGNAL_FUNC(topic_callback), b); |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
873 gtk_box_pack_start(GTK_BOX(hbox), b->topic_text, TRUE, TRUE, 5); |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
874 gtk_widget_show(b->topic_text); |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
875 } |
1 | 876 |
223 | 877 vpaned = gtk_vpaned_new(); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
878 gtk_paned_set_gutter_size(GTK_PANED(vpaned), 15); |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
879 gtk_container_add(GTK_CONTAINER(cont), vpaned); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
880 gtk_widget_show(vpaned); |
223 | 881 |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
882 hpaned = gtk_hpaned_new(); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
883 gtk_paned_set_gutter_size(GTK_PANED(hpaned), 15); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
884 gtk_paned_pack1(GTK_PANED(vpaned), hpaned, TRUE, FALSE); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
885 gtk_widget_show(hpaned); |
26 | 886 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
887 sw = gtk_scrolled_window_new(NULL, NULL); |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
888 b->sw = sw; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
889 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
890 gtk_paned_pack1(GTK_PANED(hpaned), sw, TRUE, TRUE); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1807
diff
changeset
|
891 gtk_widget_set_usize(sw, buddy_chat_size.width, buddy_chat_size.height); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
892 gtk_widget_show(sw); |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
893 |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1398
diff
changeset
|
894 text = gtk_imhtml_new(NULL, NULL); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
895 b->text = text; |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
896 gtk_container_add(GTK_CONTAINER(sw), text); |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1398
diff
changeset
|
897 GTK_LAYOUT(text)->hadjustment->step_increment = 10.0; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1398
diff
changeset
|
898 GTK_LAYOUT(text)->vadjustment->step_increment = 10.0; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1398
diff
changeset
|
899 if (display_options & OPT_DISP_SHOW_TIME) |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1398
diff
changeset
|
900 gtk_imhtml_show_comments(GTK_IMHTML(text), TRUE); |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
901 gaim_setup_imhtml(text); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
902 gtk_widget_show(text); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
903 |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
904 lbox = gtk_vbox_new(FALSE, 5); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
905 gtk_paned_pack2(GTK_PANED(hpaned), lbox, TRUE, TRUE); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
906 gtk_widget_show(lbox); |
1 | 907 |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
908 b->count = gtk_label_new(_("0 people in room")); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
909 gtk_box_pack_start(GTK_BOX(lbox), b->count, FALSE, FALSE, 0); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
910 gtk_widget_show(b->count); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
911 |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
912 sw2 = gtk_scrolled_window_new(NULL, NULL); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
913 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
914 gtk_box_pack_start(GTK_BOX(lbox), sw2, TRUE, TRUE, 0); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
915 gtk_widget_show(sw2); |
1 | 916 |
917 list = gtk_list_new(); | |
918 b->list = list; | |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
919 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), list); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
920 gtk_widget_set_usize(list, 150, -1); |
1 | 921 gtk_widget_show(list); |
922 | |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
923 bbox2 = gtk_hbox_new(TRUE, 5); |
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
924 gtk_box_pack_start(GTK_BOX(lbox), bbox2, FALSE, FALSE, 0); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
925 gtk_widget_show(bbox2); |
1 | 926 |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
927 im = picture_button2(win, _("IM"), tmp_send_xpm, FALSE); |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
928 gtk_box_pack_start(GTK_BOX(bbox2), im, dispstyle, dispstyle, 0); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
929 gtk_signal_connect(GTK_OBJECT(im), "clicked", GTK_SIGNAL_FUNC(im_callback), b); |
1 | 930 |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
931 ignore = picture_button2(win, _("Ignore"), close_xpm, FALSE); |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
932 gtk_box_pack_start(GTK_BOX(bbox2), ignore, dispstyle, dispstyle, 0); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
933 gtk_signal_connect(GTK_OBJECT(ignore), "clicked", GTK_SIGNAL_FUNC(ignore_callback), b); |
1 | 934 |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
935 info = picture_button2(win, _("Info"), tb_search_xpm, FALSE); |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
936 gtk_box_pack_start(GTK_BOX(bbox2), info, dispstyle, dispstyle, 0); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
937 gtk_signal_connect(GTK_OBJECT(info), "clicked", GTK_SIGNAL_FUNC(info_callback), b); |
1343 | 938 b->info = info; |
844 | 939 |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
940 vbox = gtk_vbox_new(FALSE, 5); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
941 gtk_paned_pack2(GTK_PANED(vpaned), vbox, TRUE, FALSE); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
942 gtk_widget_show(vbox); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
943 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
944 chatentry = gtk_text_new(NULL, NULL); |
1227
25611364a504
[gaim-migrate @ 1237]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1223
diff
changeset
|
945 b->entry = chatentry; |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
946 if (!(display_options & OPT_DISP_ONE_CHAT_WINDOW)) |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
947 gtk_window_set_focus(GTK_WINDOW(b->window), b->entry); |
1227
25611364a504
[gaim-migrate @ 1237]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1223
diff
changeset
|
948 |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
949 toolbar = build_conv_toolbar(b); |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
950 gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0); |
1 | 951 |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
952 gtk_object_set_user_data(GTK_OBJECT(chatentry), b); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
953 gtk_text_set_editable(GTK_TEXT(chatentry), TRUE); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
954 gtk_text_set_word_wrap(GTK_TEXT(chatentry), TRUE); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
955 gtk_signal_connect(GTK_OBJECT(chatentry), "activate", GTK_SIGNAL_FUNC(send_callback), b); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
956 gtk_signal_connect(GTK_OBJECT(chatentry), "key_press_event", GTK_SIGNAL_FUNC(keypress_callback), |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
957 b); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
958 gtk_signal_connect(GTK_OBJECT(chatentry), "key_press_event", GTK_SIGNAL_FUNC(entry_key_pressed), |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
959 chatentry); |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1109
diff
changeset
|
960 if (general_options & OPT_GEN_CHECK_SPELLING) |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1109
diff
changeset
|
961 gtkspell_attach(GTK_TEXT(chatentry)); |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
962 gtk_box_pack_start(GTK_BOX(vbox), chatentry, TRUE, TRUE, 0); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1807
diff
changeset
|
963 gtk_widget_set_usize(chatentry, buddy_chat_size.width, buddy_chat_size.entry_height); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
964 gtk_window_set_focus(GTK_WINDOW(win), chatentry); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
965 gtk_widget_show(chatentry); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
966 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
967 bbox = gtk_hbox_new(FALSE, 5); |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
968 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
969 gtk_widget_show(bbox); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
970 |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
971 close = picture_button2(win, _("Close"), cancel_xpm, dispstyle); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
972 b->close = close; |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
973 gtk_object_set_user_data(GTK_OBJECT(close), b); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
974 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(close_callback), b); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
975 gtk_box_pack_end(GTK_BOX(bbox), close, dispstyle, dispstyle, 0); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
976 |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
977 invite_btn = picture_button2(win, _("Invite"), join_xpm, dispstyle); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
978 b->invite = invite_btn; |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
979 gtk_signal_connect(GTK_OBJECT(invite_btn), "clicked", GTK_SIGNAL_FUNC(invite_callback), b); |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
980 gtk_box_pack_end(GTK_BOX(bbox), invite_btn, dispstyle, dispstyle, 0); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
981 |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
982 whisper = picture_button2(win, _("Whisper"), tb_forward_xpm, dispstyle); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
983 b->whisper = whisper; |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
984 gtk_signal_connect(GTK_OBJECT(whisper), "clicked", GTK_SIGNAL_FUNC(whisper_callback), b); |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
985 gtk_box_pack_end(GTK_BOX(bbox), whisper, dispstyle, dispstyle, 0); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
986 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
987 send = picture_button2(win, _("Send"), tmp_send_xpm, dispstyle); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
988 b->send = send; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
989 gtk_signal_connect(GTK_OBJECT(send), "clicked", GTK_SIGNAL_FUNC(send_callback), b); |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
990 gtk_box_pack_end(GTK_BOX(bbox), send, dispstyle, dispstyle, 0); |
1 | 991 |
716 | 992 b->font_dialog = NULL; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
993 b->fg_color_dialog = NULL; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
994 b->bg_color_dialog = NULL; |
716 | 995 b->smiley_dialog = NULL; |
996 b->link_dialog = NULL; | |
997 b->log_dialog = NULL; | |
998 sprintf(b->fontface, "%s", fontface); | |
999 b->hasfont = 0; | |
1441
5c67b8794991
[gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1428
diff
changeset
|
1000 b->fontsize = fontsize; |
5c67b8794991
[gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1428
diff
changeset
|
1001 b->hassize = 0; |
716 | 1002 b->bgcol = bgcolor; |
1003 b->hasbg = 0; | |
1004 b->fgcol = fgcolor; | |
1005 b->hasfg = 0; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1006 |
1343 | 1007 update_buttons_by_protocol(b); |
1008 | |
1 | 1009 gtk_widget_show(win); |
1010 } | |
1011 | |
1920
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
1012 void chat_set_topic(struct conversation *b, char* who, char* topic) { |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
1013 gtk_entry_set_text(GTK_ENTRY(b->topic_text), topic); |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
1014 } |
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
1015 |
1 | 1016 |
1017 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1018 void handle_click_chat(GtkWidget *widget, GdkEventButton * event, struct chat_room *cr) |
1 | 1019 { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1020 if (event->type == GDK_2BUTTON_PRESS && event->button == 1) { |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1053
diff
changeset
|
1021 /* FIXME : double click on chat in buddy list */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1022 serv_join_chat(connections->data, cr->exchange, cr->name); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1023 } |
1 | 1024 } |
1025 | |
1026 | |
1027 void setup_buddy_chats() | |
1028 { | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1029 GList *list; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1030 struct chat_room *cr; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1031 GList *crs = chat_rooms; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1032 GtkWidget *w; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1033 GtkWidget *item; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1034 GtkWidget *tree; |
1 | 1035 |
21 | 1036 if (buddies == NULL) |
1037 return; | |
1038 | |
1039 list = GTK_TREE(buddies)->children; | |
1040 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1041 while (list) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1042 w = (GtkWidget *)list->data; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1043 if (!strcmp(GTK_LABEL(GTK_BIN(w)->child)->label, _("Buddy Chat"))) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1044 gtk_tree_remove_items(GTK_TREE(buddies), list); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1045 list = GTK_TREE(buddies)->children; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1046 if (!list) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1047 break; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1048 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1049 list = list->next; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1050 } |
1 | 1051 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1052 if (crs == NULL) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1053 return; |
1 | 1054 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1055 item = gtk_tree_item_new_with_label(_("Buddy Chat")); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1056 tree = gtk_tree_new(); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1057 gtk_widget_show(item); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1058 gtk_widget_show(tree); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1059 gtk_tree_append(GTK_TREE(buddies), item); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1060 gtk_tree_item_set_subtree(GTK_TREE_ITEM(item), tree); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1061 gtk_tree_item_expand(GTK_TREE_ITEM(item)); |
1 | 1062 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1063 while (crs) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1064 cr = (struct chat_room *)crs->data; |
1 | 1065 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1066 item = gtk_tree_item_new_with_label(cr->name); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1067 gtk_object_set_user_data(GTK_OBJECT(item), cr); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1068 gtk_tree_append(GTK_TREE(tree), item); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1069 gtk_widget_show(item); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1070 gtk_signal_connect(GTK_OBJECT(item), "button_press_event", |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1071 GTK_SIGNAL_FUNC(handle_click_chat), cr); |
1 | 1072 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1073 crs = crs->next; |
1 | 1074 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1075 } |
1 | 1076 |
1077 } | |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
1078 |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
909
diff
changeset
|
1079 static GtkWidget *change_text(GtkWidget *win, char *text, GtkWidget *button, char **xpm, int chat) |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
1080 { |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
909
diff
changeset
|
1081 int dispstyle = set_dispstyle(chat); |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
1082 GtkWidget *parent = button->parent; |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
1083 gtk_widget_destroy(button); |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
1084 button = picture_button2(win, text, xpm, dispstyle); |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
909
diff
changeset
|
1085 if (chat == 1) |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1086 gtk_box_pack_start(GTK_BOX(parent), button, dispstyle, dispstyle, 5); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1087 else |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1088 gtk_box_pack_end(GTK_BOX(parent), button, dispstyle, dispstyle, 0); |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
1089 gtk_widget_show(button); |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
1090 return button; |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
1091 } |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
1092 |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
1093 void update_chat_button_pix() |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
1094 { |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1095 GSList *C = connections; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1096 struct gaim_connection *g; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1097 |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1098 while (C) { |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1099 GSList *bcs; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1100 struct conversation *c; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1101 int opt = 1; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1102 g = (struct gaim_connection *)C->data; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1103 bcs = g->buddy_chats; |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
1104 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1105 while (bcs) { |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1106 c = (struct conversation *)bcs->data; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1107 c->send = change_text(c->window, _("Send"), c->send, tmp_send_xpm, opt); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1108 c->whisper = |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1109 change_text(c->window, _("Whisper"), c->whisper, tb_forward_xpm, opt); |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1110 c->invite = change_text(c->window, _("Invite"), c->invite, join_xpm, opt); |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1111 c->close = change_text(c->window, _("Close"), c->close, cancel_xpm, opt); |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1112 gtk_object_set_user_data(GTK_OBJECT(c->close), c); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1113 gtk_signal_connect(GTK_OBJECT(c->close), "clicked", |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1114 GTK_SIGNAL_FUNC(close_callback), c); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1115 gtk_signal_connect(GTK_OBJECT(c->send), "clicked", |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1116 GTK_SIGNAL_FUNC(send_callback), c); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1117 gtk_signal_connect(GTK_OBJECT(c->invite), "clicked", |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1118 GTK_SIGNAL_FUNC(invite_callback), c); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1119 gtk_signal_connect(GTK_OBJECT(c->whisper), "clicked", |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1120 GTK_SIGNAL_FUNC(whisper_callback), c); |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1121 bcs = bcs->next; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1122 } |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1123 C = C->next; |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
1124 } |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
1125 } |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1126 |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1127 void update_im_button_pix() |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1128 { |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1129 GList *bcs = conversations; |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1130 struct conversation *c; |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1131 GtkWidget *parent; |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
909
diff
changeset
|
1132 int opt = 0; |
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
909
diff
changeset
|
1133 int dispstyle = set_dispstyle(0); |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1134 |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1135 while (bcs) { |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1136 c = (struct conversation *)bcs->data; |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1137 parent = c->close->parent; |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1138 c->close = change_text(c->window, _("Close"), c->close, cancel_xpm, opt); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1139 gtk_box_reorder_child(GTK_BOX(parent), c->close, 0); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1140 gtk_box_set_child_packing(GTK_BOX(parent), c->sep1, dispstyle, dispstyle, 0, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1141 GTK_PACK_END); |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1018
diff
changeset
|
1142 if (find_buddy(c->gc, c->name) == NULL) |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1143 c->add = change_text(c->window, _("Add"), c->add, gnome_add_xpm, opt); |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1144 else |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1145 c->add = change_text(c->window, _("Remove"), c->add, gnome_remove_xpm, opt); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1146 gtk_box_reorder_child(GTK_BOX(parent), c->add, 2); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1147 c->block = change_text(c->window, _("Block"), c->block, block_xpm, opt); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1148 gtk_box_reorder_child(GTK_BOX(parent), c->block, 3); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1149 c->warn = change_text(c->window, _("Warn"), c->warn, warn_xpm, opt); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1150 gtk_box_reorder_child(GTK_BOX(parent), c->warn, 4); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1151 c->info = change_text(c->window, _("Info"), c->info, tb_search_xpm, opt); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1152 gtk_box_reorder_child(GTK_BOX(parent), c->info, 5); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1153 c->send = change_text(c->window, _("Send"), c->send, tmp_send_xpm, opt); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1154 gtk_box_set_child_packing(GTK_BOX(parent), c->sep2, dispstyle, dispstyle, 0, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1155 GTK_PACK_END); |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1156 gtk_box_reorder_child(GTK_BOX(parent), c->send, 7); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1157 gtk_object_set_user_data(GTK_OBJECT(c->close), c); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1158 gtk_signal_connect(GTK_OBJECT(c->close), "clicked", GTK_SIGNAL_FUNC(close_callback), c); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1159 gtk_signal_connect(GTK_OBJECT(c->send), "clicked", GTK_SIGNAL_FUNC(send_callback), c); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1160 gtk_signal_connect(GTK_OBJECT(c->add), "clicked", GTK_SIGNAL_FUNC(add_callback), c); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1161 gtk_signal_connect(GTK_OBJECT(c->info), "clicked", GTK_SIGNAL_FUNC(info_callback), c); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1162 gtk_signal_connect(GTK_OBJECT(c->warn), "clicked", GTK_SIGNAL_FUNC(warn_callback), c); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
1163 gtk_signal_connect(GTK_OBJECT(c->block), "clicked", GTK_SIGNAL_FUNC(block_callback), c); |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1164 bcs = bcs->next; |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1165 } |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1166 } |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1167 |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1168 void chat_tabize() |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1169 { |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1170 /* evil, evil i tell you! evil! */ |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1171 if (display_options & OPT_DISP_ONE_CHAT_WINDOW) { |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1172 GList *x = chats; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1173 while (x) { |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1174 struct conversation *c = x->data; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1175 GtkWidget *imhtml, *win; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1176 |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1177 imhtml = c->text; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1178 win = c->window; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1179 show_new_buddy_chat(c); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1180 gtk_widget_destroy(c->text); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1181 gtk_widget_reparent(imhtml, c->sw); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1182 c->text = imhtml; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1183 gtk_signal_disconnect_by_func(GTK_OBJECT(win), |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1184 GTK_SIGNAL_FUNC(close_callback), c); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1185 gtk_widget_destroy(win); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1186 |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1187 x = x->next; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1188 } |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1189 } else { |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1190 GList *x, *m; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1191 x = m = chats; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1192 chats = NULL; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1193 while (x) { |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1194 struct conversation *c = x->data; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1195 GtkWidget *imhtml; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1196 |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1197 imhtml = c->text; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1198 show_new_buddy_chat(c); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1199 gtk_widget_destroy(c->text); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1200 gtk_widget_reparent(imhtml, c->sw); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1201 c->text = imhtml; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1202 |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1203 x = x->next; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1204 } |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1205 if (all_chats) |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1206 gtk_widget_destroy(all_chats); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1207 all_chats = NULL; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
1208 chat_notebook = NULL; |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1209 chats = m; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1210 } |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1505
diff
changeset
|
1211 } |