annotate src/conversation.c @ 11553:5c8210f7cbe2

[gaim-migrate @ 13813] Here is my menu tray widget. It needs a bit of work yet and is only capable of displaying status information at the moment. Integration coming in my next commit... committer: Tailor Script <tailor@pidgin.im>
author Gary Kramlich <grim@reaperworld.com>
date Sat, 17 Sep 2005 03:23:50 +0000
parents 11d30825c1bb
children 9b3833da6840
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 * gaim
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 8015
diff changeset
4 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 8015
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 8015
diff changeset
6 * source distribution.
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
7 *
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 * (at your option) any later version.
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 *
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 * GNU General Public License for more details.
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 *
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21 */
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5860
diff changeset
22 #include "internal.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5860
diff changeset
23 #include "blist.h"
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
24 #include "conversation.h"
11146
1c5398ccbeb0 [gaim-migrate @ 13217]
Piotr Zielinski <zielaj>
parents: 11137
diff changeset
25 #include "dbus-maybe.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5860
diff changeset
26 #include "debug.h"
6982
083d1e4a9c78 [gaim-migrate @ 7538]
Mark Doliner <mark@kingant.net>
parents: 6846
diff changeset
27 #include "imgstore.h"
5436
ad445074d239 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5350
diff changeset
28 #include "notify.h"
5539
de09863bd4b5 [gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
29 #include "prefs.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5860
diff changeset
30 #include "prpl.h"
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
31 #include "signals.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5860
diff changeset
32 #include "util.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5860
diff changeset
33
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
34 typedef struct
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
35 {
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
36 char *id;
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
37 char *name;
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
38 GaimConvPlacementFunc fnc;
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
39
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
40 } ConvPlacementData;
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
41
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
42 #define SEND_TYPED_TIMEOUT 5000
4241
cc14954cc399 [gaim-migrate @ 4491]
Luke Schierer <lschiere@pidgin.im>
parents: 4228
diff changeset
43
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
44 static GaimConvWindowUiOps *win_ui_ops = NULL;
4481
b30b0a02ada0 [gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents: 4478
diff changeset
45
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
46 static GList *conversations = NULL;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
47 static GList *ims = NULL;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
48 static GList *chats = NULL;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
49 static GList *windows = NULL;
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
50 static GList *conv_placement_fncs = NULL;
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
51 static GaimConvPlacementFunc place_conv = NULL;
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
52
7602
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
53 static void ensure_default_funcs(void);
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
54 static void conv_placement_last_created_win(GaimConversation *conv);
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
55
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
56 static gboolean
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
57 reset_typing(gpointer data)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
58 {
6640
314111e7b601 [gaim-migrate @ 7165]
Christian Hammond <chipx86@chipx86.com>
parents: 6637
diff changeset
59 GaimConversation *c = (GaimConversation *)data;
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
60 GaimConvIm *im;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
61
6640
314111e7b601 [gaim-migrate @ 7165]
Christian Hammond <chipx86@chipx86.com>
parents: 6637
diff changeset
62 if (!g_list_find(conversations, c))
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
63 return FALSE;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
64
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
65 im = GAIM_CONV_IM(c);
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
66
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
67 gaim_conv_im_set_typing_state(im, GAIM_NOT_TYPING);
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
68 gaim_conv_im_update_typing(im);
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
69 gaim_conv_im_stop_typing_timeout(im);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
70
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
71 return FALSE;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
72 }
3159
fce1883cc608 [gaim-migrate @ 3175]
Sean Egan <seanegan@gmail.com>
parents: 3129
diff changeset
73
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
74 static gboolean
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
75 send_typed(gpointer data)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
76 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
77 GaimConversation *conv = (GaimConversation *)data;
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5545
diff changeset
78 GaimConnection *gc;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
79 const char *name;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
80
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
81 gc = gaim_conversation_get_gc(conv);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
82 name = gaim_conversation_get_name(conv);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
83
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
84 if (conv != NULL && gc != NULL && name != NULL) {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
85 gaim_conv_im_set_type_again(GAIM_CONV_IM(conv), TRUE);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
86
6402
cc35d07a0dcc [gaim-migrate @ 6907]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
87 serv_send_typing(gc, name, GAIM_TYPED);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
88
5213
1cf4eb75e3ee [gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
89 gaim_debug(GAIM_DEBUG_MISC, "conversation", "typed...\n");
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
90 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
91
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
92 return FALSE;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
93 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
94
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
95 static void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
96 common_send(GaimConversation *conv, const char *message)
3790
12b29552f1d7 [gaim-migrate @ 3930]
Rob Flynn <gaim@robflynn.com>
parents: 3789
diff changeset
97 {
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
98 GaimConversationType type;
10132
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
99 GaimAccount *account;
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5545
diff changeset
100 GaimConnection *gc;
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
101 GaimConversationUiOps *ops;
8076
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
102 char *displayed = NULL, *sent = NULL;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
103 int plugin_return;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
104 int err = 0;
3790
12b29552f1d7 [gaim-migrate @ 3930]
Rob Flynn <gaim@robflynn.com>
parents: 3789
diff changeset
105
7947
746404b12236 [gaim-migrate @ 8621]
Mark Doliner <mark@kingant.net>
parents: 7930
diff changeset
106 if (strlen(message) == 0)
746404b12236 [gaim-migrate @ 8621]
Mark Doliner <mark@kingant.net>
parents: 7930
diff changeset
107 return;
746404b12236 [gaim-migrate @ 8621]
Mark Doliner <mark@kingant.net>
parents: 7930
diff changeset
108
10132
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
109 account = gaim_conversation_get_account(conv);
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
110 gc = gaim_conversation_get_gc(conv);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
111
10132
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
112 g_return_if_fail(account != NULL);
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
113 g_return_if_fail(gc != NULL);
3731
d3592d407c9b [gaim-migrate @ 3869]
Sean Egan <seanegan@gmail.com>
parents: 3716
diff changeset
114
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
115 type = gaim_conversation_get_type(conv);
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
116 ops = gaim_conversation_get_ui_ops(conv);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
117
10665
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
118 if (conv->features & GAIM_CONNECTION_HTML)
8076
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
119 displayed = gaim_markup_linkify(message);
5136
381da05cb5ed [gaim-migrate @ 5500]
Nathan Walp <nwalp@pidgin.im>
parents: 5103
diff changeset
120 else
8076
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
121 displayed = g_strdup(message);
5136
381da05cb5ed [gaim-migrate @ 5500]
Nathan Walp <nwalp@pidgin.im>
parents: 5103
diff changeset
122
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
123 plugin_return =
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
124 GPOINTER_TO_INT(gaim_signal_emit_return_1(
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
125 gaim_conversations_get_handle(),
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
126 (type == GAIM_CONV_TYPE_IM ? "writing-im-msg" : "writing-chat-msg"),
10132
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
127 account, conv, &displayed));
8076
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
128
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
129 if (displayed == NULL)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
130 return;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
131
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
132 if (plugin_return) {
8076
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
133 g_free(displayed);
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
134 return;
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
135 }
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
136
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
137 gaim_signal_emit(gaim_conversations_get_handle(),
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
138 (type == GAIM_CONV_TYPE_IM ? "wrote-im-msg" : "wrote-chat-msg"),
10132
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
139 account, conv, displayed);
8076
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
140
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
141 sent = g_strdup(displayed);
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
142
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
143 plugin_return =
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
144 GPOINTER_TO_INT(gaim_signal_emit_return_1(
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
145 gaim_conversations_get_handle(), (type == GAIM_CONV_TYPE_IM ?
8076
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
146 "displaying-im-msg" : "displaying-chat-msg"),
10132
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
147 account, conv, &displayed));
8076
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
148
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
149 if (plugin_return) {
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
150 g_free(displayed);
8078
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
151 displayed = NULL;
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
152 } else {
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
153 gaim_signal_emit(gaim_conversations_get_handle(),
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
154 (type == GAIM_CONV_TYPE_IM ? "displayed-im-msg" : "displayed-chat-msg"),
10132
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
155 account, conv, displayed);
796
4783a3b6859d [gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 795
diff changeset
156 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
157
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
158 if (type == GAIM_CONV_TYPE_IM) {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
159 GaimConvIm *im = GAIM_CONV_IM(conv);
2102
899c22dcee42 [gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2094
diff changeset
160
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
161 gaim_signal_emit(gaim_conversations_get_handle(), "sending-im-msg",
10132
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
162 account,
8076
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
163 gaim_conversation_get_name(conv), &sent);
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
164
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
165 if (sent != NULL && sent[0] != '\0') {
6982
083d1e4a9c78 [gaim-migrate @ 7538]
Mark Doliner <mark@kingant.net>
parents: 6846
diff changeset
166 GaimMessageFlags msgflags = GAIM_MESSAGE_SEND;
083d1e4a9c78 [gaim-migrate @ 7538]
Mark Doliner <mark@kingant.net>
parents: 6846
diff changeset
167
10665
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
168 if (conv->features & GAIM_CONNECTION_HTML) {
8442
3d0178c4f390 [gaim-migrate @ 9172]
Luke Schierer <lschiere@pidgin.im>
parents: 8386
diff changeset
169 err = serv_send_im(gc, gaim_conversation_get_name(conv),
9166
1e51236d825e [gaim-migrate @ 9951]
Tim Ringenbach <marv@pidgin.im>
parents: 9155
diff changeset
170 sent, 0);
8442
3d0178c4f390 [gaim-migrate @ 9172]
Luke Schierer <lschiere@pidgin.im>
parents: 8386
diff changeset
171 } else {
3d0178c4f390 [gaim-migrate @ 9172]
Luke Schierer <lschiere@pidgin.im>
parents: 8386
diff changeset
172 gchar *tmp = gaim_unescape_html(sent);
3d0178c4f390 [gaim-migrate @ 9172]
Luke Schierer <lschiere@pidgin.im>
parents: 8386
diff changeset
173 err = serv_send_im(gc, gaim_conversation_get_name(conv),
9166
1e51236d825e [gaim-migrate @ 9951]
Tim Ringenbach <marv@pidgin.im>
parents: 9155
diff changeset
174 tmp, 0);
8442
3d0178c4f390 [gaim-migrate @ 9172]
Luke Schierer <lschiere@pidgin.im>
parents: 8386
diff changeset
175 g_free(tmp);
3d0178c4f390 [gaim-migrate @ 9172]
Luke Schierer <lschiere@pidgin.im>
parents: 8386
diff changeset
176 }
6982
083d1e4a9c78 [gaim-migrate @ 7538]
Mark Doliner <mark@kingant.net>
parents: 6846
diff changeset
177
8078
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
178 if ((err > 0) && (displayed != NULL))
8076
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
179 gaim_conv_im_write(im, NULL, displayed, msgflags, time(NULL));
6982
083d1e4a9c78 [gaim-migrate @ 7538]
Mark Doliner <mark@kingant.net>
parents: 6846
diff changeset
180
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
181 gaim_signal_emit(gaim_conversations_get_handle(), "sent-im-msg",
10132
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
182 account,
8076
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
183 gaim_conversation_get_name(conv), sent);
2102
899c22dcee42 [gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2094
diff changeset
184 }
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
185 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
186 else {
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
187 gaim_signal_emit(gaim_conversations_get_handle(), "sending-chat-msg",
10132
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
188 account, &sent,
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
189 gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv)));
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
190
8076
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
191 if (sent != NULL && sent[0] != '\0') {
10665
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
192 if (conv->features & GAIM_CONNECTION_HTML) {
8442
3d0178c4f390 [gaim-migrate @ 9172]
Luke Schierer <lschiere@pidgin.im>
parents: 8386
diff changeset
193 err = serv_chat_send(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv)), sent);
3d0178c4f390 [gaim-migrate @ 9172]
Luke Schierer <lschiere@pidgin.im>
parents: 8386
diff changeset
194 } else {
3d0178c4f390 [gaim-migrate @ 9172]
Luke Schierer <lschiere@pidgin.im>
parents: 8386
diff changeset
195 gchar *tmp = gaim_unescape_html(sent);
3d0178c4f390 [gaim-migrate @ 9172]
Luke Schierer <lschiere@pidgin.im>
parents: 8386
diff changeset
196 err = serv_chat_send(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv)), tmp);
3d0178c4f390 [gaim-migrate @ 9172]
Luke Schierer <lschiere@pidgin.im>
parents: 8386
diff changeset
197 g_free(tmp);
3d0178c4f390 [gaim-migrate @ 9172]
Luke Schierer <lschiere@pidgin.im>
parents: 8386
diff changeset
198 }
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
199
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
200 gaim_signal_emit(gaim_conversations_get_handle(), "sent-chat-msg",
10132
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
201 account, sent,
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
202 gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv)));
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
203 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
204 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
205
2123
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
206 if (err < 0) {
10132
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
207 const char *who;
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
208 char *msg;
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
209
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
210 who = gaim_conversation_get_name(conv);
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
211
5213
1cf4eb75e3ee [gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
212 if (err == -E2BIG) {
10132
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
213 msg = _("Unable to send message: The message is too large.");
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
214
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
215 if (!gaim_conv_present_error(who, account, msg)) {
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
216 msg = g_strdup_printf(_("Unable to send message to %s."), who);
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
217 gaim_notify_error(gc, NULL, msg, _("The message is too large."));
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
218 g_free(msg);
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
219 }
5213
1cf4eb75e3ee [gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
220 }
1cf4eb75e3ee [gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
221 else if (err == -ENOTCONN) {
1cf4eb75e3ee [gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
222 gaim_debug(GAIM_DEBUG_ERROR, "conversation",
1cf4eb75e3ee [gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
223 "Not yet connected.\n");
1cf4eb75e3ee [gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
224 }
1cf4eb75e3ee [gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
225 else {
10132
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
226 msg = _("Unable to send message.");
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
227
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
228 if (!gaim_conv_present_error(who, account, msg)) {
10962
ee4ca56ed8a5 [gaim-migrate @ 12765]
Gary Kramlich <grim@reaperworld.com>
parents: 10958
diff changeset
229 msg = g_strdup_printf(_("Unable to send message to %s."), who);
10132
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
230 gaim_notify_error(gc, NULL, msg, NULL);
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
231 g_free(msg);
f55a64945e77 [gaim-migrate @ 11196]
Mark Doliner <mark@kingant.net>
parents: 10116
diff changeset
232 }
5213
1cf4eb75e3ee [gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
233 }
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
234 }
8076
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
235
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
236 g_free(displayed);
504d98d14c25 [gaim-migrate @ 8775]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
237 g_free(sent);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
238 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
239
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
240 GaimConvWindow *
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
241 gaim_conv_window_new(void)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
242 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
243 GaimConvWindow *win;
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
244
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
245 win = g_new0(GaimConvWindow, 1);
11146
1c5398ccbeb0 [gaim-migrate @ 13217]
Piotr Zielinski <zielaj>
parents: 11137
diff changeset
246 GAIM_DBUS_REGISTER_POINTER(win, GaimConvWindow);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
247
5860
52d5fad43950 [gaim-migrate @ 6291]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
248 windows = g_list_append(windows, win);
52d5fad43950 [gaim-migrate @ 6291]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
249
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
250 win->ui_ops = gaim_conversations_get_win_ui_ops();
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
251
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
252 if (win->ui_ops != NULL && win->ui_ops->new_window != NULL)
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
253 win->ui_ops->new_window(win);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
254
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
255 return win;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
256 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
257
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
258 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
259 gaim_conv_window_destroy(GaimConvWindow *win)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
260 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
261 GaimConvWindowUiOps *ops;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
262 GList *node;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
263
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
264 g_return_if_fail(win != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
265
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
266 ops = gaim_conv_window_get_ui_ops(win);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
267
4638
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
268 /*
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
269 * If there are any conversations in this, destroy them all. The last
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
270 * conversation will call gaim_conv_window_destroy(), but this time, this
4638
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
271 * check will fail and the window will actually be destroyed.
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
272 *
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
273 * This is needed because chats may not close right away. They may
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
274 * wait for notification first. When they get that, the window is
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
275 * already destroyed, and gaim either crashes or spits out gtk warnings.
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
276 * The problem is fixed with this check.
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
277 */
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
278 if (gaim_conv_window_get_conversation_count(win) > 0) {
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
279
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
280 node = g_list_first(gaim_conv_window_get_conversations(win));
4647
ba87412b1a57 [gaim-migrate @ 4957]
Nathan Walp <nwalp@pidgin.im>
parents: 4638
diff changeset
281 while(node != NULL)
4638
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
282 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
283 GaimConversation *conv = node->data;
4647
ba87412b1a57 [gaim-migrate @ 4957]
Nathan Walp <nwalp@pidgin.im>
parents: 4638
diff changeset
284
ba87412b1a57 [gaim-migrate @ 4957]
Nathan Walp <nwalp@pidgin.im>
parents: 4638
diff changeset
285 node = g_list_next(node);
4638
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
286
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
287 gaim_conversation_destroy(conv);
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
288 }
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
289 }
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
290 else
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
291 {
4638
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
292 if (ops != NULL && ops->destroy_window != NULL)
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
293 ops->destroy_window(win);
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
294
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
295 g_list_free(gaim_conv_window_get_conversations(win));
4638
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
296
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
297 windows = g_list_remove(windows, win);
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
298
11146
1c5398ccbeb0 [gaim-migrate @ 13217]
Piotr Zielinski <zielaj>
parents: 11137
diff changeset
299 GAIM_DBUS_UNREGISTER_POINTER(win);
4638
b58c08b7cbe4 [gaim-migrate @ 4946]
Christian Hammond <chipx86@chipx86.com>
parents: 4622
diff changeset
300 g_free(win);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
301 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
302 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
303
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
304 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
305 gaim_conv_window_show(GaimConvWindow *win)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
306 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
307 GaimConvWindowUiOps *ops;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
308
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
309 g_return_if_fail(win != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
310
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
311 ops = gaim_conv_window_get_ui_ops(win);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
312
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
313 if (ops == NULL || ops->show == NULL)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
314 return;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
315
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
316 ops->show(win);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
317 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
318
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
319 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
320 gaim_conv_window_hide(GaimConvWindow *win)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
321 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
322 GaimConvWindowUiOps *ops;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
323
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
324 g_return_if_fail(win != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
325
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
326 ops = gaim_conv_window_get_ui_ops(win);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
327
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
328 if (ops == NULL || ops->hide == NULL)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
329 return;
3790
12b29552f1d7 [gaim-migrate @ 3930]
Rob Flynn <gaim@robflynn.com>
parents: 3789
diff changeset
330
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
331 ops->hide(win);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
332 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
333
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
334 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
335 gaim_conv_window_raise(GaimConvWindow *win)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
336 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
337 GaimConvWindowUiOps *ops;
3790
12b29552f1d7 [gaim-migrate @ 3930]
Rob Flynn <gaim@robflynn.com>
parents: 3789
diff changeset
338
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
339 g_return_if_fail(win != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
340
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
341 ops = gaim_conv_window_get_ui_ops(win);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
342
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
343 if (ops == NULL || ops->raise == NULL)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
344 return;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
345
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
346 ops->raise(win);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
347 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
348
9260
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
349 gboolean
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
350 gaim_conv_window_has_focus(GaimConvWindow *win)
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
351 {
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
352 gboolean ret = FALSE;
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
353 GaimConvWindowUiOps *ops;
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
354
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
355 g_return_val_if_fail(win != NULL, FALSE);
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
356
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
357 ops = gaim_conv_window_get_ui_ops(win);
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
358
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
359 if (ops != NULL && ops->has_focus != NULL)
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
360 ret = ops->has_focus(win);
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
361
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
362 return ret;
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
363 }
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
364
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
365 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
366 gaim_conv_window_set_ui_ops(GaimConvWindow *win, GaimConvWindowUiOps *ops)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
367 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
368 GaimConversationUiOps *conv_ops = NULL;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
369 GList *l;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
370
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
371 g_return_if_fail(win != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
372
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
373 if (win->ui_ops == ops)
3790
12b29552f1d7 [gaim-migrate @ 3930]
Rob Flynn <gaim@robflynn.com>
parents: 3789
diff changeset
374 return;
12b29552f1d7 [gaim-migrate @ 3930]
Rob Flynn <gaim@robflynn.com>
parents: 3789
diff changeset
375
5139
d0182ae31ab8 [gaim-migrate @ 5503]
Christian Hammond <chipx86@chipx86.com>
parents: 5136
diff changeset
376 if (ops != NULL && ops->get_conversation_ui_ops != NULL)
d0182ae31ab8 [gaim-migrate @ 5503]
Christian Hammond <chipx86@chipx86.com>
parents: 5136
diff changeset
377 conv_ops = ops->get_conversation_ui_ops();
d0182ae31ab8 [gaim-migrate @ 5503]
Christian Hammond <chipx86@chipx86.com>
parents: 5136
diff changeset
378
d0182ae31ab8 [gaim-migrate @ 5503]
Christian Hammond <chipx86@chipx86.com>
parents: 5136
diff changeset
379 if (win->ui_ops != NULL && win->ui_ops->destroy_window != NULL)
d0182ae31ab8 [gaim-migrate @ 5503]
Christian Hammond <chipx86@chipx86.com>
parents: 5136
diff changeset
380 win->ui_ops->destroy_window(win);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
381
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
382 win->ui_ops = ops;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
383
5139
d0182ae31ab8 [gaim-migrate @ 5503]
Christian Hammond <chipx86@chipx86.com>
parents: 5136
diff changeset
384 if (win->ui_ops != NULL && win->ui_ops->new_window != NULL)
d0182ae31ab8 [gaim-migrate @ 5503]
Christian Hammond <chipx86@chipx86.com>
parents: 5136
diff changeset
385 win->ui_ops->new_window(win);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
386
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
387 for (l = gaim_conv_window_get_conversations(win);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
388 l != NULL;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
389 l = l->next) {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
390
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
391 GaimConversation *conv = (GaimConversation *)l;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
392
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
393 gaim_conversation_set_ui_ops(conv, conv_ops);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
394
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
395 if (win->ui_ops != NULL && win->ui_ops->add_conversation != NULL)
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
396 win->ui_ops->add_conversation(win, conv);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
397 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
398 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
399
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
400 GaimConvWindowUiOps *
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
401 gaim_conv_window_get_ui_ops(const GaimConvWindow *win)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
402 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
403 g_return_val_if_fail(win != NULL, NULL);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
404
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
405 return win->ui_ops;
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
406 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
407
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
408 int
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
409 gaim_conv_window_add_conversation(GaimConvWindow *win, GaimConversation *conv)
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
410 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
411 GaimConvWindowUiOps *ops;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
412
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
413 g_return_val_if_fail(win != NULL, -1);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
414 g_return_val_if_fail(conv != NULL, -1);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
415
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
416 if (gaim_conversation_get_window(conv) != NULL) {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
417 gaim_conv_window_remove_conversation(
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
418 gaim_conversation_get_window(conv),
10824
8d52201620d0 [gaim-migrate @ 12488]
Tim Ringenbach <marv@pidgin.im>
parents: 10805
diff changeset
419 conv);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
420 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
421
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
422 ops = gaim_conv_window_get_ui_ops(win);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
423
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
424 win->conversations = g_list_append(win->conversations, conv);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
425 win->conversation_count++;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
426
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
427 if (ops != NULL) {
4369
7e1fb422e5fd [gaim-migrate @ 4635]
Christian Hammond <chipx86@chipx86.com>
parents: 4363
diff changeset
428 conv->window = win;
7e1fb422e5fd [gaim-migrate @ 4635]
Christian Hammond <chipx86@chipx86.com>
parents: 4363
diff changeset
429
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
430 if (ops->get_conversation_ui_ops != NULL)
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
431 gaim_conversation_set_ui_ops(conv, ops->get_conversation_ui_ops());
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
432
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
433 if (ops->add_conversation != NULL)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
434 ops->add_conversation(win, conv);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
435 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
436
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
437 return win->conversation_count - 1;
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
438 }
611
0f7e5ff95f71 [gaim-migrate @ 621]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 610
diff changeset
439
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
440 GaimConversation *
10824
8d52201620d0 [gaim-migrate @ 12488]
Tim Ringenbach <marv@pidgin.im>
parents: 10805
diff changeset
441 gaim_conv_window_remove_conversation(GaimConvWindow *win, GaimConversation *conv)
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
442 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
443 GaimConvWindowUiOps *ops;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
444 GList *node;
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
445
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
446 g_return_val_if_fail(win != NULL, NULL);
10824
8d52201620d0 [gaim-migrate @ 12488]
Tim Ringenbach <marv@pidgin.im>
parents: 10805
diff changeset
447 g_return_val_if_fail(conv != NULL, NULL);
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
448
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
449 ops = gaim_conv_window_get_ui_ops(win);
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
450
10824
8d52201620d0 [gaim-migrate @ 12488]
Tim Ringenbach <marv@pidgin.im>
parents: 10805
diff changeset
451 node = g_list_find(gaim_conv_window_get_conversations(win), conv);
8d52201620d0 [gaim-migrate @ 12488]
Tim Ringenbach <marv@pidgin.im>
parents: 10805
diff changeset
452
8d52201620d0 [gaim-migrate @ 12488]
Tim Ringenbach <marv@pidgin.im>
parents: 10805
diff changeset
453 if (!node)
8d52201620d0 [gaim-migrate @ 12488]
Tim Ringenbach <marv@pidgin.im>
parents: 10805
diff changeset
454 return NULL;
8d52201620d0 [gaim-migrate @ 12488]
Tim Ringenbach <marv@pidgin.im>
parents: 10805
diff changeset
455
4360
c435a29370b8 [gaim-migrate @ 4626]
Christian Hammond <chipx86@chipx86.com>
parents: 4359
diff changeset
456 if (ops != NULL && ops->remove_conversation != NULL)
c435a29370b8 [gaim-migrate @ 4626]
Christian Hammond <chipx86@chipx86.com>
parents: 4359
diff changeset
457 ops->remove_conversation(win, conv);
c435a29370b8 [gaim-migrate @ 4626]
Christian Hammond <chipx86@chipx86.com>
parents: 4359
diff changeset
458
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
459 win->conversations = g_list_remove_link(win->conversations, node);
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
460
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
461 g_list_free_1(node);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
462
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
463 win->conversation_count--;
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
464
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
465 conv->window = NULL;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
466
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
467 if (gaim_conv_window_get_conversation_count(win) == 0)
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
468 gaim_conv_window_destroy(win);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
469
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
470 return conv;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
471 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
472
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
473 size_t
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
474 gaim_conv_window_get_conversation_count(const GaimConvWindow *win)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
475 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
476 g_return_val_if_fail(win != NULL, 0);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
477
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
478 return win->conversation_count;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
479 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
480
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
481 void
10827
53e7884c549a [gaim-migrate @ 12492]
Tim Ringenbach <marv@pidgin.im>
parents: 10824
diff changeset
482 gaim_conv_window_switch_conversation(GaimConvWindow *win, GaimConversation *conv)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
483 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
484 GaimConvWindowUiOps *ops;
10827
53e7884c549a [gaim-migrate @ 12492]
Tim Ringenbach <marv@pidgin.im>
parents: 10824
diff changeset
485 GaimConversation *old_conv;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
486
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
487 g_return_if_fail(win != NULL);
10827
53e7884c549a [gaim-migrate @ 12492]
Tim Ringenbach <marv@pidgin.im>
parents: 10824
diff changeset
488 g_return_if_fail(conv != NULL);
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
489
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
490 old_conv = gaim_conv_window_get_active_conversation(win);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
491
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
492 gaim_signal_emit(gaim_conversations_get_handle(),
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
493 "conversation-switching", old_conv, conv);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
494
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
495 ops = gaim_conv_window_get_ui_ops(win);
3790
12b29552f1d7 [gaim-migrate @ 3930]
Rob Flynn <gaim@robflynn.com>
parents: 3789
diff changeset
496
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
497 if (ops != NULL && ops->switch_conversation != NULL)
10827
53e7884c549a [gaim-migrate @ 12492]
Tim Ringenbach <marv@pidgin.im>
parents: 10824
diff changeset
498 ops->switch_conversation(win, conv);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
499
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
500 gaim_signal_emit(gaim_conversations_get_handle(),
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
501 "conversation-switched", old_conv, conv);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
502 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
503
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
504 GaimConversation *
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
505 gaim_conv_window_get_active_conversation(const GaimConvWindow *win)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
506 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
507 GaimConvWindowUiOps *ops;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
508
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
509 g_return_val_if_fail(win != NULL, NULL);
206
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
510
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
511 if (gaim_conv_window_get_conversation_count(win) == 0)
5680
71cc0d5376c2 [gaim-migrate @ 6098]
Christian Hammond <chipx86@chipx86.com>
parents: 5677
diff changeset
512 return NULL;
71cc0d5376c2 [gaim-migrate @ 6098]
Christian Hammond <chipx86@chipx86.com>
parents: 5677
diff changeset
513
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
514 ops = gaim_conv_window_get_ui_ops(win);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
515
10827
53e7884c549a [gaim-migrate @ 12492]
Tim Ringenbach <marv@pidgin.im>
parents: 10824
diff changeset
516 if (ops != NULL && ops->get_active_conversation != NULL)
53e7884c549a [gaim-migrate @ 12492]
Tim Ringenbach <marv@pidgin.im>
parents: 10824
diff changeset
517 return ops->get_active_conversation(win);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
518
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
519 return NULL;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
520 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
521
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
522 GList *
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
523 gaim_conv_window_get_conversations(const GaimConvWindow *win)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
524 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
525 g_return_val_if_fail(win != NULL, NULL);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
526
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
527 return win->conversations;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
528 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
529
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
530 GList *
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
531 gaim_get_windows(void)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
532 {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
533 return windows;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
534 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
535
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
536 GaimConvWindow *
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
537 gaim_get_first_window_with_type(GaimConversationType type)
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
538 {
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
539 GList *wins, *convs;
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
540 GaimConvWindow *win;
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
541 GaimConversation *conv;
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
542
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
543 if (type == GAIM_CONV_TYPE_UNKNOWN)
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
544 return NULL;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
545
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
546 for (wins = gaim_get_windows(); wins != NULL; wins = wins->next) {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
547 win = (GaimConvWindow *)wins->data;
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
548
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
549 for (convs = gaim_conv_window_get_conversations(win);
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
550 convs != NULL;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
551 convs = convs->next) {
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
552
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
553 conv = (GaimConversation *)convs->data;
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
554
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
555 if (gaim_conversation_get_type(conv) == type)
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
556 return win;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
557 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
558 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
559
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
560 return NULL;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
561 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
562
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
563 GaimConvWindow *
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
564 gaim_get_last_window_with_type(GaimConversationType type)
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
565 {
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
566 GList *wins, *convs;
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
567 GaimConvWindow *win;
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
568 GaimConversation *conv;
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
569
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
570 if (type == GAIM_CONV_TYPE_UNKNOWN)
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
571 return NULL;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
572
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
573 for (wins = g_list_last(gaim_get_windows());
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
574 wins != NULL;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
575 wins = wins->prev) {
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
576
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
577 win = (GaimConvWindow *)wins->data;
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
578
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
579 for (convs = gaim_conv_window_get_conversations(win);
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
580 convs != NULL;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
581 convs = convs->next) {
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
582
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
583 conv = (GaimConversation *)convs->data;
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
584
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
585 if (gaim_conversation_get_type(conv) == type)
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
586 return win;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
587 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
588 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
589
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
590 return NULL;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
591 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
592
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
593 /**************************************************************************
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
594 * Conversation API
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
595 **************************************************************************/
8256
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
596 static void
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
597 gaim_conversation_chat_cleanup_for_rejoin(GaimConversation *conv)
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
598 {
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
599 const char *disp;
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
600 GaimAccount *account;
8373
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
601 GaimConnection *gc;
8256
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
602
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
603 account = gaim_conversation_get_account(conv);
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
604
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
605 g_list_foreach(conv->logs, (GFunc)gaim_log_free, NULL);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
606 g_list_free(conv->logs);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
607 conv->logs = g_list_append(NULL, gaim_log_new(GAIM_LOG_CHAT, gaim_conversation_get_name(conv),
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
608 account, conv, time(NULL)));
8373
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
609
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
610 gc = gaim_account_get_connection(account);
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
611
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
612 if ((disp = gaim_connection_get_display_name(gc)) != NULL)
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
613 gaim_conv_chat_set_nick(GAIM_CONV_CHAT(conv), disp);
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
614 else
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
615 {
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
616 gaim_conv_chat_set_nick(GAIM_CONV_CHAT(conv),
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
617 gaim_account_get_username(account));
8256
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
618 }
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
619
8373
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
620 gaim_conv_chat_clear_users(GAIM_CONV_CHAT(conv));
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
621 gaim_conv_chat_set_topic(GAIM_CONV_CHAT(conv), NULL, NULL);
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
622 GAIM_CONV_CHAT(conv)->left = FALSE;
8256
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
623
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
624 gaim_conversation_update(conv, GAIM_CONV_UPDATE_CHATLEFT);
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
625 }
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
626
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
627 GaimConversation *
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5545
diff changeset
628 gaim_conversation_new(GaimConversationType type, GaimAccount *account,
4476
62c1e5e656d0 [gaim-migrate @ 4751]
Christian Hammond <chipx86@chipx86.com>
parents: 4471
diff changeset
629 const char *name)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
630 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
631 GaimConversation *conv;
10665
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
632 GaimConnection *gc;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
633
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
634 g_return_val_if_fail(type != GAIM_CONV_TYPE_UNKNOWN, NULL);
7088
7fd2fd7c6980 [gaim-migrate @ 7653]
Christian Hammond <chipx86@chipx86.com>
parents: 7035
diff changeset
635 g_return_val_if_fail(account != NULL, NULL);
7fd2fd7c6980 [gaim-migrate @ 7653]
Christian Hammond <chipx86@chipx86.com>
parents: 7035
diff changeset
636 g_return_val_if_fail(name != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
637
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
638 /* Check if this conversation already exists. */
10246
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
639 if ((conv = gaim_find_conversation_with_account(type, name, account)) != NULL)
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
640 {
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
641 if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_CHAT ||
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
642 gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv)))
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
643 {
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
644 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT)
8256
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
645 gaim_conversation_chat_cleanup_for_rejoin(conv);
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
646
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
647 return conv;
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
648 }
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
649 }
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
650
10665
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
651 gc = gaim_account_get_connection(account);
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
652 g_return_val_if_fail(gc != NULL, NULL);
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
653
6402
cc35d07a0dcc [gaim-migrate @ 6907]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
654 conv = g_new0(GaimConversation, 1);
11146
1c5398ccbeb0 [gaim-migrate @ 13217]
Piotr Zielinski <zielaj>
parents: 11137
diff changeset
655 GAIM_DBUS_REGISTER_POINTER(conv, GaimConversation);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
656
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
657 conv->type = type;
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4481
diff changeset
658 conv->account = account;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
659 conv->name = g_strdup(name);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
660 conv->title = g_strdup(name);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
661 conv->send_history = g_list_append(NULL, NULL);
5139
d0182ae31ab8 [gaim-migrate @ 5503]
Christian Hammond <chipx86@chipx86.com>
parents: 5136
diff changeset
662 conv->data = g_hash_table_new_full(g_str_hash, g_str_equal,
4876
9567b13d0e98 [gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents: 4818
diff changeset
663 g_free, NULL);
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
664 conv->logs = g_list_append(NULL, gaim_log_new(type == GAIM_CONV_TYPE_CHAT ? GAIM_LOG_CHAT :
8635
4aee5a47937d [gaim-migrate @ 9387]
Nathan Walp <nwalp@pidgin.im>
parents: 8442
diff changeset
665 GAIM_LOG_IM, conv->name, account,
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
666 conv, time(NULL)));
10665
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
667 /* copy features from the connection. */
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
668 conv->features = gc->flags;
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
669
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
670
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
671 if (type == GAIM_CONV_TYPE_IM)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
672 {
9324
af707cc1e229 [gaim-migrate @ 10132]
Tim Ringenbach <marv@pidgin.im>
parents: 9261
diff changeset
673 GaimBuddyIcon *icon;
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
674 conv->u.im = g_new0(GaimConvIm, 1);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
675 conv->u.im->conv = conv;
11146
1c5398ccbeb0 [gaim-migrate @ 13217]
Piotr Zielinski <zielaj>
parents: 11137
diff changeset
676 GAIM_DBUS_REGISTER_POINTER(conv->u.im, GaimConvIm);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
677
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
678 ims = g_list_append(ims, conv);
9324
af707cc1e229 [gaim-migrate @ 10132]
Tim Ringenbach <marv@pidgin.im>
parents: 9261
diff changeset
679 if ((icon = gaim_buddy_icons_find(account, name)))
af707cc1e229 [gaim-migrate @ 10132]
Tim Ringenbach <marv@pidgin.im>
parents: 9261
diff changeset
680 gaim_conv_im_set_icon(conv->u.im, icon);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
681
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
682 gaim_conversation_set_logging(conv,
7562
b859cfb5f31a [gaim-migrate @ 8176]
Christian Hammond <chipx86@chipx86.com>
parents: 7561
diff changeset
683 gaim_prefs_get_bool("/core/logging/log_ims"));
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
684 }
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
685 else if (type == GAIM_CONV_TYPE_CHAT)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
686 {
8158
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
687 const char *disp;
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
688
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
689 conv->u.chat = g_new0(GaimConvChat, 1);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
690 conv->u.chat->conv = conv;
11146
1c5398ccbeb0 [gaim-migrate @ 13217]
Piotr Zielinski <zielaj>
parents: 11137
diff changeset
691 GAIM_DBUS_REGISTER_POINTER(conv->u.chat, GaimConvChat);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
692
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
693 chats = g_list_append(chats, conv);
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
694
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
695 if ((disp = gaim_connection_get_display_name(account->gc)))
8158
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
696 gaim_conv_chat_set_nick(conv->u.chat, disp);
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
697 else
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
698 gaim_conv_chat_set_nick(conv->u.chat,
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
699 gaim_account_get_username(account));
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
700
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5539
diff changeset
701 gaim_conversation_set_logging(conv,
7562
b859cfb5f31a [gaim-migrate @ 8176]
Christian Hammond <chipx86@chipx86.com>
parents: 7561
diff changeset
702 gaim_prefs_get_bool("/core/logging/log_chats"));
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
703 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
704
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
705 conversations = g_list_append(conversations, conv);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
706
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
707 /* Auto-set the title. */
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
708 gaim_conversation_autoset_title(conv);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
709
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
710 /*
9155
e0c50af60837 [gaim-migrate @ 9939]
Mark Doliner <mark@kingant.net>
parents: 9150
diff changeset
711 * Place the conversation somewhere. If there are no conversation
e0c50af60837 [gaim-migrate @ 9939]
Mark Doliner <mark@kingant.net>
parents: 9150
diff changeset
712 * windows open, or if tabbed conversations are not enabled, then
e0c50af60837 [gaim-migrate @ 9939]
Mark Doliner <mark@kingant.net>
parents: 9150
diff changeset
713 * place the conversation in a new window by itself. Otherwise use
e0c50af60837 [gaim-migrate @ 9939]
Mark Doliner <mark@kingant.net>
parents: 9150
diff changeset
714 * the chosen conversation placement function.
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
715 */
9155
e0c50af60837 [gaim-migrate @ 9939]
Mark Doliner <mark@kingant.net>
parents: 9150
diff changeset
716 if ((windows == NULL) || (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")))
8373
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
717 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
718 GaimConvWindow *win;
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
719
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
720 win = gaim_conv_window_new();
9607
293de2970493 [gaim-migrate @ 10450]
Luke Schierer <lschiere@pidgin.im>
parents: 9606
diff changeset
721
9614
c35c6b56a35f [gaim-migrate @ 10458]
Luke Schierer <lschiere@pidgin.im>
parents: 9613
diff changeset
722 gaim_conv_window_add_conversation(win, conv);
c35c6b56a35f [gaim-migrate @ 10458]
Luke Schierer <lschiere@pidgin.im>
parents: 9613
diff changeset
723
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
724 /* Ensure the window is visible. */
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
725 gaim_conv_window_show(win);
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
726 }
8373
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
727 else
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
728 {
7602
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
729 if (place_conv == NULL)
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
730 {
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
731 ensure_default_funcs();
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
732
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
733 place_conv = conv_placement_last_created_win;
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
734 }
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
735
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
736 if (place_conv == NULL)
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
737 gaim_debug(GAIM_DEBUG_ERROR, "conversation",
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
738 "This is about to suck.\n");
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
739
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
740 place_conv(conv);
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
741 }
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
742
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
743 gaim_signal_emit(gaim_conversations_get_handle(),
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
744 "conversation-created", conv);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
745
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
746 return conv;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
747 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
748
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
749 void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
750 gaim_conversation_destroy(GaimConversation *conv)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
751 {
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5139
diff changeset
752 GaimPluginProtocolInfo *prpl_info = NULL;
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
753 GaimConvWindow *win;
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
754 GaimConversationUiOps *ops;
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5545
diff changeset
755 GaimConnection *gc;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
756 const char *name;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
757 GList *node;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
758
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
759 g_return_if_fail(conv != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
760
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
761 win = gaim_conversation_get_window(conv);
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
762 ops = gaim_conversation_get_ui_ops(conv);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
763 gc = gaim_conversation_get_gc(conv);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
764 name = gaim_conversation_get_name(conv);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
765
8373
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
766 if (gc != NULL)
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
767 {
5262
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
768 /* Still connected */
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
769 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl);
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
770
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
771 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM)
8373
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
772 {
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5539
diff changeset
773 if (gaim_prefs_get_bool("/core/conversations/im/send_typing"))
6403
01963a303f43 [gaim-migrate @ 6908]
Christian Hammond <chipx86@chipx86.com>
parents: 6402
diff changeset
774 serv_send_typing(gc, name, GAIM_NOT_TYPING);
5262
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
775
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
776 if (gc && prpl_info->convo_closed != NULL)
6403
01963a303f43 [gaim-migrate @ 6908]
Christian Hammond <chipx86@chipx86.com>
parents: 6402
diff changeset
777 prpl_info->convo_closed(gc, name);
5262
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
778 }
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
779 else if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT)
8373
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
780 {
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
781 int chat_id = gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv));
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
782 #if 0
5262
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
783 /*
6030
54c37db13279 [gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents: 6020
diff changeset
784 * This is unfortunately necessary, because calling
54c37db13279 [gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents: 6020
diff changeset
785 * serv_chat_leave() calls this gaim_conversation_destroy(),
54c37db13279 [gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents: 6020
diff changeset
786 * which leads to two calls here.. We can't just return after
54c37db13279 [gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents: 6020
diff changeset
787 * this, because then it'll return on the next pass. So, since
54c37db13279 [gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents: 6020
diff changeset
788 * serv_got_chat_left(), which is eventually called from the
54c37db13279 [gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents: 6020
diff changeset
789 * prpl that serv_chat_leave() calls, removes this conversation
54c37db13279 [gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents: 6020
diff changeset
790 * from the gc's buddy_chats list, we're going to check to see
54c37db13279 [gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents: 6020
diff changeset
791 * if this exists in the list. If so, we want to return after
54c37db13279 [gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents: 6020
diff changeset
792 * calling this, because it'll be called again. If not, fall
54c37db13279 [gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents: 6020
diff changeset
793 * through, because it'll have already been removed, and we'd
5262
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
794 * be on the 2nd pass.
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
795 *
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
796 * Long paragraph. <-- Short sentence.
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
797 *
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
798 * -- ChipX86
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
799 */
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
800
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
801 if (gc && g_slist_find(gc->buddy_chats, conv) != NULL) {
8373
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
802 serv_chat_leave(gc, chat_id);
5262
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
803
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
804 return;
799f9585988a [gaim-migrate @ 5634]
Luke Schierer <lschiere@pidgin.im>
parents: 5213
diff changeset
805 }
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
806 #endif
8373
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
807 /*
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
808 * Instead of all of that, lets just close the window when
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
809 * the user tells us to, and let the prpl deal with the
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
810 * internals on it's own time. Don't do this if the prpl already
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
811 * knows it left the chat.
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
812 */
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
813 if (!gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv)))
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
814 serv_chat_leave(gc, chat_id);
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
815
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
816 /*
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
817 * If they didn't call serv_got_chat_left by now, it's too late.
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
818 * So we better do it for them before we destroy the thing.
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
819 */
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
820 if (!gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv)))
7a58f6f9fc3e [gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents: 8348
diff changeset
821 serv_got_chat_left(gc, chat_id);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
822 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
823 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
824
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
825 gaim_signal_emit(gaim_conversations_get_handle(),
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
826 "deleting-conversation", conv);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
827
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
828 if (conv->name != NULL) g_free(conv->name);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
829 if (conv->title != NULL) g_free(conv->title);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
830
10116
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
831 conv->name = NULL;
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
832 conv->title = NULL;
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
833
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
834 for (node = g_list_first(conv->send_history);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
835 node != NULL;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
836 node = g_list_next(node)) {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
837
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
838 if (node->data != NULL)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
839 g_free(node->data);
10116
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
840 node->data = NULL;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
841 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
842
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
843 g_list_free(g_list_first(conv->send_history));
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
844
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
845 conversations = g_list_remove(conversations, conv);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
846
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
847 if (conv->type == GAIM_CONV_TYPE_IM) {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
848 gaim_conv_im_stop_typing_timeout(conv->u.im);
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
849 gaim_conv_im_stop_type_again_timeout(conv->u.im);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
850
6846
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
851 if (conv->u.im->icon != NULL)
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
852 gaim_buddy_icon_unref(conv->u.im->icon);
10116
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
853 conv->u.im->icon = NULL;
6846
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
854
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
855 GAIM_DBUS_UNREGISTER_POINTER(conv->u.im);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
856 g_free(conv->u.im);
10116
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
857 conv->u.im = NULL;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
858
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
859 ims = g_list_remove(ims, conv);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
860 }
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
861 else if (conv->type == GAIM_CONV_TYPE_CHAT) {
4572
06084165a966 [gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents: 4522
diff changeset
862
06084165a966 [gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents: 4522
diff changeset
863 for (node = conv->u.chat->in_room; node != NULL; node = node->next) {
06084165a966 [gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents: 4522
diff changeset
864 if (node->data != NULL)
10504
1a97d5e88d12 [gaim-migrate @ 11796]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10385
diff changeset
865 gaim_conv_chat_cb_destroy((GaimConvChatBuddy *)node->data);
10116
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
866 node->data = NULL;
4572
06084165a966 [gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents: 4522
diff changeset
867 }
06084165a966 [gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents: 4522
diff changeset
868
06084165a966 [gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents: 4522
diff changeset
869 for (node = conv->u.chat->ignored; node != NULL; node = node->next) {
06084165a966 [gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents: 4522
diff changeset
870 if (node->data != NULL)
06084165a966 [gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents: 4522
diff changeset
871 g_free(node->data);
10116
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
872 node->data = NULL;
4572
06084165a966 [gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents: 4522
diff changeset
873 }
06084165a966 [gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents: 4522
diff changeset
874
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
875 g_list_free(conv->u.chat->in_room);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
876 g_list_free(conv->u.chat->ignored);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
877
10116
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
878 conv->u.chat->in_room = NULL;
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
879 conv->u.chat->ignored = NULL;
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
880
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
881 if (conv->u.chat->who != NULL)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
882 g_free(conv->u.chat->who);
10116
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
883 conv->u.chat->who = NULL;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
884
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
885 if (conv->u.chat->topic != NULL)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
886 g_free(conv->u.chat->topic);
10116
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
887 conv->u.chat->topic = NULL;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
888
10504
1a97d5e88d12 [gaim-migrate @ 11796]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10385
diff changeset
889 if(conv->u.chat->nick)
1a97d5e88d12 [gaim-migrate @ 11796]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10385
diff changeset
890 g_free(conv->u.chat->nick);
1a97d5e88d12 [gaim-migrate @ 11796]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10385
diff changeset
891
11146
1c5398ccbeb0 [gaim-migrate @ 13217]
Piotr Zielinski <zielaj>
parents: 11137
diff changeset
892 GAIM_DBUS_UNREGISTER_POINTER(conv->u.chat);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
893 g_free(conv->u.chat);
10116
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
894 conv->u.chat = NULL;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
895
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
896 chats = g_list_remove(chats, conv);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
897 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
898
4877
249382064693 [gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents: 4876
diff changeset
899 g_hash_table_destroy(conv->data);
10116
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
900 conv->data = NULL;
4876
9567b13d0e98 [gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents: 4818
diff changeset
901
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
902 if (win != NULL) {
10824
8d52201620d0 [gaim-migrate @ 12488]
Tim Ringenbach <marv@pidgin.im>
parents: 10805
diff changeset
903 gaim_conv_window_remove_conversation(win, conv);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
904 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
905
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
906 if (ops != NULL && ops->destroy_conversation != NULL)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
907 ops->destroy_conversation(conv);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
908
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
909 g_list_foreach(conv->logs, (GFunc)gaim_log_free, NULL);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
910 g_list_free(conv->logs);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
911
11146
1c5398ccbeb0 [gaim-migrate @ 13217]
Piotr Zielinski <zielaj>
parents: 11137
diff changeset
912 GAIM_DBUS_UNREGISTER_POINTER(conv);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
913 g_free(conv);
10116
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
914 conv = NULL;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
915 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
916
10665
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
917
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
918 void
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
919 gaim_conversation_set_features(GaimConversation *conv, GaimConnectionFlags features)
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
920 {
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
921 GaimConversationUiOps *ops;
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
922
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
923 g_return_if_fail(conv != NULL);
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
924
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
925 conv->features = features;
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
926
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
927 ops = conv->ui_ops;
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
928 if(ops && ops->updated)
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
929 ops->updated(conv, GAIM_CONV_UPDATE_FEATURES);
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
930 }
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
931
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
932
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
933 GaimConnectionFlags
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
934 gaim_conversation_get_features(GaimConversation *conv)
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
935 {
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
936 g_return_val_if_fail(conv != NULL, 0);
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
937 return conv->features;
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
938 }
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
939
4829abdc5c35 [gaim-migrate @ 12205]
Sean Egan <seanegan@gmail.com>
parents: 10526
diff changeset
940
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
941 GaimConversationType
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
942 gaim_conversation_get_type(const GaimConversation *conv)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
943 {
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
944 g_return_val_if_fail(conv != NULL, GAIM_CONV_TYPE_UNKNOWN);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
945
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
946 return conv->type;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
947 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
948
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
949 void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
950 gaim_conversation_set_ui_ops(GaimConversation *conv,
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
951 GaimConversationUiOps *ops)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
952 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
953 g_return_if_fail(conv != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
954
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
955 if (conv->ui_ops == ops)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
956 return;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
957
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
958 if (conv->ui_ops != NULL && conv->ui_ops->destroy_conversation != NULL)
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
959 conv->ui_ops->destroy_conversation(conv);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
960
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
961 conv->ui_data = NULL;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
962
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
963 conv->ui_ops = ops;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
964 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
965
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
966 GaimConversationUiOps *
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
967 gaim_conversation_get_ui_ops(const GaimConversation *conv)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
968 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
969 g_return_val_if_fail(conv != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
970
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
971 return conv->ui_ops;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
972 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
973
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
974 void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
975 gaim_conversation_set_account(GaimConversation *conv, GaimAccount *account)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
976 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
977 g_return_if_fail(conv != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
978
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
979 if (account == gaim_conversation_get_account(conv))
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
980 return;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
981
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4481
diff changeset
982 conv->account = account;
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4481
diff changeset
983
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4481
diff changeset
984 gaim_conversation_update(conv, GAIM_CONV_UPDATE_ACCOUNT);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
985 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
986
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5545
diff changeset
987 GaimAccount *
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
988 gaim_conversation_get_account(const GaimConversation *conv)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
989 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
990 g_return_val_if_fail(conv != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
991
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4481
diff changeset
992 return conv->account;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
993 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
994
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5545
diff changeset
995 GaimConnection *
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
996 gaim_conversation_get_gc(const GaimConversation *conv)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
997 {
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5545
diff changeset
998 GaimAccount *account;
4425
be8f9ca74ddf [gaim-migrate @ 4700]
Christian Hammond <chipx86@chipx86.com>
parents: 4415
diff changeset
999
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1000 g_return_val_if_fail(conv != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1001
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4481
diff changeset
1002 account = gaim_conversation_get_account(conv);
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4481
diff changeset
1003
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4481
diff changeset
1004 if (account == NULL)
4425
be8f9ca74ddf [gaim-migrate @ 4700]
Christian Hammond <chipx86@chipx86.com>
parents: 4415
diff changeset
1005 return NULL;
be8f9ca74ddf [gaim-migrate @ 4700]
Christian Hammond <chipx86@chipx86.com>
parents: 4415
diff changeset
1006
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4481
diff changeset
1007 return account->gc;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1008 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1009
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1010 void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1011 gaim_conversation_set_title(GaimConversation *conv, const char *title)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1012 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1013 GaimConversationUiOps *ops;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1014
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1015 g_return_if_fail(conv != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1016 g_return_if_fail(title != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1017
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1018 if (conv->title != NULL)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1019 g_free(conv->title);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1020
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1021 conv->title = g_strdup(title);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1022
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
1023 ops = gaim_conversation_get_ui_ops(conv);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1024
8155
77d1252b3803 [gaim-migrate @ 8867]
Christian Hammond <chipx86@chipx86.com>
parents: 8078
diff changeset
1025 if (ops != NULL && ops->updated != NULL)
77d1252b3803 [gaim-migrate @ 8867]
Christian Hammond <chipx86@chipx86.com>
parents: 8078
diff changeset
1026 ops->updated(conv, GAIM_CONV_UPDATE_TITLE);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1027 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1028
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1029 const char *
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1030 gaim_conversation_get_title(const GaimConversation *conv)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1031 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1032 g_return_val_if_fail(conv != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1033
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1034 return conv->title;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1035 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1036
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1037 void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1038 gaim_conversation_autoset_title(GaimConversation *conv)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1039 {
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5545
diff changeset
1040 GaimAccount *account;
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6640
diff changeset
1041 GaimBuddy *b;
8015
5f86d21b6232 [gaim-migrate @ 8695]
Nathan Walp <nwalp@pidgin.im>
parents: 7947
diff changeset
1042 GaimChat *chat;
5f86d21b6232 [gaim-migrate @ 8695]
Nathan Walp <nwalp@pidgin.im>
parents: 7947
diff changeset
1043 const char *text = NULL, *name;
3799
3163a8825063 [gaim-migrate @ 3941]
Luke Schierer <lschiere@pidgin.im>
parents: 3790
diff changeset
1044
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1045 g_return_if_fail(conv != NULL);
2267
837aa71710c5 [gaim-migrate @ 2277]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2264
diff changeset
1046
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4481
diff changeset
1047 account = gaim_conversation_get_account(conv);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1048 name = gaim_conversation_get_name(conv);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1049
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
1050 if(gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) {
10364
db5e8c8b2abb [gaim-migrate @ 11582]
Sean Egan <seanegan@gmail.com>
parents: 10349
diff changeset
1051 if(account && ((b = gaim_find_buddy(account, name)) != NULL))
11264
74b003b1ba8d [gaim-migrate @ 13445]
Mark Doliner <mark@kingant.net>
parents: 11256
diff changeset
1052 text = gaim_buddy_get_alias(b);
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
1053 } else if(gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) {
10364
db5e8c8b2abb [gaim-migrate @ 11582]
Sean Egan <seanegan@gmail.com>
parents: 10349
diff changeset
1054 if(account && ((chat = gaim_blist_find_chat(account, name)) != NULL))
db5e8c8b2abb [gaim-migrate @ 11582]
Sean Egan <seanegan@gmail.com>
parents: 10349
diff changeset
1055 text = chat->alias;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1056 }
10364
db5e8c8b2abb [gaim-migrate @ 11582]
Sean Egan <seanegan@gmail.com>
parents: 10349
diff changeset
1057
8015
5f86d21b6232 [gaim-migrate @ 8695]
Nathan Walp <nwalp@pidgin.im>
parents: 7947
diff changeset
1058
10116
9f358a718f38 [gaim-migrate @ 11153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10104
diff changeset
1059 if(text == NULL)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1060 text = name;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1061
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1062 gaim_conversation_set_title(conv, text);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1063 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1064
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1065 void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1066 gaim_conversation_set_unseen(GaimConversation *conv, GaimUnseenState state)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1067 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1068 g_return_if_fail(conv != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1069
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1070 conv->unseen = state;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1071
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1072 gaim_conversation_update(conv, GAIM_CONV_UPDATE_UNSEEN);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1073 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1074
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1075 void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1076 gaim_conversation_foreach(void (*func)(GaimConversation *conv))
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1077 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1078 GaimConversation *conv;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1079 GList *l;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1080
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1081 g_return_if_fail(func != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1082
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1083 for (l = gaim_get_conversations(); l != NULL; l = l->next) {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1084 conv = (GaimConversation *)l->data;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1085
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1086 func(conv);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1087 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1088 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1089
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1090 GaimUnseenState
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1091 gaim_conversation_get_unseen(const GaimConversation *conv)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1092 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1093 g_return_val_if_fail(conv != NULL, 0);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1094
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1095 return conv->unseen;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1096 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1097
7256
c93493c59ac3 [gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents: 7125
diff changeset
1098 void
c93493c59ac3 [gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents: 7125
diff changeset
1099 gaim_conversation_set_name(GaimConversation *conv, const char *name)
c93493c59ac3 [gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents: 7125
diff changeset
1100 {
c93493c59ac3 [gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents: 7125
diff changeset
1101 g_return_if_fail(conv != NULL);
c93493c59ac3 [gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents: 7125
diff changeset
1102
c93493c59ac3 [gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents: 7125
diff changeset
1103 if (conv->name != NULL)
c93493c59ac3 [gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents: 7125
diff changeset
1104 g_free(conv->name);
c93493c59ac3 [gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents: 7125
diff changeset
1105
c93493c59ac3 [gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents: 7125
diff changeset
1106 conv->name = (name == NULL ? NULL : g_strdup(name));
7257
31abca48a631 [gaim-migrate @ 7834]
Christian Hammond <chipx86@chipx86.com>
parents: 7256
diff changeset
1107
31abca48a631 [gaim-migrate @ 7834]
Christian Hammond <chipx86@chipx86.com>
parents: 7256
diff changeset
1108 gaim_conversation_autoset_title(conv);
7256
c93493c59ac3 [gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents: 7125
diff changeset
1109 }
c93493c59ac3 [gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents: 7125
diff changeset
1110
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1111 const char *
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1112 gaim_conversation_get_name(const GaimConversation *conv)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1113 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1114 g_return_val_if_fail(conv != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1115
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1116 return conv->name;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1117 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1118
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1119 void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1120 gaim_conversation_set_logging(GaimConversation *conv, gboolean log)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1121 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1122 g_return_if_fail(conv != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1123
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1124 conv->logging = log;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1125
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1126 gaim_conversation_update(conv, GAIM_CONV_UPDATE_LOGGING);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1127 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1128
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1129 gboolean
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1130 gaim_conversation_is_logging(const GaimConversation *conv)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1131 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1132 g_return_val_if_fail(conv != NULL, FALSE);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1133
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1134 return conv->logging;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1135 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1136
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1137 GList *
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1138 gaim_conversation_get_send_history(const GaimConversation *conv)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1139 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1140 g_return_val_if_fail(conv != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1141
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1142 return conv->send_history;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1143 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1144
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1145 GaimConvWindow *
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1146 gaim_conversation_get_window(const GaimConversation *conv)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1147 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1148 g_return_val_if_fail(conv != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1149
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1150 return conv->window;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1151 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1152
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1153 GaimConvIm *
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1154 gaim_conversation_get_im_data(const GaimConversation *conv)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1155 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1156 g_return_val_if_fail(conv != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1157
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
1158 if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_IM)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1159 return NULL;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1160
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1161 return conv->u.im;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1162 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1163
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1164 GaimConvChat *
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1165 gaim_conversation_get_chat_data(const GaimConversation *conv)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1166 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1167 g_return_val_if_fail(conv != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1168
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
1169 if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_CHAT)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1170 return NULL;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1171
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1172 return conv->u.chat;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1173 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1174
4876
9567b13d0e98 [gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents: 4818
diff changeset
1175 void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1176 gaim_conversation_set_data(GaimConversation *conv, const char *key,
4877
249382064693 [gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents: 4876
diff changeset
1177 gpointer data)
4876
9567b13d0e98 [gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents: 4818
diff changeset
1178 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1179 g_return_if_fail(conv != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1180 g_return_if_fail(key != NULL);
4876
9567b13d0e98 [gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents: 4818
diff changeset
1181
4877
249382064693 [gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents: 4876
diff changeset
1182 g_hash_table_replace(conv->data, g_strdup(key), data);
4876
9567b13d0e98 [gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents: 4818
diff changeset
1183 }
9567b13d0e98 [gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents: 4818
diff changeset
1184
9567b13d0e98 [gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents: 4818
diff changeset
1185 gpointer
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1186 gaim_conversation_get_data(GaimConversation *conv, const char *key)
4876
9567b13d0e98 [gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents: 4818
diff changeset
1187 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1188 g_return_val_if_fail(conv != NULL, NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1189 g_return_val_if_fail(key != NULL, NULL);
4876
9567b13d0e98 [gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents: 4818
diff changeset
1190
4877
249382064693 [gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents: 4876
diff changeset
1191 return g_hash_table_lookup(conv->data, key);
4876
9567b13d0e98 [gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents: 4818
diff changeset
1192 }
9567b13d0e98 [gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents: 4818
diff changeset
1193
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1194 GList *
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1195 gaim_get_conversations(void)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1196 {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1197 return conversations;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1198 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1199
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1200 GList *
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1201 gaim_get_ims(void)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1202 {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1203 return ims;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1204 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1205
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1206 GList *
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1207 gaim_get_chats(void)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1208 {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1209 return chats;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1210 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1211
7261
1930e3d00ecd [gaim-migrate @ 7838]
Nathan Walp <nwalp@pidgin.im>
parents: 7257
diff changeset
1212
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1213 GaimConversation *
10246
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1214 gaim_find_conversation_with_account(GaimConversationType type,
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1215 const char *name,
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1216 const GaimAccount *account)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1217 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1218 GaimConversation *c = NULL;
10246
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1219 gchar *name1;
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1220 const gchar *name2;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1221 GList *cnv;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1222
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1223 g_return_val_if_fail(name != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1224
10246
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1225 name1 = g_strdup(gaim_normalize(account, name));
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1226
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1227 for (cnv = gaim_get_conversations(); cnv != NULL; cnv = cnv->next) {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1228 c = (GaimConversation *)cnv->data;
10246
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1229 name2 = gaim_normalize(account, gaim_conversation_get_name(c));
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1230
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
1231 if (((type == GAIM_CONV_TYPE_ANY) || (type == gaim_conversation_get_type(c))) &&
10246
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1232 (account == gaim_conversation_get_account(c)) &&
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1233 !gaim_utf8_strcasecmp(name1, name2)) {
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1234
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1235 break;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1236 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1237
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1238 c = NULL;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1239 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1240
10246
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1241 g_free(name1);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1242
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1243 return c;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1244 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1245
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1246 void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1247 gaim_conversation_write(GaimConversation *conv, const char *who,
6982
083d1e4a9c78 [gaim-migrate @ 7538]
Mark Doliner <mark@kingant.net>
parents: 6846
diff changeset
1248 const char *message, GaimMessageFlags flags,
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1249 time_t mtime)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1250 {
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5139
diff changeset
1251 GaimPluginProtocolInfo *prpl_info = NULL;
6496
e0c80bec996a [gaim-migrate @ 7011]
Christian Hammond <chipx86@chipx86.com>
parents: 6485
diff changeset
1252 GaimConnection *gc = NULL;
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5545
diff changeset
1253 GaimAccount *account;
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1254 GaimConversationUiOps *ops;
11468
c3cb62d33f53 [gaim-migrate @ 13708]
Richard Laager <rlaager@wiktel.com>
parents: 11454
diff changeset
1255 const char *alias;
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1256 GaimConvWindow *win;
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6640
diff changeset
1257 GaimBuddy *b;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1258 GaimUnseenState unseen;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1259 /* int logging_font_options = 0; */
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1260
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1261 g_return_if_fail(conv != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1262 g_return_if_fail(message != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1263
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
1264 ops = gaim_conversation_get_ui_ops(conv);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1265
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1266 if (ops == NULL || ops->write_conv == NULL)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1267 return;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1268
4608
5fcb44d771d2 [gaim-migrate @ 4896]
Nathan Walp <nwalp@pidgin.im>
parents: 4574
diff changeset
1269 account = gaim_conversation_get_account(conv);
6496
e0c80bec996a [gaim-migrate @ 7011]
Christian Hammond <chipx86@chipx86.com>
parents: 6485
diff changeset
1270
e0c80bec996a [gaim-migrate @ 7011]
Christian Hammond <chipx86@chipx86.com>
parents: 6485
diff changeset
1271 if (account != NULL)
e0c80bec996a [gaim-migrate @ 7011]
Christian Hammond <chipx86@chipx86.com>
parents: 6485
diff changeset
1272 gc = gaim_account_get_connection(account);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1273
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
1274 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT &&
6496
e0c80bec996a [gaim-migrate @ 7011]
Christian Hammond <chipx86@chipx86.com>
parents: 6485
diff changeset
1275 (gc == NULL || !g_slist_find(gc->buddy_chats, conv)))
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1276 return;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1277
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
1278 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM &&
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1279 !g_list_find(gaim_get_conversations(), conv))
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1280 return;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1281
11468
c3cb62d33f53 [gaim-migrate @ 13708]
Richard Laager <rlaager@wiktel.com>
parents: 11454
diff changeset
1282 if (who == NULL || *who == '\0')
c3cb62d33f53 [gaim-migrate @ 13708]
Richard Laager <rlaager@wiktel.com>
parents: 11454
diff changeset
1283 who = gaim_conversation_get_name(conv);
c3cb62d33f53 [gaim-migrate @ 13708]
Richard Laager <rlaager@wiktel.com>
parents: 11454
diff changeset
1284
c3cb62d33f53 [gaim-migrate @ 13708]
Richard Laager <rlaager@wiktel.com>
parents: 11454
diff changeset
1285 alias = who;
c3cb62d33f53 [gaim-migrate @ 13708]
Richard Laager <rlaager@wiktel.com>
parents: 11454
diff changeset
1286
9613
1b13160bf5a4 [gaim-migrate @ 10456]
Luke Schierer <lschiere@pidgin.im>
parents: 9607
diff changeset
1287 if (account != NULL) {
1b13160bf5a4 [gaim-migrate @ 10456]
Luke Schierer <lschiere@pidgin.im>
parents: 9607
diff changeset
1288 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gaim_find_prpl(gaim_account_get_protocol_id(account)));
5350
a6146cbae03b [gaim-migrate @ 5726]
Christian Hammond <chipx86@chipx86.com>
parents: 5262
diff changeset
1289
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
1290 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM ||
5350
a6146cbae03b [gaim-migrate @ 5726]
Christian Hammond <chipx86@chipx86.com>
parents: 5262
diff changeset
1291 !(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
a6146cbae03b [gaim-migrate @ 5726]
Christian Hammond <chipx86@chipx86.com>
parents: 5262
diff changeset
1292
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1293 if (flags & GAIM_MESSAGE_SEND) {
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1294 b = gaim_find_buddy(account,
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1295 gaim_account_get_username(account));
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1296
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1297 if (gaim_account_get_alias(account) != NULL)
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1298 alias = account->alias;
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1299 else if (b != NULL && strcmp(b->name, gaim_buddy_get_contact_alias(b)))
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1300 alias = gaim_buddy_get_contact_alias(b);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1301 else if (gaim_connection_get_display_name(gc) != NULL)
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1302 alias = gaim_connection_get_display_name(gc);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1303 else
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1304 alias = gaim_account_get_username(account);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1305 }
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1306 else
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1307 {
5350
a6146cbae03b [gaim-migrate @ 5726]
Christian Hammond <chipx86@chipx86.com>
parents: 5262
diff changeset
1308 b = gaim_find_buddy(account, who);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1309
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1310 if (b != NULL)
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1311 alias = gaim_buddy_get_contact_alias(b);
1772
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1312 }
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1313 }
474
7720d0f9da8e [gaim-migrate @ 484]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 473
diff changeset
1314 }
8256
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
1315
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1316 if (gaim_conversation_is_logging(conv)) {
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1317 GList *log = conv->logs;
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1318 while (log != NULL) {
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1319 gaim_log_write((GaimLog *)log->data, flags, alias, mtime, message);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1320 log = log->next;
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1321 }
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1322 }
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1323 ops->write_conv(conv, who, alias, message, flags, mtime);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
1324
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1325 win = gaim_conversation_get_window(conv);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1326
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1327 /* Tab highlighting */
8722
230fee6f1e3e [gaim-migrate @ 9477]
Sean Egan <seanegan@gmail.com>
parents: 8635
diff changeset
1328 if (!(flags & GAIM_MESSAGE_RECV) && !(flags & GAIM_MESSAGE_SYSTEM) && !(flags & GAIM_MESSAGE_ERROR))
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1329 return;
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1330
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
1331 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) {
6621
42fdf16f1dad [gaim-migrate @ 7145]
Mark Doliner <mark@kingant.net>
parents: 6607
diff changeset
1332 if ((flags & GAIM_MESSAGE_RECV) == GAIM_MESSAGE_RECV)
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1333 gaim_conv_im_set_typing_state(GAIM_CONV_IM(conv), GAIM_NOT_TYPING);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1334 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1335
10971
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1336 if (gaim_conv_window_has_focus(win) &&
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1337 gaim_conv_window_get_active_conversation(win) == conv)
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1338 {
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1339 unseen = GAIM_UNSEEN_NONE;
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1340 }
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1341 else
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1342 {
6621
42fdf16f1dad [gaim-migrate @ 7145]
Mark Doliner <mark@kingant.net>
parents: 6607
diff changeset
1343 if ((flags & GAIM_MESSAGE_NICK) == GAIM_MESSAGE_NICK ||
4616
767093a2ddaf [gaim-migrate @ 4907]
Nathan Walp <nwalp@pidgin.im>
parents: 4608
diff changeset
1344 gaim_conversation_get_unseen(conv) == GAIM_UNSEEN_NICK)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1345 unseen = GAIM_UNSEEN_NICK;
8722
230fee6f1e3e [gaim-migrate @ 9477]
Sean Egan <seanegan@gmail.com>
parents: 8635
diff changeset
1346 else if ((((flags & GAIM_MESSAGE_SYSTEM) == GAIM_MESSAGE_SYSTEM) ||
230fee6f1e3e [gaim-migrate @ 9477]
Sean Egan <seanegan@gmail.com>
parents: 8635
diff changeset
1347 ((flags & GAIM_MESSAGE_ERROR) == GAIM_MESSAGE_ERROR)) &&
6405
96de6d9eb422 [gaim-migrate @ 6910]
Christian Hammond <chipx86@chipx86.com>
parents: 6403
diff changeset
1348 gaim_conversation_get_unseen(conv) != GAIM_UNSEEN_TEXT)
96de6d9eb422 [gaim-migrate @ 6910]
Christian Hammond <chipx86@chipx86.com>
parents: 6403
diff changeset
1349 unseen = GAIM_UNSEEN_EVENT;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1350 else
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1351 unseen = GAIM_UNSEEN_TEXT;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1352 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1353
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1354 gaim_conversation_set_unseen(conv, unseen);
10971
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1355
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1356 /*
11048
3f04018e1308 [gaim-migrate @ 12976]
Mark Doliner <mark@kingant.net>
parents: 11033
diff changeset
1357 * TODO: This is #if 0'ed out because we don't have a way of
3f04018e1308 [gaim-migrate @ 12976]
Mark Doliner <mark@kingant.net>
parents: 11033
diff changeset
1358 * telling if a conversation window is minimized. This
3f04018e1308 [gaim-migrate @ 12976]
Mark Doliner <mark@kingant.net>
parents: 11033
diff changeset
1359 * should probably be done in gtkconv.c anyway.
3f04018e1308 [gaim-migrate @ 12976]
Mark Doliner <mark@kingant.net>
parents: 11033
diff changeset
1360 */
3f04018e1308 [gaim-migrate @ 12976]
Mark Doliner <mark@kingant.net>
parents: 11033
diff changeset
1361 #if 0
3f04018e1308 [gaim-migrate @ 12976]
Mark Doliner <mark@kingant.net>
parents: 11033
diff changeset
1362 /*
3f04018e1308 [gaim-migrate @ 12976]
Mark Doliner <mark@kingant.net>
parents: 11033
diff changeset
1363 * This is auto-tab switching.
3f04018e1308 [gaim-migrate @ 12976]
Mark Doliner <mark@kingant.net>
parents: 11033
diff changeset
1364 *
10971
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1365 * If we received an IM, and the GaimConvWindow is not active,
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1366 * then make this conversation the active tab in this GaimConvWindow.
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1367 *
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1368 * We do this so that, when the user comes back to the conversation
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1369 * window, the first thing they'll see is the new message. This is
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1370 * especially important when the IM window is flashing in their
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1371 * taskbar--we want the title of the window to be set to the name
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1372 * of the person that IMed them most recently.
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1373 */
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
1374 if ((gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) &&
10971
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1375 (flags & (GAIM_MESSAGE_RECV | GAIM_MESSAGE_ERROR)) &&
11048
3f04018e1308 [gaim-migrate @ 12976]
Mark Doliner <mark@kingant.net>
parents: 11033
diff changeset
1376 (!gaim_conv_window_has_focus(win)) &&
3f04018e1308 [gaim-migrate @ 12976]
Mark Doliner <mark@kingant.net>
parents: 11033
diff changeset
1377 (gaim_conv_window_is_minimized(win)))
10971
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1378 {
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1379 gaim_conv_window_switch_conversation(win, conv);
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1380 }
11048
3f04018e1308 [gaim-migrate @ 12976]
Mark Doliner <mark@kingant.net>
parents: 11033
diff changeset
1381 #endif
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1382 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1383
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1384 void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1385 gaim_conversation_update_progress(GaimConversation *conv, float percent)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1386 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1387 GaimConversationUiOps *ops;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1388
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1389 g_return_if_fail(conv != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1390 g_return_if_fail(percent >= 0 && percent <= 1);
3768
f53370197bb9 [gaim-migrate @ 3907]
Sean Egan <seanegan@gmail.com>
parents: 3763
diff changeset
1391
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1392 /*
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1393 * NOTE: A percent == 1 indicates that the progress bar should be
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1394 * closed.
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1395 */
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
1396 ops = gaim_conversation_get_ui_ops(conv);
3768
f53370197bb9 [gaim-migrate @ 3907]
Sean Egan <seanegan@gmail.com>
parents: 3763
diff changeset
1397
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1398 if (ops != NULL && ops->update_progress != NULL)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1399 ops->update_progress(conv, percent);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1400 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1401
9260
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1402 gboolean
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1403 gaim_conversation_has_focus(GaimConversation *conv)
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1404 {
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1405 gboolean ret = FALSE;
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1406 GaimConvWindow *win;
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1407 GaimConversationUiOps *ops;
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1408
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1409 g_return_val_if_fail(conv != NULL, FALSE);
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1410
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1411 win = gaim_conversation_get_window(conv);
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1412 if (gaim_conv_window_get_active_conversation(win) != conv)
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1413 return FALSE;
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1414
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1415 ops = gaim_conversation_get_ui_ops(conv);
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1416
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1417 if (ops != NULL && ops->has_focus != NULL)
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1418 ret = ops->has_focus(conv);
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1419
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1420 return ret;
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1421 }
947876140943 [gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents: 9251
diff changeset
1422
7930
68f70cf074d0 [gaim-migrate @ 8601]
Mark Doliner <mark@kingant.net>
parents: 7879
diff changeset
1423 /*
8256
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
1424 * TODO: Need to make sure calls to this function happen in the core
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
1425 * instead of the UI. That way UIs have less work to do, and the
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
1426 * core/UI split is cleaner. Also need to make sure this is called
7930
68f70cf074d0 [gaim-migrate @ 8601]
Mark Doliner <mark@kingant.net>
parents: 7879
diff changeset
1427 * when chats are added/removed from the blist.
68f70cf074d0 [gaim-migrate @ 8601]
Mark Doliner <mark@kingant.net>
parents: 7879
diff changeset
1428 */
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1429 void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1430 gaim_conversation_update(GaimConversation *conv, GaimConvUpdateType type)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1431 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1432 GaimConversationUiOps *ops;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1433
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1434 g_return_if_fail(conv != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1435
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
1436 ops = gaim_conversation_get_ui_ops(conv);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1437
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1438 if (ops != NULL && ops->updated != NULL)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1439 ops->updated(conv, type);
9734
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9633
diff changeset
1440
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9633
diff changeset
1441 gaim_signal_emit(gaim_conversations_get_handle(),
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9633
diff changeset
1442 "conversation-updated", conv, type);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1443 }
2993
7239a392486c [gaim-migrate @ 3006]
Rob Flynn <gaim@robflynn.com>
parents: 2979
diff changeset
1444
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1445 /**************************************************************************
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1446 * IM Conversation API
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1447 **************************************************************************/
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1448 GaimConversation *
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1449 gaim_conv_im_get_conversation(const GaimConvIm *im)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1450 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1451 g_return_val_if_fail(im != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1452
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1453 return im->conv;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1454 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1455
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1456 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1457 gaim_conv_im_set_icon(GaimConvIm *im, GaimBuddyIcon *icon)
6846
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
1458 {
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
1459 g_return_if_fail(im != NULL);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
1460
9261
77fdeb4c459f [gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents: 9260
diff changeset
1461 if (im->icon != icon)
77fdeb4c459f [gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents: 9260
diff changeset
1462 {
77fdeb4c459f [gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents: 9260
diff changeset
1463 if (im->icon != NULL)
77fdeb4c459f [gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents: 9260
diff changeset
1464 gaim_buddy_icon_unref(im->icon);
77fdeb4c459f [gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents: 9260
diff changeset
1465
77fdeb4c459f [gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents: 9260
diff changeset
1466 im->icon = (icon == NULL ? NULL : gaim_buddy_icon_ref(icon));
77fdeb4c459f [gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents: 9260
diff changeset
1467 }
6846
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
1468
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1469 gaim_conversation_update(gaim_conv_im_get_conversation(im),
6846
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
1470 GAIM_CONV_UPDATE_ICON);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
1471 }
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
1472
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
1473 GaimBuddyIcon *
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1474 gaim_conv_im_get_icon(const GaimConvIm *im)
6846
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
1475 {
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
1476 g_return_val_if_fail(im != NULL, NULL);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
1477
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
1478 return im->icon;
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
1479 }
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
1480
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
1481 void
8288
dde73afb3283 [gaim-migrate @ 9012]
Christian Hammond <chipx86@chipx86.com>
parents: 8287
diff changeset
1482 gaim_conv_im_set_typing_state(GaimConvIm *im, GaimTypingState state)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1483 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1484 g_return_if_fail(im != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1485
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1486 im->typing_state = state;
2993
7239a392486c [gaim-migrate @ 3006]
Rob Flynn <gaim@robflynn.com>
parents: 2979
diff changeset
1487 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1488
8288
dde73afb3283 [gaim-migrate @ 9012]
Christian Hammond <chipx86@chipx86.com>
parents: 8287
diff changeset
1489 GaimTypingState
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1490 gaim_conv_im_get_typing_state(const GaimConvIm *im)
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1491 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1492 g_return_val_if_fail(im != NULL, 0);
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1493
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1494 return im->typing_state;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1495 }
3704
04a911e7dfc9 [gaim-migrate @ 3835]
Rob Flynn <gaim@robflynn.com>
parents: 3699
diff changeset
1496
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1497 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1498 gaim_conv_im_start_typing_timeout(GaimConvIm *im, int timeout)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1499 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1500 GaimConversation *conv;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1501 const char *name;
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1502
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1503 g_return_if_fail(im != NULL);
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1504
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1505 if (im->typing_timeout > 0)
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1506 gaim_conv_im_stop_typing_timeout(im);
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1507
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1508 conv = gaim_conv_im_get_conversation(im);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1509 name = gaim_conversation_get_name(conv);
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1510
8273
f24172f53650 [gaim-migrate @ 8997]
Christian Hammond <chipx86@chipx86.com>
parents: 8271
diff changeset
1511 im->typing_timeout = gaim_timeout_add(timeout * 1000, reset_typing, conv);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1512 }
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1513
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1514 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1515 gaim_conv_im_stop_typing_timeout(GaimConvIm *im)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1516 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1517 g_return_if_fail(im != NULL);
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1518
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1519 if (im->typing_timeout == 0)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1520 return;
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1521
8287
ef881489396e [gaim-migrate @ 9011]
Christian Hammond <chipx86@chipx86.com>
parents: 8273
diff changeset
1522 gaim_timeout_remove(im->typing_timeout);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1523 im->typing_timeout = 0;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1524 }
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1525
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1526 guint
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1527 gaim_conv_im_get_typing_timeout(const GaimConvIm *im)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1528 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1529 g_return_val_if_fail(im != NULL, 0);
3699
b401bd1701b4 [gaim-migrate @ 3830]
Rob Flynn <gaim@robflynn.com>
parents: 3696
diff changeset
1530
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1531 return im->typing_timeout;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1532 }
3699
b401bd1701b4 [gaim-migrate @ 3830]
Rob Flynn <gaim@robflynn.com>
parents: 3696
diff changeset
1533
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1534 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1535 gaim_conv_im_set_type_again(GaimConvIm *im, time_t val)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1536 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1537 g_return_if_fail(im != NULL);
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1538
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1539 im->type_again = val;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1540 }
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1541
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1542 time_t
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1543 gaim_conv_im_get_type_again(const GaimConvIm *im)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1544 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1545 g_return_val_if_fail(im != NULL, 0);
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1546
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1547 return im->type_again;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1548 }
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1549
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1550 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1551 gaim_conv_im_start_type_again_timeout(GaimConvIm *im)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1552 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1553 g_return_if_fail(im != NULL);
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1554
8273
f24172f53650 [gaim-migrate @ 8997]
Christian Hammond <chipx86@chipx86.com>
parents: 8271
diff changeset
1555 im->type_again_timeout = gaim_timeout_add(SEND_TYPED_TIMEOUT, send_typed,
f24172f53650 [gaim-migrate @ 8997]
Christian Hammond <chipx86@chipx86.com>
parents: 8271
diff changeset
1556 gaim_conv_im_get_conversation(im));
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1557 }
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1558
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1559 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1560 gaim_conv_im_stop_type_again_timeout(GaimConvIm *im)
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1561 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1562 g_return_if_fail(im != NULL);
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1563
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1564 if (im->type_again_timeout == 0)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1565 return;
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1566
8287
ef881489396e [gaim-migrate @ 9011]
Christian Hammond <chipx86@chipx86.com>
parents: 8273
diff changeset
1567 gaim_timeout_remove(im->type_again_timeout);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1568 im->type_again_timeout = 0;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1569 }
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1570
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1571 guint
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1572 gaim_conv_im_get_type_again_timeout(const GaimConvIm *im)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1573 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1574 g_return_val_if_fail(im != NULL, 0);
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1575
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1576 return im->type_again_timeout;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1577 }
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1578
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1579 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1580 gaim_conv_im_update_typing(GaimConvIm *im)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1581 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1582 g_return_if_fail(im != NULL);
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1583
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1584 gaim_conversation_update(gaim_conv_im_get_conversation(im),
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1585 GAIM_CONV_UPDATE_TYPING);
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1586 }
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1587
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1588 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1589 gaim_conv_im_write(GaimConvIm *im, const char *who, const char *message,
6982
083d1e4a9c78 [gaim-migrate @ 7538]
Mark Doliner <mark@kingant.net>
parents: 6846
diff changeset
1590 GaimMessageFlags flags, time_t mtime)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1591 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1592 GaimConversation *c;
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1593
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1594 g_return_if_fail(im != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1595 g_return_if_fail(message != NULL);
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1596
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1597 c = gaim_conv_im_get_conversation(im);
2787
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
1598
4382
76223649765b [gaim-migrate @ 4648]
Christian Hammond <chipx86@chipx86.com>
parents: 4378
diff changeset
1599 /* Raise the window, if specified in prefs. */
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
1600 if (c->ui_ops != NULL && c->ui_ops->write_im != NULL)
6982
083d1e4a9c78 [gaim-migrate @ 7538]
Mark Doliner <mark@kingant.net>
parents: 6846
diff changeset
1601 c->ui_ops->write_im(c, who, message, flags, mtime);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1602 else
6982
083d1e4a9c78 [gaim-migrate @ 7538]
Mark Doliner <mark@kingant.net>
parents: 6846
diff changeset
1603 gaim_conversation_write(c, who, message, flags, mtime);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1604 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1605
9627
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1606 gboolean gaim_conv_present_error(const char *who, GaimAccount *account, const char *what)
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1607 {
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1608 GaimConversation *conv;
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1609 GaimConvWindow *window;
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1610
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1611 g_return_val_if_fail(who != NULL, FALSE);
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1612 g_return_val_if_fail(account !=NULL, FALSE);
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1613 g_return_val_if_fail(what != NULL, FALSE);
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1614
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
1615 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_ANY, who, account);
9627
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1616 if (conv != NULL)
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1617 gaim_conversation_write(conv, NULL, what, GAIM_MESSAGE_ERROR, time(NULL));
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1618 else
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1619 return FALSE;
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1620 window = gaim_conversation_get_window(conv);
10246
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1621
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1622 /*
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1623 * Change the active conversation to this conversation unless the
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1624 * user is already using this window.
10971
57e3e958ff49 [gaim-migrate @ 12796]
Mark Doliner <mark@kingant.net>
parents: 10962
diff changeset
1625 * TODO: There's a good chance this is no longer necessary
10246
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1626 */
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10132
diff changeset
1627 if (!gaim_conv_window_has_focus(window))
10827
53e7884c549a [gaim-migrate @ 12492]
Tim Ringenbach <marv@pidgin.im>
parents: 10824
diff changeset
1628 gaim_conv_window_switch_conversation(window, conv);
9627
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1629
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1630 gaim_conv_window_raise(window);
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1631
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1632 return TRUE;
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1633 }
8a540b8a5f70 [gaim-migrate @ 10471]
Sean Egan <seanegan@gmail.com>
parents: 9620
diff changeset
1634
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1635 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1636 gaim_conv_im_send(GaimConvIm *im, const char *message)
2379
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1637 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1638 g_return_if_fail(im != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1639 g_return_if_fail(message != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1640
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1641 common_send(gaim_conv_im_get_conversation(im), message);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1642 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1643
10526
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1644 gboolean
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1645 gaim_conv_custom_smiley_add(GaimConversation *conv, const char *smile,
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1646 const char *cksum_type, const char *chksum)
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1647 {
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1648 if (conv == NULL || smile == NULL || !*smile) {
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1649 return FALSE;
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1650 }
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1651
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1652 /* TODO: check if the icon is in the cache and return false if so */
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1653 /* TODO: add an icon cache (that doesn't suck) */
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1654 if (conv->ui_ops != NULL && conv->ui_ops->custom_smiley_add !=NULL) {
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1655 return conv->ui_ops->custom_smiley_add(conv, smile);
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1656 } else {
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1657 gaim_debug_info("conversation", "Could not find add custom smiley function");
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1658 return FALSE;
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1659 }
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1660
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1661 }
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1662
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1663 void
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1664 gaim_conv_custom_smiley_write(GaimConversation *conv, const char *smile,
11137
096020ae09a9 [gaim-migrate @ 13201]
Mark Doliner <mark@kingant.net>
parents: 11064
diff changeset
1665 const guchar *data, gsize size)
10526
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1666 {
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1667 g_return_if_fail(conv != NULL);
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1668 g_return_if_fail(smile != NULL && *smile);
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1669
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1670 if (conv->ui_ops != NULL && conv->ui_ops->custom_smiley_write != NULL)
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1671 conv->ui_ops->custom_smiley_write(conv, smile, data, size);
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1672 else
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1673 gaim_debug_info("conversation", "Could not find the smiley write function");
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1674 }
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1675
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1676 void
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1677 gaim_conv_custom_smiley_close(GaimConversation *conv, const char *smile)
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1678 {
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1679 g_return_if_fail(conv != NULL);
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1680 g_return_if_fail(smile != NULL && *smile);
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1681
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1682 if (conv->ui_ops != NULL && conv->ui_ops->custom_smiley_close != NULL)
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1683 conv->ui_ops->custom_smiley_close(conv, smile);
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1684 else
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1685 gaim_debug_info("conversation", "Could not find custom smiley close function");
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1686 }
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1687
55e7d72fc09a [gaim-migrate @ 11843]
Tim Ringenbach <marv@pidgin.im>
parents: 10504
diff changeset
1688
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1689 /**************************************************************************
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1690 * Chat Conversation API
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1691 **************************************************************************/
2379
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1692
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1693 GaimConversation *
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1694 gaim_conv_chat_get_conversation(const GaimConvChat *chat)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1695 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1696 g_return_val_if_fail(chat != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1697
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1698 return chat->conv;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1699 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1700
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1701 GList *
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1702 gaim_conv_chat_set_users(GaimConvChat *chat, GList *users)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1703 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1704 g_return_val_if_fail(chat != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1705
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1706 chat->in_room = users;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1707
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1708 return users;
2379
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1709 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1710
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1711 GList *
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1712 gaim_conv_chat_get_users(const GaimConvChat *chat)
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1713 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1714 g_return_val_if_fail(chat != NULL, NULL);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1715
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1716 return chat->in_room;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1717 }
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1718
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1719 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1720 gaim_conv_chat_ignore(GaimConvChat *chat, const char *name)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1721 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1722 g_return_if_fail(chat != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1723 g_return_if_fail(name != NULL);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1724
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1725 /* Make sure the user isn't already ignored. */
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1726 if (gaim_conv_chat_is_user_ignored(chat, name))
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1727 return;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1728
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1729 gaim_conv_chat_set_ignored(chat,
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1730 g_list_append(gaim_conv_chat_get_ignored(chat), g_strdup(name)));
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1731 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1732
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1733 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1734 gaim_conv_chat_unignore(GaimConvChat *chat, const char *name)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1735 {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1736 GList *item;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1737
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1738 g_return_if_fail(chat != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1739 g_return_if_fail(name != NULL);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1740
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1741 /* Make sure the user is actually ignored. */
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1742 if (!gaim_conv_chat_is_user_ignored(chat, name))
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1743 return;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1744
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1745 item = g_list_find(gaim_conv_chat_get_ignored(chat),
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1746 gaim_conv_chat_get_ignored_user(chat, name));
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1747
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1748 gaim_conv_chat_set_ignored(chat,
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1749 g_list_remove_link(gaim_conv_chat_get_ignored(chat), item));
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1750
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1751 g_free(item->data);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1752 g_list_free_1(item);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1753 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1754
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1755 GList *
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1756 gaim_conv_chat_set_ignored(GaimConvChat *chat, GList *ignored)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1757 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1758 g_return_val_if_fail(chat != NULL, NULL);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1759
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1760 chat->ignored = ignored;
993
eacd93d0089a [gaim-migrate @ 1003]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1761
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1762 return ignored;
2111
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
1763 }
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
1764
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1765 GList *
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1766 gaim_conv_chat_get_ignored(const GaimConvChat *chat)
2111
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
1767 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1768 g_return_val_if_fail(chat != NULL, NULL);
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1769
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1770 return chat->ignored;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1771 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1772
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1773 const char *
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1774 gaim_conv_chat_get_ignored_user(const GaimConvChat *chat, const char *user)
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
1775 {
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1776 GList *ignored;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1777
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1778 g_return_val_if_fail(chat != NULL, NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1779 g_return_val_if_fail(user != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1780
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1781 for (ignored = gaim_conv_chat_get_ignored(chat);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1782 ignored != NULL;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1783 ignored = ignored->next) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
1784
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1785 const char *ign = (const char *)ignored->data;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1786
4793
677d3cb193a1 [gaim-migrate @ 5113]
Nathan Walp <nwalp@pidgin.im>
parents: 4687
diff changeset
1787 if (!gaim_utf8_strcasecmp(user, ign) ||
677d3cb193a1 [gaim-migrate @ 5113]
Nathan Walp <nwalp@pidgin.im>
parents: 4687
diff changeset
1788 ((*ign == '+' || *ign == '%') && !gaim_utf8_strcasecmp(user, ign + 1)))
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1789 return ign;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1790
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1791 if (*ign == '@') {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1792 ign++;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1793
4793
677d3cb193a1 [gaim-migrate @ 5113]
Nathan Walp <nwalp@pidgin.im>
parents: 4687
diff changeset
1794 if ((*ign == '+' && !gaim_utf8_strcasecmp(user, ign + 1)) ||
677d3cb193a1 [gaim-migrate @ 5113]
Nathan Walp <nwalp@pidgin.im>
parents: 4687
diff changeset
1795 (*ign != '+' && !gaim_utf8_strcasecmp(user, ign)))
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1796 return ign;
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
1797 }
2094
be10a1243ed7 [gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
1798 }
1341
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
1799
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1800 return NULL;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1801 }
1341
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
1802
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1803 gboolean
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1804 gaim_conv_chat_is_user_ignored(const GaimConvChat *chat, const char *user)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1805 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1806 g_return_val_if_fail(chat != NULL, FALSE);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1807 g_return_val_if_fail(user != NULL, FALSE);
1341
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
1808
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1809 return (gaim_conv_chat_get_ignored_user(chat, user) != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1810 }
1343
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1811
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1812 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1813 gaim_conv_chat_set_topic(GaimConvChat *chat, const char *who, const char *topic)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1814 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1815 g_return_if_fail(chat != NULL);
1343
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1816
7606
08c9d0dcf906 [gaim-migrate @ 8229]
Luke Schierer <lschiere@pidgin.im>
parents: 7602
diff changeset
1817 if (chat->who != NULL) g_free(chat->who);
08c9d0dcf906 [gaim-migrate @ 8229]
Luke Schierer <lschiere@pidgin.im>
parents: 7602
diff changeset
1818 if (chat->topic != NULL) g_free(chat->topic);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1819
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1820 chat->who = (who == NULL ? NULL : g_strdup(who));
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1821 chat->topic = (topic == NULL ? NULL : g_strdup(topic));
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1822
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1823 gaim_conversation_update(gaim_conv_chat_get_conversation(chat),
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1824 GAIM_CONV_UPDATE_TOPIC);
9517
0524b36c701a [gaim-migrate @ 10344]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
1825
0524b36c701a [gaim-migrate @ 10344]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
1826 gaim_signal_emit(gaim_conversations_get_handle(), "chat-topic-changed",
0524b36c701a [gaim-migrate @ 10344]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
1827 chat->conv, chat->who, chat->topic);
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
1828 }
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
1829
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1830 const char *
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1831 gaim_conv_chat_get_topic(const GaimConvChat *chat)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1832 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1833 g_return_val_if_fail(chat != NULL, NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1834
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1835 return chat->topic;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1836 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1837
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1838 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1839 gaim_conv_chat_set_id(GaimConvChat *chat, int id)
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1840 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1841 g_return_if_fail(chat != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1842
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1843 chat->id = id;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1844 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1845
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1846 int
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1847 gaim_conv_chat_get_id(const GaimConvChat *chat)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1848 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1849 g_return_val_if_fail(chat != NULL, -1);
3951
32942c49dced [gaim-migrate @ 4132]
Luke Schierer <lschiere@pidgin.im>
parents: 3925
diff changeset
1850
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1851 return chat->id;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1852 }
3951
32942c49dced [gaim-migrate @ 4132]
Luke Schierer <lschiere@pidgin.im>
parents: 3925
diff changeset
1853
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1854 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1855 gaim_conv_chat_write(GaimConvChat *chat, const char *who, const char *message,
6621
42fdf16f1dad [gaim-migrate @ 7145]
Mark Doliner <mark@kingant.net>
parents: 6607
diff changeset
1856 GaimMessageFlags flags, time_t mtime)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1857 {
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5545
diff changeset
1858 GaimAccount *account;
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1859 GaimConversation *conv;
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5545
diff changeset
1860 GaimConnection *gc;
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1861 GaimPluginProtocolInfo *prpl_info;
3866
994b5c4d15dd [gaim-migrate @ 4018]
Rob Flynn <gaim@robflynn.com>
parents: 3846
diff changeset
1862
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1863 g_return_if_fail(chat != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1864 g_return_if_fail(who != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1865 g_return_if_fail(message != NULL);
3866
994b5c4d15dd [gaim-migrate @ 4018]
Rob Flynn <gaim@robflynn.com>
parents: 3846
diff changeset
1866
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1867 conv = gaim_conv_chat_get_conversation(chat);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1868 gc = gaim_conversation_get_gc(conv);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1869 account = gaim_connection_get_account(gc);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1870 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1871
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1872 /* Don't display this if the person who wrote it is ignored. */
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1873 if (gaim_conv_chat_is_user_ignored(chat, who))
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1874 return;
3677
7571943d6851 [gaim-migrate @ 3807]
Rob Flynn <gaim@robflynn.com>
parents: 3671
diff changeset
1875
6621
42fdf16f1dad [gaim-migrate @ 7145]
Mark Doliner <mark@kingant.net>
parents: 6607
diff changeset
1876 if (!(flags & GAIM_MESSAGE_WHISPER)) {
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1877 char *str;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1878
7261
1930e3d00ecd [gaim-migrate @ 7838]
Nathan Walp <nwalp@pidgin.im>
parents: 7257
diff changeset
1879 str = g_strdup(gaim_normalize(account, who));
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1880
11500
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
1881 if (!strcmp(str, gaim_normalize(account, chat->nick))) {
6621
42fdf16f1dad [gaim-migrate @ 7145]
Mark Doliner <mark@kingant.net>
parents: 6607
diff changeset
1882 flags |= GAIM_MESSAGE_SEND;
8158
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
1883 } else {
6621
42fdf16f1dad [gaim-migrate @ 7145]
Mark Doliner <mark@kingant.net>
parents: 6607
diff changeset
1884 flags |= GAIM_MESSAGE_RECV;
3677
7571943d6851 [gaim-migrate @ 3807]
Rob Flynn <gaim@robflynn.com>
parents: 3671
diff changeset
1885
11552
11d30825c1bb [gaim-migrate @ 13812]
Gary Kramlich <grim@reaperworld.com>
parents: 11500
diff changeset
1886 if (gaim_utf8_has_word(message, chat->nick))
6621
42fdf16f1dad [gaim-migrate @ 7145]
Mark Doliner <mark@kingant.net>
parents: 6607
diff changeset
1887 flags |= GAIM_MESSAGE_NICK;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1888 }
6060
6b4a12cd4caf [gaim-migrate @ 6510]
Nathan Walp <nwalp@pidgin.im>
parents: 6054
diff changeset
1889
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1890 g_free(str);
3677
7571943d6851 [gaim-migrate @ 3807]
Rob Flynn <gaim@robflynn.com>
parents: 3671
diff changeset
1891 }
3705
91498932cea7 [gaim-migrate @ 3838]
Luke Schierer <lschiere@pidgin.im>
parents: 3704
diff changeset
1892
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1893 /* Pass this on to either the ops structure or the default write func. */
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
1894 if (conv->ui_ops != NULL && conv->ui_ops->write_chat != NULL)
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
1895 conv->ui_ops->write_chat(conv, who, message, flags, mtime);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1896 else
6982
083d1e4a9c78 [gaim-migrate @ 7538]
Mark Doliner <mark@kingant.net>
parents: 6846
diff changeset
1897 gaim_conversation_write(conv, who, message, flags, mtime);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1898 }
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1899
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1900 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1901 gaim_conv_chat_send(GaimConvChat *chat, const char *message)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1902 {
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1903 g_return_if_fail(chat != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1904 g_return_if_fail(message != NULL);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1905
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1906 common_send(gaim_conv_chat_get_conversation(chat), message);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1907 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1908
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1909 void
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1910 gaim_conv_chat_add_user(GaimConvChat *chat, const char *user,
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1911 const char *extra_msg, GaimConvChatBuddyFlags flags,
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1912 gboolean new_arrival)
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1913 {
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1914 GList *users = g_list_append(NULL, (char *)user);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1915 GList *extra_msgs = g_list_append(NULL, (char *)extra_msg);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1916 GList *flags2 = g_list_append(NULL, GINT_TO_POINTER(flags));
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1917
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1918 gaim_conv_chat_add_users(chat, users, extra_msgs, flags2, new_arrival);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1919
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1920 g_list_free(users);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1921 g_list_free(extra_msgs);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1922 g_list_free(flags2);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1923 }
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1924
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1925 void
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1926 gaim_conv_chat_add_users(GaimConvChat *chat, GList *users, GList *extra_msgs,
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1927 GList *flags, gboolean new_arrivals)
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1928 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1929 GaimConversation *conv;
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
1930 GaimConversationUiOps *ops;
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
1931 GaimConvChatBuddy *cb;
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1932 GaimConnection *gc;
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1933 GaimPluginProtocolInfo *prpl_info;
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
1934 GList *ul, *fl;
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1935 GList *aliases = NULL;
6407
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
1936
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
1937 g_return_if_fail(chat != NULL);
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
1938 g_return_if_fail(users != NULL);
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
1939
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1940 conv = gaim_conv_chat_get_conversation(chat);
6407
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
1941 ops = gaim_conversation_get_ui_ops(conv);
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
1942
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1943 gc = gaim_conversation_get_gc(conv);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1944 if (!gc || !(prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)))
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1945 return;
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1946
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
1947 ul = users;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
1948 fl = flags;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
1949 while ((ul != NULL) && (fl != NULL)) {
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
1950 const char *user = (const char *)ul->data;
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1951 const char *alias = user;
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1952 gboolean quiet;
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1953 GaimConvChatBuddyFlags flags = GPOINTER_TO_INT(fl->data);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1954 const char *extra_msg = (extra_msgs ? extra_msgs->data : NULL);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1955
11500
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
1956 if (!strcmp(chat->nick, gaim_normalize(conv->account, user))) {
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
1957 const char *alias2 = gaim_account_get_alias(conv->account);
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
1958 if (alias2 != NULL)
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
1959 alias = alias2;
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1960 else
11500
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
1961 {
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
1962 const char *display_name = gaim_connection_get_display_name(gc);
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
1963 if (display_name != NULL)
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
1964 alias = display_name;
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1965 }
11500
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
1966 } else if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
1967 GaimBuddy *buddy;
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
1968 if ((buddy = gaim_find_buddy(gc->account, user)) != NULL)
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
1969 alias = gaim_buddy_get_contact_alias(buddy);
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1970 }
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1971
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1972 quiet = GPOINTER_TO_INT(gaim_signal_emit_return_1(gaim_conversations_get_handle(),
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1973 "chat-buddy-joining", conv, user, flags)) |
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1974 gaim_conv_chat_is_user_ignored(chat, user);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1975
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1976 cb = gaim_conv_chat_cb_new(user, flags);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1977 gaim_conv_chat_set_users(chat,
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1978 g_list_prepend(gaim_conv_chat_get_users(chat), cb));
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1979 aliases = g_list_append(aliases, (char *)alias);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1980
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1981 if (!quiet && new_arrivals) {
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1982 char *tmp;
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1983
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1984 if (extra_msg == NULL)
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1985 tmp = g_strdup_printf(_("%s entered the room."), alias);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1986 else
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1987 tmp = g_strdup_printf(_("%s [<I>%s</I>] entered the room."),
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1988 alias, extra_msg);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1989
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1990 gaim_conversation_write(conv, NULL, tmp, GAIM_MESSAGE_SYSTEM, time(NULL));
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1991 g_free(tmp);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1992 }
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
1993
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
1994 gaim_signal_emit(gaim_conversations_get_handle(),
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1995 "chat-buddy-joined", conv, user, flags);
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
1996 ul = ul->next;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
1997 fl = fl->next;
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1998 if (extra_msgs != NULL)
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
1999 extra_msgs = extra_msgs->next;
6407
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2000 }
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2001
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2002 if (ops != NULL && ops->chat_add_users != NULL)
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2003 ops->chat_add_users(conv, users, aliases);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2004
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2005 g_list_free(aliases);
6407
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2006 }
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2007
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2008 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2009 gaim_conv_chat_rename_user(GaimConvChat *chat, const char *old_user,
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2010 const char *new_user)
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2011 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2012 GaimConversation *conv;
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2013 GaimConversationUiOps *ops;
11485
16b0da1f376f [gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents: 11481
diff changeset
2014 GaimConnection *gc;
16b0da1f376f [gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents: 11481
diff changeset
2015 GaimPluginProtocolInfo *prpl_info;
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2016 GaimConvChatBuddy *cb;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2017 GaimConvChatBuddyFlags flags;
11485
16b0da1f376f [gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents: 11481
diff changeset
2018 const char *new_alias = new_user;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
2019 char tmp[BUF_LONG];
11485
16b0da1f376f [gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents: 11481
diff changeset
2020 gboolean is_me = FALSE;
3866
994b5c4d15dd [gaim-migrate @ 4018]
Rob Flynn <gaim@robflynn.com>
parents: 3846
diff changeset
2021
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
2022 g_return_if_fail(chat != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
2023 g_return_if_fail(old_user != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
2024 g_return_if_fail(new_user != NULL);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2025
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2026 conv = gaim_conv_chat_get_conversation(chat);
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
2027 ops = gaim_conversation_get_ui_ops(conv);
3304
7c5325f460de [gaim-migrate @ 3322]
Sean Egan <seanegan@gmail.com>
parents: 3300
diff changeset
2028
11485
16b0da1f376f [gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents: 11481
diff changeset
2029 gc = gaim_conversation_get_gc(conv);
16b0da1f376f [gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents: 11481
diff changeset
2030 g_return_if_fail(gc != NULL);
16b0da1f376f [gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents: 11481
diff changeset
2031 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl);
16b0da1f376f [gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents: 11481
diff changeset
2032 g_return_if_fail(prpl_info != NULL);
16b0da1f376f [gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents: 11481
diff changeset
2033
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2034 flags = gaim_conv_chat_user_get_flags(chat, old_user);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2035 cb = gaim_conv_chat_cb_new(new_user, flags);
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2036 gaim_conv_chat_set_users(chat,
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2037 g_list_prepend(gaim_conv_chat_get_users(chat), cb));
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
2038
11500
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2039 if (!strcmp(chat->nick, gaim_normalize(conv->account, old_user))) {
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2040 const char *alias;
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2041
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2042 /* Note this for later. */
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2043 is_me = TRUE;
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2044
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2045 alias = gaim_account_get_alias(conv->account);
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2046 if (alias != NULL)
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2047 new_alias = alias;
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2048 else
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2049 {
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2050 const char *display_name = gaim_connection_get_display_name(gc);
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2051 if (display_name != NULL)
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2052 alias = display_name;
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2053 }
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2054 } else if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
11485
16b0da1f376f [gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents: 11481
diff changeset
2055 GaimBuddy *buddy;
16b0da1f376f [gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents: 11481
diff changeset
2056 if ((buddy = gaim_find_buddy(gc->account, new_user)) != NULL)
16b0da1f376f [gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents: 11481
diff changeset
2057 new_alias = gaim_buddy_get_contact_alias(buddy);
16b0da1f376f [gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents: 11481
diff changeset
2058 }
16b0da1f376f [gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents: 11481
diff changeset
2059
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
2060 if (ops != NULL && ops->chat_rename_user != NULL)
11485
16b0da1f376f [gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents: 11481
diff changeset
2061 ops->chat_rename_user(conv, old_user, new_user, new_alias);
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3641
diff changeset
2062
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2063 cb = gaim_conv_chat_cb_find(chat, old_user);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2064
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2065 if (cb) {
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2066 gaim_conv_chat_set_users(chat,
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2067 g_list_remove(gaim_conv_chat_get_users(chat), cb));
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2068 gaim_conv_chat_cb_destroy(cb);
4506
f3afcc4dd133 [gaim-migrate @ 4781]
Christian Hammond <chipx86@chipx86.com>
parents: 4491
diff changeset
2069 }
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2070
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2071 if (gaim_conv_chat_is_user_ignored(chat, old_user)) {
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2072 gaim_conv_chat_unignore(chat, old_user);
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2073 gaim_conv_chat_ignore(chat, new_user);
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2074 }
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2075 else if (gaim_conv_chat_is_user_ignored(chat, new_user))
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2076 gaim_conv_chat_unignore(chat, new_user);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2077
11500
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2078 if (is_me)
8158
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2079 gaim_conv_chat_set_nick(chat, new_user);
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2080
11481
c80edbd8961a [gaim-migrate @ 13723]
Richard Laager <rlaager@wiktel.com>
parents: 11478
diff changeset
2081 if (gaim_prefs_get_bool("/core/conversations/chat/show_nick_change") &&
c80edbd8961a [gaim-migrate @ 13723]
Richard Laager <rlaager@wiktel.com>
parents: 11478
diff changeset
2082 !gaim_conv_chat_is_user_ignored(chat, new_user)) {
c80edbd8961a [gaim-migrate @ 13723]
Richard Laager <rlaager@wiktel.com>
parents: 11478
diff changeset
2083
11500
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2084 if (is_me) {
8158
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2085 g_snprintf(tmp, sizeof(tmp),
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2086 _("You are now known as %s"), new_user);
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2087 } else {
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2088 const char *old_alias = old_user;
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2089 const char *new_alias = new_user;
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2090
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2091 if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2092 GaimBuddy *buddy;
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2093
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2094 if ((buddy = gaim_find_buddy(gc->account, old_user)) != NULL)
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2095 old_alias = gaim_buddy_get_contact_alias(buddy);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2096 if ((buddy = gaim_find_buddy(gc->account, new_user)) != NULL)
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2097 new_alias = gaim_buddy_get_contact_alias(buddy);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2098 }
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2099
8158
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2100 g_snprintf(tmp, sizeof(tmp),
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2101 _("%s is now known as %s"), old_alias, new_alias);
8158
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2102 }
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2103
6982
083d1e4a9c78 [gaim-migrate @ 7538]
Mark Doliner <mark@kingant.net>
parents: 6846
diff changeset
2104 gaim_conversation_write(conv, NULL, tmp, GAIM_MESSAGE_SYSTEM, time(NULL));
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2105 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2106 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2107
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
2108 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2109 gaim_conv_chat_remove_user(GaimConvChat *chat, const char *user, const char *reason)
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2110 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2111 GaimConversation *conv;
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2112 GaimConversationUiOps *ops;
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2113 GaimConvChatBuddy *cb;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
2114 char tmp[BUF_LONG];
9587
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
2115 gboolean quiet;
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2116 const char *alias = user;
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2117
5677
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
2118 g_return_if_fail(chat != NULL);
0adfd56b46b5 [gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
2119 g_return_if_fail(user != NULL);
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2120
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2121 conv = gaim_conv_chat_get_conversation(chat);
4465
6e37eb000b7a [gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents: 4425
diff changeset
2122 ops = gaim_conversation_get_ui_ops(conv);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
2123
9587
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
2124 quiet = GPOINTER_TO_INT(gaim_signal_emit_return_1(gaim_conversations_get_handle(),
10955
83a79d69160c [gaim-migrate @ 12755]
Mark Doliner <mark@kingant.net>
parents: 10849
diff changeset
2125 "chat-buddy-leaving", conv, user, reason)) |
83a79d69160c [gaim-migrate @ 12755]
Mark Doliner <mark@kingant.net>
parents: 10849
diff changeset
2126 gaim_conv_chat_is_user_ignored(chat, user);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
2127
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
2128 if (ops != NULL && ops->chat_remove_user != NULL)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
2129 ops->chat_remove_user(conv, user);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
2130
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2131 cb = gaim_conv_chat_cb_find(chat, user);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2132
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2133 if (cb) {
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2134 gaim_conv_chat_set_users(chat,
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2135 g_list_remove(gaim_conv_chat_get_users(chat), cb));
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2136 gaim_conv_chat_cb_destroy(cb);
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2137 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2138
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
2139 /* NOTE: Don't remove them from ignored in case they re-enter. */
2787
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2140
9587
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
2141 if (!quiet) {
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2142 GaimConnection *gc = gaim_conversation_get_gc(conv);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2143 GaimPluginProtocolInfo *prpl_info;
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2144
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2145 if (!gc || !(prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)))
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2146 return;
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2147
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2148 if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2149 GaimBuddy *buddy;
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2150
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2151 if ((buddy = gaim_find_buddy(gc->account, user)) != NULL)
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2152 alias = gaim_buddy_get_contact_alias(buddy);
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2153 }
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2154
9587
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
2155 if (reason != NULL && *reason != '\0')
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
2156 g_snprintf(tmp, sizeof(tmp),
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2157 _("%s left the room (%s)."), alias, reason);
9587
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
2158 else
11454
201617d49573 [gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents: 11338
diff changeset
2159 g_snprintf(tmp, sizeof(tmp), _("%s left the room."), alias);
9587
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
2160
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
2161 gaim_conversation_write(conv, NULL, tmp, GAIM_MESSAGE_SYSTEM, time(NULL));
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
2162 }
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2163
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2164 gaim_signal_emit(gaim_conversations_get_handle(), "chat-buddy-left",
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2165 conv, user, reason);
1759
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2166 }
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2167
6407
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2168 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2169 gaim_conv_chat_remove_users(GaimConvChat *chat, GList *users, const char *reason)
6407
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2170 {
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2171 GaimConversation *conv;
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2172 GaimConversationUiOps *ops;
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2173 GaimConvChatBuddy *cb;
6407
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2174 char tmp[BUF_LONG];
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2175 GList *l;
9606
03be9d653123 [gaim-migrate @ 10449]
Luke Schierer <lschiere@pidgin.im>
parents: 9587
diff changeset
2176 gboolean quiet = FALSE;
6407
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2177
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2178 g_return_if_fail(chat != NULL);
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2179 g_return_if_fail(users != NULL);
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2180
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2181 conv = gaim_conv_chat_get_conversation(chat);
6407
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2182 ops = gaim_conversation_get_ui_ops(conv);
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2183
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2184 for (l = users; l != NULL; l = l->next) {
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2185 const char *user = (const char *)l->data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2186
9587
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
2187 quiet = GPOINTER_TO_INT(gaim_signal_emit_return_1(gaim_conversations_get_handle(),
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
2188 "chat-buddy-leaving", conv, user, reason));
6407
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2189 }
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2190
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2191 if (ops != NULL && ops->chat_remove_users != NULL)
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2192 ops->chat_remove_users(conv, users);
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2193
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2194 for (l = users; l != NULL; l = l->next) {
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2195 const char *user = (const char *)l->data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2196
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2197 cb = gaim_conv_chat_cb_find(chat, user);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2198
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2199 if (cb) {
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2200 gaim_conv_chat_set_users(chat,
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2201 g_list_remove(gaim_conv_chat_get_users(chat), cb));
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2202 gaim_conv_chat_cb_destroy(cb);
6407
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2203 }
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2204
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2205 gaim_signal_emit(gaim_conversations_get_handle(), "chat-buddy-left",
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2206 conv, user, reason);
6407
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2207 }
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2208
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2209 /* NOTE: Don't remove them from ignored in case they re-enter. */
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2210
9587
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
2211 if (!quiet && reason != NULL && *reason != '\0') {
8998
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2212 int i;
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2213 int size = g_list_length(users);
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2214 int max = MIN(10, size);
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2215 GList *l;
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2216
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2217 *tmp = '\0';
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2218
10958
90d22e1b68df [gaim-migrate @ 12759]
Mark Doliner <mark@kingant.net>
parents: 10955
diff changeset
2219 for (l = users, i = 0; i < max; i++, l = l->next)
90d22e1b68df [gaim-migrate @ 12759]
Mark Doliner <mark@kingant.net>
parents: 10955
diff changeset
2220 {
90d22e1b68df [gaim-migrate @ 12759]
Mark Doliner <mark@kingant.net>
parents: 10955
diff changeset
2221 if (!gaim_conv_chat_is_user_ignored(chat, (char *)l->data))
90d22e1b68df [gaim-migrate @ 12759]
Mark Doliner <mark@kingant.net>
parents: 10955
diff changeset
2222 {
90d22e1b68df [gaim-migrate @ 12759]
Mark Doliner <mark@kingant.net>
parents: 10955
diff changeset
2223 g_strlcat(tmp, (char *)l->data, sizeof(tmp));
90d22e1b68df [gaim-migrate @ 12759]
Mark Doliner <mark@kingant.net>
parents: 10955
diff changeset
2224
90d22e1b68df [gaim-migrate @ 12759]
Mark Doliner <mark@kingant.net>
parents: 10955
diff changeset
2225 if (i < max - 1)
90d22e1b68df [gaim-migrate @ 12759]
Mark Doliner <mark@kingant.net>
parents: 10955
diff changeset
2226 g_strlcat(tmp, ", ", sizeof(tmp));
90d22e1b68df [gaim-migrate @ 12759]
Mark Doliner <mark@kingant.net>
parents: 10955
diff changeset
2227 }
6407
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2228 }
8998
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2229
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2230 if (size > 10)
10324
1034e77ff0ce [gaim-migrate @ 11531]
Mark Doliner <mark@kingant.net>
parents: 10247
diff changeset
2231 /*
1034e77ff0ce [gaim-migrate @ 11531]
Mark Doliner <mark@kingant.net>
parents: 10247
diff changeset
2232 * This should probably use ngettext(), but this function
1034e77ff0ce [gaim-migrate @ 11531]
Mark Doliner <mark@kingant.net>
parents: 10247
diff changeset
2233 * isn't called from anywhere, so I'm going to leave it.
1034e77ff0ce [gaim-migrate @ 11531]
Mark Doliner <mark@kingant.net>
parents: 10247
diff changeset
2234 */
8998
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2235 g_snprintf(tmp, sizeof(tmp),
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2236 _("(+%d more)"), size - 10);
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2237
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2238 g_snprintf(tmp, sizeof(tmp), _(" left the room (%s)."), reason);
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2239
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2240 gaim_conversation_write(conv, NULL, tmp,
3738d1eac0ad [gaim-migrate @ 9773]
Luke Schierer <lschiere@pidgin.im>
parents: 8979
diff changeset
2241 GAIM_MESSAGE_SYSTEM, time(NULL));
6407
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2242 }
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2243 }
ba0b99a72be2 [gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents: 6405
diff changeset
2244
6414
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2245 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2246 gaim_conv_chat_clear_users(GaimConvChat *chat)
6414
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2247 {
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2248 GaimConversation *conv;
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2249 GaimConversationUiOps *ops;
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2250 GList *users, *names = NULL;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2251 GList *l;
6414
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2252
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2253 g_return_if_fail(chat != NULL);
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2254
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2255 conv = gaim_conv_chat_get_conversation(chat);
6414
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2256 ops = gaim_conversation_get_ui_ops(conv);
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2257 users = gaim_conv_chat_get_users(chat);
6414
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2258
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2259 if (ops != NULL && ops->chat_remove_users != NULL) {
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2260 for (l = users; l; l = l->next) {
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2261 GaimConvChatBuddy *cb = l->data;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2262 names = g_list_append(names, cb->name);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2263 }
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2264 ops->chat_remove_users(conv, names);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2265 g_list_free(names);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2266 }
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2267
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2268 for (l = users; l; l = l->next)
6414
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2269 {
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2270 GaimConvChatBuddy *cb = l->data;
6414
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2271
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2272 gaim_signal_emit(gaim_conversations_get_handle(),
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2273 "chat-buddy-leaving", conv, cb->name, NULL);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2274 gaim_signal_emit(gaim_conversations_get_handle(),
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2275 "chat-buddy-left", conv, cb->name, NULL);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2276
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2277 gaim_conv_chat_cb_destroy(cb);
6414
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2278 }
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2279
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2280 g_list_free(users);
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2281 gaim_conv_chat_set_users(chat, NULL);
6414
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2282 }
874a5c9f4eb8 [gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents: 6407
diff changeset
2283
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2284
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2285 gboolean
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2286 gaim_conv_chat_find_user(GaimConvChat *chat, const char *user)
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2287 {
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2288 g_return_val_if_fail(chat != NULL, FALSE);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2289 g_return_val_if_fail(user != NULL, FALSE);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2290
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2291 return (gaim_conv_chat_cb_find(chat, user) != NULL);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2292 }
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2293
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2294 void
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2295 gaim_conv_chat_user_set_flags(GaimConvChat *chat, const char *user,
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2296 GaimConvChatBuddyFlags flags)
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2297 {
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2298 GaimConversation *conv;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2299 GaimConversationUiOps *ops;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2300 GaimConvChatBuddy *cb;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2301 GaimConvChatBuddyFlags oldflags;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2302
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2303 g_return_if_fail(chat != NULL);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2304 g_return_if_fail(user != NULL);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2305
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2306 cb = gaim_conv_chat_cb_find(chat, user);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2307
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2308 if (!cb)
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2309 return;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2310
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2311 if (flags == cb->flags)
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2312 return;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2313
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2314 oldflags = cb->flags;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2315 cb->flags = flags;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2316
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2317 conv = gaim_conv_chat_get_conversation(chat);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2318 ops = gaim_conversation_get_ui_ops(conv);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2319
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2320 if (ops != NULL && ops->chat_update_user != NULL)
11500
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2321 ops->chat_update_user(conv, user);
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2322
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2323 gaim_signal_emit(gaim_conversations_get_handle(),
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2324 "chat-buddy-flags", conv, user, oldflags, flags);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2325 }
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2326
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2327 GaimConvChatBuddyFlags
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2328 gaim_conv_chat_user_get_flags(GaimConvChat *chat, const char *user)
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2329 {
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2330 GaimConvChatBuddy *cb;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2331
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2332 g_return_val_if_fail(chat != NULL, 0);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2333 g_return_val_if_fail(user != NULL, 0);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2334
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2335 cb = gaim_conv_chat_cb_find(chat, user);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2336
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2337 if (!cb)
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2338 return GAIM_CBFLAGS_NONE;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2339
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2340 return cb->flags;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2341 }
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2342
8158
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2343 void gaim_conv_chat_set_nick(GaimConvChat *chat, const char *nick) {
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2344 g_return_if_fail(chat != NULL);
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2345
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2346 if(chat->nick)
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2347 g_free(chat->nick);
11500
9fc7d0153332 [gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents: 11485
diff changeset
2348 chat->nick = g_strdup(gaim_normalize(chat->conv->account, nick));
8158
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2349 }
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2350
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2351 const char *gaim_conv_chat_get_nick(GaimConvChat *chat) {
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2352 g_return_val_if_fail(chat != NULL, NULL);
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2353
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2354 return chat->nick;
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2355 }
e283be34aadf [gaim-migrate @ 8870]
Nathan Walp <nwalp@pidgin.im>
parents: 8155
diff changeset
2356
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2357 GaimConversation *
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2358 gaim_find_chat(const GaimConnection *gc, int id)
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2359 {
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
2360 GList *l;
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2361 GaimConversation *conv;
2499
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2362
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
2363 for (l = gaim_get_chats(); l != NULL; l = l->next) {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2364 conv = (GaimConversation *)l->data;
2499
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2365
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2366 if (gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv)) == id &&
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
2367 gaim_conversation_get_gc(conv) == gc)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
2368 return conv;
2499
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2369 }
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2370
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
2371 return NULL;
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2372 }
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2373
8256
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2374 void
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2375 gaim_conv_chat_left(GaimConvChat *chat)
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2376 {
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2377 g_return_if_fail(chat != NULL);
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2378
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2379 chat->left = TRUE;
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2380 gaim_conversation_update(chat->conv, GAIM_CONV_UPDATE_CHATLEFT);
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2381 }
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2382
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2383 gboolean
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2384 gaim_conv_chat_has_left(GaimConvChat *chat)
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2385 {
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2386 g_return_val_if_fail(chat != NULL, TRUE);
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2387
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2388 return chat->left;
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2389 }
1d86096ae0f4 [gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents: 8158
diff changeset
2390
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2391 GaimConvChatBuddy *
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2392 gaim_conv_chat_cb_new(const char *name, GaimConvChatBuddyFlags flags)
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2393 {
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2394 GaimConvChatBuddy *cb;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2395
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2396 g_return_val_if_fail(name != NULL, NULL);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2397
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2398 cb = g_new0(GaimConvChatBuddy, 1);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2399 cb->name = g_strdup(name);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2400 cb->flags = flags;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2401
11146
1c5398ccbeb0 [gaim-migrate @ 13217]
Piotr Zielinski <zielaj>
parents: 11137
diff changeset
2402 GAIM_DBUS_REGISTER_POINTER(cb, GaimConvChatBuddy);
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2403 return cb;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2404 }
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2405
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2406 GaimConvChatBuddy *
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2407 gaim_conv_chat_cb_find(GaimConvChat *chat, const char *name)
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2408 {
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2409 GList *l;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2410 GaimConvChatBuddy *cb = NULL;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2411
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2412 g_return_val_if_fail(chat != NULL, NULL);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2413 g_return_val_if_fail(name != NULL, NULL);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2414
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2415 for (l = gaim_conv_chat_get_users(chat); l; l = l->next) {
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2416 cb = l->data;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2417 if (!gaim_utf8_strcasecmp(cb->name, name))
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2418 return cb;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2419 }
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2420
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2421 return NULL;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2422 }
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2423
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2424 void
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2425 gaim_conv_chat_cb_destroy(GaimConvChatBuddy *cb)
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2426 {
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2427 g_return_if_fail(cb != NULL);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2428
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2429 if (cb->name)
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2430 g_free(cb->name);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2431 cb->name = NULL;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2432 cb->flags = 0;
11146
1c5398ccbeb0 [gaim-migrate @ 13217]
Piotr Zielinski <zielaj>
parents: 11137
diff changeset
2433
1c5398ccbeb0 [gaim-migrate @ 13217]
Piotr Zielinski <zielaj>
parents: 11137
diff changeset
2434 GAIM_DBUS_UNREGISTER_POINTER(cb);
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2435 g_free(cb);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2436 }
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2437
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2438 const char *
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2439 gaim_conv_chat_cb_get_name(GaimConvChatBuddy *cb)
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2440 {
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2441 g_return_val_if_fail(cb != NULL, NULL);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2442
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2443 return cb->name;
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2444 }
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2445
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2446 /**************************************************************************
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2447 * Conversation placement functions
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2448 **************************************************************************/
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2449 /* This one places conversations in the last made window. */
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2450 static void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2451 conv_placement_last_created_win(GaimConversation *conv)
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2452 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2453 GaimConvWindow *win;
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2454
9251
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2455 win = g_list_last(gaim_get_windows())->data;
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2456
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2457 if (win == NULL) {
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2458 win = gaim_conv_window_new();
9614
c35c6b56a35f [gaim-migrate @ 10458]
Luke Schierer <lschiere@pidgin.im>
parents: 9613
diff changeset
2459
c35c6b56a35f [gaim-migrate @ 10458]
Luke Schierer <lschiere@pidgin.im>
parents: 9613
diff changeset
2460 gaim_conv_window_add_conversation(win, conv);
9606
03be9d653123 [gaim-migrate @ 10449]
Luke Schierer <lschiere@pidgin.im>
parents: 9587
diff changeset
2461 gaim_conv_window_show(win);
9251
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2462 }
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2463 else
9251
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2464 gaim_conv_window_add_conversation(win, conv);
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2465 }
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2466
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2467 /* This one places conversations in the last made window of the same type. */
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2468 static void
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2469 conv_placement_last_created_win_type(GaimConversation *conv)
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2470 {
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2471 GaimConvWindow *win;
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2472
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2473 win = gaim_get_last_window_with_type(gaim_conversation_get_type(conv));
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2474
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2475 if (win == NULL) {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2476 win = gaim_conv_window_new();
9614
c35c6b56a35f [gaim-migrate @ 10458]
Luke Schierer <lschiere@pidgin.im>
parents: 9613
diff changeset
2477
c35c6b56a35f [gaim-migrate @ 10458]
Luke Schierer <lschiere@pidgin.im>
parents: 9613
diff changeset
2478 gaim_conv_window_add_conversation(win, conv);
9606
03be9d653123 [gaim-migrate @ 10449]
Luke Schierer <lschiere@pidgin.im>
parents: 9587
diff changeset
2479 gaim_conv_window_show(win);
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2480 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2481 else
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2482 gaim_conv_window_add_conversation(win, conv);
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2483 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2484
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2485 /* This one places each conversation in its own window. */
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2486 static void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2487 conv_placement_new_window(GaimConversation *conv)
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2488 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2489 GaimConvWindow *win;
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2490
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2491 win = gaim_conv_window_new();
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2492
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2493 gaim_conv_window_add_conversation(win, conv);
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2494
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2495 gaim_conv_window_show(win);
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2496 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2497
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2498 static GaimGroup *
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2499 conv_get_group(GaimConversation *conv)
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2500 {
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2501 GaimGroup *group = NULL;
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2502
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
2503 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM)
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2504 {
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2505 GaimBuddy *buddy;
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2506
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2507 buddy = gaim_find_buddy(gaim_conversation_get_account(conv),
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2508 gaim_conversation_get_name(conv));
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2509
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2510 if (buddy != NULL)
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2511 group = gaim_find_buddys_group(buddy);
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2512
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2513 }
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 11292
diff changeset
2514 else if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT)
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2515 {
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2516 GaimChat *chat;
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2517
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2518 chat = gaim_blist_find_chat(gaim_conversation_get_account(conv),
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2519 gaim_conversation_get_name(conv));
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2520
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2521 if (chat != NULL)
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2522 group = gaim_chat_get_group(chat);
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2523 }
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2524
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2525 return group;
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2526 }
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2527
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2528 /*
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2529 * This groups things by, well, group. Buddies from groups will always be
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2530 * grouped together, and a buddy from a group not belonging to any currently
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2531 * open windows will get a new window.
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2532 */
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2533 static void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2534 conv_placement_by_group(GaimConversation *conv)
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2535 {
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2536 GaimConversationType type;
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2537 GaimGroup *group = NULL;
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2538 GList *wl, *cl;
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2539
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2540 type = gaim_conversation_get_type(conv);
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2541
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2542 group = conv_get_group(conv);
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2543
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2544 /* Go through the list of IMs and find one with this group. */
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2545 for (wl = gaim_get_windows(); wl != NULL; wl = wl->next)
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2546 {
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2547 GaimConvWindow *win2;
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2548 GaimConversation *conv2;
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2549 GaimGroup *group2 = NULL;
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2550
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2551 win2 = (GaimConvWindow *)wl->data;
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2552
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2553 for (cl = gaim_conv_window_get_conversations(win2);
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2554 cl != NULL;
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2555 cl = cl->next)
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2556 {
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2557 conv2 = (GaimConversation *)cl->data;
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2558
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2559 group2 = conv_get_group(conv2);
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2560
9150
05532ad61ed5 [gaim-migrate @ 9934]
Luke Schierer <lschiere@pidgin.im>
parents: 9123
diff changeset
2561 if (group == group2)
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2562 {
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2563 gaim_conv_window_add_conversation(win2, conv);
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2564
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2565 return;
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2566 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2567 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2568 }
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2569
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2570 /* Make a new window. */
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2571 conv_placement_new_window(conv);
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2572 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2573
4522
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2574 /* This groups things by account. Otherwise, the same semantics as above */
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2575 static void
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2576 conv_placement_by_account(GaimConversation *conv)
4522
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2577 {
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2578 GaimConversationType type;
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2579 GList *wins, *convs;
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5545
diff changeset
2580 GaimAccount *account;
4522
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2581
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2582 account = gaim_conversation_get_account(conv);
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2583 type = gaim_conversation_get_type(conv);
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2584
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2585 /* Go through the list of IMs and find one with this group. */
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2586 for (wins = gaim_get_windows(); wins != NULL; wins = wins->next)
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2587 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2588 GaimConvWindow *win2;
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2589 GaimConversation *conv2;
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2590
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2591 win2 = (GaimConvWindow *)wins->data;
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2592
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2593 for (convs = gaim_conv_window_get_conversations(win2);
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2594 convs != NULL;
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2595 convs = convs->next)
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2596 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2597 conv2 = (GaimConversation *)convs->data;
4522
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2598
9150
05532ad61ed5 [gaim-migrate @ 9934]
Luke Schierer <lschiere@pidgin.im>
parents: 9123
diff changeset
2599 if (account == gaim_conversation_get_account(conv2))
8271
5c9cd9c97727 [gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents: 8256
diff changeset
2600 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2601 gaim_conv_window_add_conversation(win2, conv);
4522
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2602 return;
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2603 }
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2604 }
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2605 }
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5539
diff changeset
2606
4522
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2607 /* Make a new window. */
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2608 conv_placement_new_window(conv);
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2609 }
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2610
7602
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
2611 static ConvPlacementData *
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
2612 get_conv_placement_data(const char *id)
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2613 {
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2614 ConvPlacementData *data = NULL;
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2615 GList *n;
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2616
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2617 for(n = conv_placement_fncs; n; n = n->next) {
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2618 data = n->data;
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2619 if(!strcmp(data->id, id))
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2620 return data;
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2621 }
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2622
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2623 return NULL;
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2624 }
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2625
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2626 static void
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2627 add_conv_placement_fnc(const char *id, const char *name,
7602
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
2628 GaimConvPlacementFunc fnc)
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2629 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2630 ConvPlacementData *data;
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2631
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2632 data = g_new(ConvPlacementData, 1);
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2633
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2634 data->id = g_strdup(id);
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2635 data->name = g_strdup(name);
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2636 data->fnc = fnc;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2637
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2638 conv_placement_fncs = g_list_append(conv_placement_fncs, data);
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2639 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2640
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2641 static void
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2642 ensure_default_funcs(void)
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2643 {
7602
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
2644 if (conv_placement_fncs == NULL)
df5b0937ea47 [gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents: 7562
diff changeset
2645 {
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2646 add_conv_placement_fnc("last", _("Last created window"),
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2647 conv_placement_last_created_win);
9251
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2648 add_conv_placement_fnc("im_chat", _("Separate IM and Chat windows"),
45d2ad4ac1c1 [gaim-migrate @ 10050]
Ethan Blanton <elb@pidgin.im>
parents: 9166
diff changeset
2649 conv_placement_last_created_win_type);
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2650 add_conv_placement_fnc("new", _("New window"),
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2651 conv_placement_new_window);
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2652 add_conv_placement_fnc("group", _("By group"),
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2653 conv_placement_by_group);
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2654 add_conv_placement_fnc("account", _("By account"),
4522
0738264a52ad [gaim-migrate @ 4800]
Nathan Walp <nwalp@pidgin.im>
parents: 4506
diff changeset
2655 conv_placement_by_account);
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2656 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2657 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2658
6312
5e5959d7a85e [gaim-migrate @ 6811]
Christian Hammond <chipx86@chipx86.com>
parents: 6060
diff changeset
2659 GList *
5e5959d7a85e [gaim-migrate @ 6811]
Christian Hammond <chipx86@chipx86.com>
parents: 6060
diff changeset
2660 gaim_conv_placement_get_options(void)
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2661 {
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2662 GList *n, *list = NULL;
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2663 ConvPlacementData *data;
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2664
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2665 ensure_default_funcs();
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2666
6312
5e5959d7a85e [gaim-migrate @ 6811]
Christian Hammond <chipx86@chipx86.com>
parents: 6060
diff changeset
2667 for (n = conv_placement_fncs; n; n = n->next) {
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2668 data = n->data;
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2669 list = g_list_append(list, data->name);
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2670 list = g_list_append(list, data->id);
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2671 }
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2672
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2673 return list;
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2674 }
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2675
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2676
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2677 void
6312
5e5959d7a85e [gaim-migrate @ 6811]
Christian Hammond <chipx86@chipx86.com>
parents: 6060
diff changeset
2678 gaim_conv_placement_add_fnc(const char *id, const char *name,
5e5959d7a85e [gaim-migrate @ 6811]
Christian Hammond <chipx86@chipx86.com>
parents: 6060
diff changeset
2679 GaimConvPlacementFunc fnc)
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2680 {
6312
5e5959d7a85e [gaim-migrate @ 6811]
Christian Hammond <chipx86@chipx86.com>
parents: 6060
diff changeset
2681 g_return_if_fail(id != NULL);
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2682 g_return_if_fail(name != NULL);
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2683 g_return_if_fail(fnc != NULL);
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2684
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2685 ensure_default_funcs();
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2686
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2687 add_conv_placement_fnc(id, name, fnc);
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2688 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2689
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2690 void
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2691 gaim_conv_placement_remove_fnc(const char *id)
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2692 {
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2693 ConvPlacementData *data = get_conv_placement_data(id);
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2694
6312
5e5959d7a85e [gaim-migrate @ 6811]
Christian Hammond <chipx86@chipx86.com>
parents: 6060
diff changeset
2695 if (data == NULL)
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2696 return;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2697
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2698 conv_placement_fncs = g_list_remove(conv_placement_fncs, data);
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2699
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2700 g_free(data->id);
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2701 g_free(data->name);
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2702 g_free(data);
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2703 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2704
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2705 const char *
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2706 gaim_conv_placement_get_name(const char *id)
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2707 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2708 ConvPlacementData *data;
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2709
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2710 ensure_default_funcs();
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2711
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2712 data = get_conv_placement_data(id);
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2713
6312
5e5959d7a85e [gaim-migrate @ 6811]
Christian Hammond <chipx86@chipx86.com>
parents: 6060
diff changeset
2714 if (data == NULL)
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2715 return NULL;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2716
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2717 return data->name;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2718 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2719
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2720 GaimConvPlacementFunc
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2721 gaim_conv_placement_get_fnc(const char *id)
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2722 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5621
diff changeset
2723 ConvPlacementData *data;
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2724
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2725 ensure_default_funcs();
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2726
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2727 data = get_conv_placement_data(id);
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2728
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2729 if (data == NULL)
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2730 return NULL;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2731
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2732 return data->fnc;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2733 }
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2734
7561
cdfdbabd3266 [gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents: 7553
diff changeset
2735 void
cdfdbabd3266 [gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents: 7553
diff changeset
2736 gaim_conv_placement_set_current_func(GaimConvPlacementFunc func)
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2737 {
7561
cdfdbabd3266 [gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents: 7553
diff changeset
2738 g_return_if_fail(func != NULL);
cdfdbabd3266 [gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents: 7553
diff changeset
2739
cdfdbabd3266 [gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents: 7553
diff changeset
2740 place_conv = func;
cdfdbabd3266 [gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents: 7553
diff changeset
2741 }
cdfdbabd3266 [gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents: 7553
diff changeset
2742
cdfdbabd3266 [gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents: 7553
diff changeset
2743 GaimConvPlacementFunc
cdfdbabd3266 [gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents: 7553
diff changeset
2744 gaim_conv_placement_get_current_func(void)
cdfdbabd3266 [gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents: 7553
diff changeset
2745 {
cdfdbabd3266 [gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents: 7553
diff changeset
2746 return place_conv;
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4467
diff changeset
2747 }
4481
b30b0a02ada0 [gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents: 4478
diff changeset
2748
b30b0a02ada0 [gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents: 4478
diff changeset
2749 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2750 gaim_conversations_set_win_ui_ops(GaimConvWindowUiOps *ops)
4481
b30b0a02ada0 [gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents: 4478
diff changeset
2751 {
b30b0a02ada0 [gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents: 4478
diff changeset
2752 win_ui_ops = ops;
b30b0a02ada0 [gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents: 4478
diff changeset
2753 }
b30b0a02ada0 [gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents: 4478
diff changeset
2754
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
2755 GaimConvWindowUiOps *
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
2756 gaim_conversations_get_win_ui_ops(void)
4481
b30b0a02ada0 [gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents: 4478
diff changeset
2757 {
b30b0a02ada0 [gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents: 4478
diff changeset
2758 return win_ui_ops;
b30b0a02ada0 [gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents: 4478
diff changeset
2759 }
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2760
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2761 void *
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2762 gaim_conversations_get_handle(void)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2763 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2764 static int handle;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2765
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2766 return &handle;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2767 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2768
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2769 void
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2770 gaim_conversations_init(void)
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2771 {
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2772 void *handle = gaim_conversations_get_handle();
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2773
6846
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
2774 /**********************************************************************
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
2775 * Register preferences
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
2776 **********************************************************************/
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2777
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2778 /* Conversations */
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2779 gaim_prefs_add_none("/core/conversations");
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2780
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2781 /* Conversations -> Chat */
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2782 gaim_prefs_add_none("/core/conversations/chat");
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2783 gaim_prefs_add_bool("/core/conversations/chat/show_nick_change", TRUE);
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2784
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2785 /* Conversations -> IM */
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2786 gaim_prefs_add_none("/core/conversations/im");
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2787 gaim_prefs_add_bool("/core/conversations/im/send_typing", TRUE);
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
2788
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2789
6846
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
2790 /**********************************************************************
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
2791 * Register signals
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents: 6837
diff changeset
2792 **********************************************************************/
8078
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2793 gaim_signal_register(handle, "writing-im-msg",
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2794 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2795 gaim_value_new(GAIM_TYPE_BOOLEAN), 3,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2796 gaim_value_new(GAIM_TYPE_SUBTYPE,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2797 GAIM_SUBTYPE_ACCOUNT),
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2798 gaim_value_new(GAIM_TYPE_SUBTYPE,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2799 GAIM_SUBTYPE_CONVERSATION),
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2800 gaim_value_new_outgoing(GAIM_TYPE_STRING));
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2801
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2802 gaim_signal_register(handle, "wrote-im-msg",
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2803 gaim_marshal_VOID__POINTER_POINTER_POINTER,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2804 NULL, 3,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2805 gaim_value_new(GAIM_TYPE_SUBTYPE,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2806 GAIM_SUBTYPE_ACCOUNT),
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2807 gaim_value_new(GAIM_TYPE_SUBTYPE,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2808 GAIM_SUBTYPE_CONVERSATION),
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2809 gaim_value_new(GAIM_TYPE_STRING));
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2810
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2811 gaim_signal_register(handle, "displaying-im-msg",
6780
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2812 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER,
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2813 gaim_value_new(GAIM_TYPE_BOOLEAN), 3,
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2814 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2815 GAIM_SUBTYPE_ACCOUNT),
6780
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2816 gaim_value_new(GAIM_TYPE_SUBTYPE,
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2817 GAIM_SUBTYPE_CONVERSATION),
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2818 gaim_value_new_outgoing(GAIM_TYPE_STRING));
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2819
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2820 gaim_signal_register(handle, "displayed-im-msg",
6780
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2821 gaim_marshal_VOID__POINTER_POINTER_POINTER,
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2822 NULL, 3,
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2823 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2824 GAIM_SUBTYPE_ACCOUNT),
6780
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2825 gaim_value_new(GAIM_TYPE_SUBTYPE,
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2826 GAIM_SUBTYPE_CONVERSATION),
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2827 gaim_value_new(GAIM_TYPE_STRING));
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2828
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2829 gaim_signal_register(handle, "sending-im-msg",
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2830 gaim_marshal_VOID__POINTER_POINTER_POINTER,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2831 NULL, 3,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2832 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2833 GAIM_SUBTYPE_ACCOUNT),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2834 gaim_value_new(GAIM_TYPE_STRING),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2835 gaim_value_new_outgoing(GAIM_TYPE_STRING));
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2836
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2837 gaim_signal_register(handle, "sent-im-msg",
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2838 gaim_marshal_VOID__POINTER_POINTER_POINTER,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2839 NULL, 3,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2840 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2841 GAIM_SUBTYPE_ACCOUNT),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2842 gaim_value_new(GAIM_TYPE_STRING),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2843 gaim_value_new(GAIM_TYPE_STRING));
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2844
8999
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2845 gaim_signal_register(handle, "receiving-im-msg",
10104
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2846 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER,
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2847 gaim_value_new(GAIM_TYPE_BOOLEAN), 5,
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2848 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2849 GAIM_SUBTYPE_ACCOUNT),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2850 gaim_value_new_outgoing(GAIM_TYPE_STRING),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2851 gaim_value_new_outgoing(GAIM_TYPE_STRING),
10104
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2852 gaim_value_new(GAIM_TYPE_SUBTYPE,
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2853 GAIM_SUBTYPE_CONVERSATION),
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2854 gaim_value_new_outgoing(GAIM_TYPE_UINT));
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2855
8999
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2856 gaim_signal_register(handle, "received-im-msg",
10104
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2857 gaim_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT,
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2858 NULL, 5,
8999
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2859 gaim_value_new(GAIM_TYPE_SUBTYPE,
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2860 GAIM_SUBTYPE_ACCOUNT),
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2861 gaim_value_new(GAIM_TYPE_STRING),
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2862 gaim_value_new(GAIM_TYPE_STRING),
10104
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2863 gaim_value_new(GAIM_TYPE_SUBTYPE,
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2864 GAIM_SUBTYPE_CONVERSATION),
8999
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2865 gaim_value_new(GAIM_TYPE_UINT));
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2866
8078
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2867 gaim_signal_register(handle, "writing-chat-msg",
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2868 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2869 gaim_value_new(GAIM_TYPE_BOOLEAN), 3,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2870 gaim_value_new(GAIM_TYPE_SUBTYPE,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2871 GAIM_SUBTYPE_ACCOUNT),
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2872 gaim_value_new(GAIM_TYPE_SUBTYPE,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2873 GAIM_SUBTYPE_CONVERSATION),
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2874 gaim_value_new_outgoing(GAIM_TYPE_STRING));
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2875
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2876 gaim_signal_register(handle, "wrote-chat-msg",
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2877 gaim_marshal_VOID__POINTER_POINTER_POINTER,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2878 NULL, 3,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2879 gaim_value_new(GAIM_TYPE_SUBTYPE,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2880 GAIM_SUBTYPE_ACCOUNT),
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2881 gaim_value_new(GAIM_TYPE_SUBTYPE,
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2882 GAIM_SUBTYPE_CONVERSATION),
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2883 gaim_value_new(GAIM_TYPE_STRING));
ab0750ac5154 [gaim-migrate @ 8777]
Mark Doliner <mark@kingant.net>
parents: 8076
diff changeset
2884
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2885 gaim_signal_register(handle, "displaying-chat-msg",
6780
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2886 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER,
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2887 gaim_value_new(GAIM_TYPE_BOOLEAN), 3,
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2888 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2889 GAIM_SUBTYPE_ACCOUNT),
6780
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2890 gaim_value_new(GAIM_TYPE_SUBTYPE,
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2891 GAIM_SUBTYPE_CONVERSATION),
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2892 gaim_value_new_outgoing(GAIM_TYPE_STRING));
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2893
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2894 gaim_signal_register(handle, "displayed-chat-msg",
6780
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2895 gaim_marshal_VOID__POINTER_POINTER_POINTER,
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2896 NULL, 3,
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2897 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2898 GAIM_SUBTYPE_ACCOUNT),
6780
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2899 gaim_value_new(GAIM_TYPE_SUBTYPE,
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
2900 GAIM_SUBTYPE_CONVERSATION),
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2901 gaim_value_new(GAIM_TYPE_STRING));
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2902
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2903 gaim_signal_register(handle, "sending-chat-msg",
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2904 gaim_marshal_VOID__POINTER_POINTER_UINT, NULL, 3,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2905 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2906 GAIM_SUBTYPE_ACCOUNT),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2907 gaim_value_new_outgoing(GAIM_TYPE_STRING),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2908 gaim_value_new(GAIM_TYPE_UINT));
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2909
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2910 gaim_signal_register(handle, "sent-chat-msg",
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2911 gaim_marshal_VOID__POINTER_POINTER_UINT, NULL, 3,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2912 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2913 GAIM_SUBTYPE_ACCOUNT),
6607
d8fd7c29eaf0 [gaim-migrate @ 7131]
Christian Hammond <chipx86@chipx86.com>
parents: 6605
diff changeset
2914 gaim_value_new(GAIM_TYPE_STRING),
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2915 gaim_value_new(GAIM_TYPE_UINT));
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2916
8999
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2917 gaim_signal_register(handle, "receiving-chat-msg",
10104
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2918 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER,
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2919 gaim_value_new(GAIM_TYPE_BOOLEAN), 5,
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2920 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2921 GAIM_SUBTYPE_ACCOUNT),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2922 gaim_value_new_outgoing(GAIM_TYPE_STRING),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2923 gaim_value_new_outgoing(GAIM_TYPE_STRING),
7511
a899742289c2 [gaim-migrate @ 8124]
Christian Hammond <chipx86@chipx86.com>
parents: 7431
diff changeset
2924 gaim_value_new(GAIM_TYPE_SUBTYPE,
10104
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2925 GAIM_SUBTYPE_CONVERSATION),
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2926 gaim_value_new_outgoing(GAIM_TYPE_UINT));
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2927
8999
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2928 gaim_signal_register(handle, "received-chat-msg",
10104
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2929 gaim_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT,
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2930 NULL, 5,
8999
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2931 gaim_value_new(GAIM_TYPE_SUBTYPE,
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2932 GAIM_SUBTYPE_ACCOUNT),
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2933 gaim_value_new(GAIM_TYPE_STRING),
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2934 gaim_value_new(GAIM_TYPE_STRING),
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2935 gaim_value_new(GAIM_TYPE_SUBTYPE,
10104
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2936 GAIM_SUBTYPE_CONVERSATION),
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10087
diff changeset
2937 gaim_value_new(GAIM_TYPE_UINT));
8999
8f838ae3e710 [gaim-migrate @ 9774]
Luke Schierer <lschiere@pidgin.im>
parents: 8998
diff changeset
2938
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2939 gaim_signal_register(handle, "conversation-switching",
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2940 gaim_marshal_VOID__POINTER_POINTER, NULL, 2,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2941 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2942 GAIM_SUBTYPE_CONVERSATION),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2943 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2944 GAIM_SUBTYPE_CONVERSATION));
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2945
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2946 gaim_signal_register(handle, "conversation-switched",
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2947 gaim_marshal_VOID__POINTER_POINTER, NULL, 2,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2948 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2949 GAIM_SUBTYPE_CONVERSATION),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2950 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2951 GAIM_SUBTYPE_CONVERSATION));
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2952
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2953 gaim_signal_register(handle, "conversation-created",
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2954 gaim_marshal_VOID__POINTER, NULL, 1,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2955 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2956 GAIM_SUBTYPE_CONVERSATION));
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2957
9734
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9633
diff changeset
2958 gaim_signal_register(handle, "conversation-updated",
9909
ebca3bbc6719 [gaim-migrate @ 10801]
Luke Schierer <lschiere@pidgin.im>
parents: 9846
diff changeset
2959 gaim_marshal_VOID__POINTER_UINT, NULL, 2,
9734
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9633
diff changeset
2960 gaim_value_new(GAIM_TYPE_SUBTYPE,
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9633
diff changeset
2961 GAIM_SUBTYPE_CONVERSATION),
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9633
diff changeset
2962 gaim_value_new(GAIM_TYPE_UINT));
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9633
diff changeset
2963
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2964 gaim_signal_register(handle, "deleting-conversation",
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2965 gaim_marshal_VOID__POINTER, NULL, 1,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2966 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2967 GAIM_SUBTYPE_CONVERSATION));
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2968
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2969 gaim_signal_register(handle, "buddy-typing",
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2970 gaim_marshal_VOID__POINTER, NULL, 1,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2971 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2972 GAIM_SUBTYPE_CONVERSATION));
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2973
6837
f098765ac919 [gaim-migrate @ 7382]
Christian Hammond <chipx86@chipx86.com>
parents: 6787
diff changeset
2974 gaim_signal_register(handle, "buddy-typing-stopped",
f098765ac919 [gaim-migrate @ 7382]
Christian Hammond <chipx86@chipx86.com>
parents: 6787
diff changeset
2975 gaim_marshal_VOID__POINTER, NULL, 1,
f098765ac919 [gaim-migrate @ 7382]
Christian Hammond <chipx86@chipx86.com>
parents: 6787
diff changeset
2976 gaim_value_new(GAIM_TYPE_SUBTYPE,
f098765ac919 [gaim-migrate @ 7382]
Christian Hammond <chipx86@chipx86.com>
parents: 6787
diff changeset
2977 GAIM_SUBTYPE_CONVERSATION));
f098765ac919 [gaim-migrate @ 7382]
Christian Hammond <chipx86@chipx86.com>
parents: 6787
diff changeset
2978
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
2979 gaim_signal_register(handle, "chat-buddy-joining",
9587
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
2980 gaim_marshal_BOOLEAN__POINTER_POINTER_UINT,
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
2981 gaim_value_new(GAIM_TYPE_BOOLEAN), 3,
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2982 gaim_value_new(GAIM_TYPE_SUBTYPE,
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2983 GAIM_SUBTYPE_CONVERSATION),
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2984 gaim_value_new(GAIM_TYPE_STRING),
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2985 gaim_value_new(GAIM_TYPE_UINT));
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2986
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2987 gaim_signal_register(handle, "chat-buddy-joined",
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2988 gaim_marshal_VOID__POINTER_POINTER_UINT, NULL, 3,
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2989 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2990 GAIM_SUBTYPE_CONVERSATION),
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2991 gaim_value_new(GAIM_TYPE_STRING),
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2992 gaim_value_new(GAIM_TYPE_UINT));
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2993
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2994 gaim_signal_register(handle, "chat-buddy-flags",
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2995 gaim_marshal_VOID__POINTER_POINTER_UINT_UINT, NULL, 4,
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2996 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
2997 GAIM_SUBTYPE_CONVERSATION),
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2998 gaim_value_new(GAIM_TYPE_STRING),
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
2999 gaim_value_new(GAIM_TYPE_UINT),
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9528
diff changeset
3000 gaim_value_new(GAIM_TYPE_UINT));
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3001
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3002 gaim_signal_register(handle, "chat-buddy-leaving",
9587
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
3003 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER,
5e1c76f3d232 [gaim-migrate @ 10430]
Luke Schierer <lschiere@pidgin.im>
parents: 9554
diff changeset
3004 gaim_value_new(GAIM_TYPE_BOOLEAN), 3,
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3005 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3006 GAIM_SUBTYPE_CONVERSATION),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3007 gaim_value_new(GAIM_TYPE_STRING),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3008 gaim_value_new(GAIM_TYPE_STRING));
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3009
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3010 gaim_signal_register(handle, "chat-buddy-left",
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3011 gaim_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3012 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3013 GAIM_SUBTYPE_CONVERSATION),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3014 gaim_value_new(GAIM_TYPE_STRING),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3015 gaim_value_new(GAIM_TYPE_STRING));
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3016
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3017 gaim_signal_register(handle, "chat-inviting-user",
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3018 gaim_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3019 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3020 GAIM_SUBTYPE_CONVERSATION),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3021 gaim_value_new(GAIM_TYPE_STRING),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3022 gaim_value_new_outgoing(GAIM_TYPE_STRING));
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3023
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3024 gaim_signal_register(handle, "chat-invited-user",
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3025 gaim_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3026 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3027 GAIM_SUBTYPE_CONVERSATION),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3028 gaim_value_new(GAIM_TYPE_STRING),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3029 gaim_value_new(GAIM_TYPE_STRING));
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3030
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3031 gaim_signal_register(handle, "chat-invited",
11064
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11048
diff changeset
3032 gaim_marshal_INT__POINTER_POINTER_POINTER_POINTER_POINTER,
9514
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9375
diff changeset
3033 NULL, 5,
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3034 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3035 GAIM_SUBTYPE_ACCOUNT),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3036 gaim_value_new(GAIM_TYPE_STRING),
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3037 gaim_value_new(GAIM_TYPE_STRING),
9514
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9375
diff changeset
3038 gaim_value_new(GAIM_TYPE_STRING),
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9375
diff changeset
3039 gaim_value_new(GAIM_TYPE_POINTER));
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3040
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3041 gaim_signal_register(handle, "chat-joined",
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3042 gaim_marshal_VOID__POINTER, NULL, 1,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3043 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3044 GAIM_SUBTYPE_CONVERSATION));
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3045
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3046 gaim_signal_register(handle, "chat-left",
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3047 gaim_marshal_VOID__POINTER, NULL, 1,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3048 gaim_value_new(GAIM_TYPE_SUBTYPE,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
3049 GAIM_SUBTYPE_CONVERSATION));
9517
0524b36c701a [gaim-migrate @ 10344]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
3050
0524b36c701a [gaim-migrate @ 10344]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
3051 gaim_signal_register(handle, "chat-topic-changed",
9528
7ca073ddf9b0 [gaim-migrate @ 10355]
Luke Schierer <lschiere@pidgin.im>
parents: 9517
diff changeset
3052 gaim_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
9517
0524b36c701a [gaim-migrate @ 10344]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
3053 gaim_value_new(GAIM_TYPE_SUBTYPE,
0524b36c701a [gaim-migrate @ 10344]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
3054 GAIM_SUBTYPE_CONVERSATION),
0524b36c701a [gaim-migrate @ 10344]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
3055 gaim_value_new(GAIM_TYPE_STRING),
0524b36c701a [gaim-migrate @ 10344]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
3056 gaim_value_new(GAIM_TYPE_STRING));
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
3057 }
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3058
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3059 void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3060 gaim_conversations_uninit(void)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3061 {
9909
ebca3bbc6719 [gaim-migrate @ 10801]
Luke Schierer <lschiere@pidgin.im>
parents: 9846
diff changeset
3062 while (conversations)
ebca3bbc6719 [gaim-migrate @ 10801]
Luke Schierer <lschiere@pidgin.im>
parents: 9846
diff changeset
3063 gaim_conversation_destroy((GaimConversation*)conversations->data);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3064 gaim_signals_unregister_by_instance(gaim_conversations_get_handle());
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
3065 }