Mercurial > pidgin
annotate src/conversation.c @ 13678:299536c4caf1
[gaim-migrate @ 16080]
Set the SIP/SIMPLE user-agent string to something more that I think makes more sense, and set wants_to_die in two places when disconnecting. This causes the account to be disable until the user re-enables it.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 22 Apr 2006 15:13:51 +0000 |
parents | b76c6de0c3b5 |
children | 43ebbe768a43 |
rev | line source |
---|---|
66 | 1 /* |
2 * gaim | |
3 * | |
8046 | 4 * Gaim is the legal property of its developers, whose names are too numerous |
5 * to list here. Please refer to the COPYRIGHT file distributed with this | |
6 * source distribution. | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
7 * |
66 | 8 * This program is free software; you can redistribute it and/or modify |
9 * it under the terms of the GNU General Public License as published by | |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program; if not, write to the Free Software | |
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
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 | 25 #include "dbus-maybe.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5860
diff
changeset
|
26 #include "debug.h" |
6982 | 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 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
34 #define SEND_TYPED_TIMEOUT 5000 |
4241 | 35 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
36 static GList *conversations = NULL; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
37 static GList *ims = NULL; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
38 static GList *chats = NULL; |
11581 | 39 static GaimConversationUiOps *default_ops = NULL; |
40 | |
41 | |
42 void | |
43 gaim_conversations_set_ui_ops(GaimConversationUiOps *ops) | |
44 { | |
45 default_ops = ops; | |
46 } | |
7602
df5b0937ea47
[gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents:
7562
diff
changeset
|
47 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
48 static gboolean |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
49 reset_typing(gpointer data) |
66 | 50 { |
6640
314111e7b601
[gaim-migrate @ 7165]
Christian Hammond <chipx86@chipx86.com>
parents:
6637
diff
changeset
|
51 GaimConversation *c = (GaimConversation *)data; |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
52 GaimConvIm *im; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
53 |
6640
314111e7b601
[gaim-migrate @ 7165]
Christian Hammond <chipx86@chipx86.com>
parents:
6637
diff
changeset
|
54 if (!g_list_find(conversations, c)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
55 return FALSE; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
56 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
57 im = GAIM_CONV_IM(c); |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
58 |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
59 gaim_conv_im_set_typing_state(im, GAIM_NOT_TYPING); |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
60 gaim_conv_im_update_typing(im); |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
61 gaim_conv_im_stop_typing_timeout(im); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
62 |
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 } |
3159 | 65 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
66 static gboolean |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
67 send_typed(gpointer data) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
68 { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
69 GaimConversation *conv = (GaimConversation *)data; |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
70 GaimConnection *gc; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
71 const char *name; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
72 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
73 gc = gaim_conversation_get_gc(conv); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
74 name = gaim_conversation_get_name(conv); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
75 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
76 if (conv != NULL && gc != NULL && name != NULL) { |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
77 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
|
78 |
6402
cc35d07a0dcc
[gaim-migrate @ 6907]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
79 serv_send_typing(gc, name, GAIM_TYPED); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
80 |
5213
1cf4eb75e3ee
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
81 gaim_debug(GAIM_DEBUG_MISC, "conversation", "typed...\n"); |
573
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
82 } |
66 | 83 |
2725
f3c094e78609
[gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2722
diff
changeset
|
84 return FALSE; |
66 | 85 } |
86 | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
87 static void |
11921 | 88 common_send(GaimConversation *conv, const char *message, GaimMessageFlags msgflags) |
3790 | 89 { |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
90 GaimConversationType type; |
10132 | 91 GaimAccount *account; |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
92 GaimConnection *gc; |
8076 | 93 char *displayed = NULL, *sent = NULL; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
94 int err = 0; |
3790 | 95 |
7947 | 96 if (strlen(message) == 0) |
97 return; | |
98 | |
10132 | 99 account = gaim_conversation_get_account(conv); |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
100 gc = gaim_conversation_get_gc(conv); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
101 |
10132 | 102 g_return_if_fail(account != NULL); |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
103 g_return_if_fail(gc != NULL); |
3731 | 104 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
105 type = gaim_conversation_get_type(conv); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
106 |
12901
129a83f22349
[gaim-migrate @ 15254]
Richard Laager <rlaager@wiktel.com>
parents:
12867
diff
changeset
|
107 /* Always linkfy the text for display */ |
129a83f22349
[gaim-migrate @ 15254]
Richard Laager <rlaager@wiktel.com>
parents:
12867
diff
changeset
|
108 displayed = gaim_markup_linkify(message); |
129a83f22349
[gaim-migrate @ 15254]
Richard Laager <rlaager@wiktel.com>
parents:
12867
diff
changeset
|
109 |
11921 | 110 if ((conv->features & GAIM_CONNECTION_HTML) && |
111 !(msgflags & GAIM_MESSAGE_RAW)) | |
112 { | |
12901
129a83f22349
[gaim-migrate @ 15254]
Richard Laager <rlaager@wiktel.com>
parents:
12867
diff
changeset
|
113 sent = g_strdup(displayed); |
11921 | 114 } |
5136 | 115 else |
12901
129a83f22349
[gaim-migrate @ 15254]
Richard Laager <rlaager@wiktel.com>
parents:
12867
diff
changeset
|
116 sent = g_strdup(message); |
5136 | 117 |
12216 | 118 msgflags |= GAIM_MESSAGE_SEND; |
119 | |
11338 | 120 if (type == GAIM_CONV_TYPE_IM) { |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
121 GaimConvIm *im = GAIM_CONV_IM(conv); |
2102
899c22dcee42
[gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2094
diff
changeset
|
122 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
123 gaim_signal_emit(gaim_conversations_get_handle(), "sending-im-msg", |
10132 | 124 account, |
8076 | 125 gaim_conversation_get_name(conv), &sent); |
126 | |
127 if (sent != NULL && sent[0] != '\0') { | |
12216 | 128 |
129 err = serv_send_im(gc, gaim_conversation_get_name(conv), | |
130 sent, msgflags); | |
6982 | 131 |
8078 | 132 if ((err > 0) && (displayed != NULL)) |
8076 | 133 gaim_conv_im_write(im, NULL, displayed, msgflags, time(NULL)); |
6982 | 134 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
135 gaim_signal_emit(gaim_conversations_get_handle(), "sent-im-msg", |
10132 | 136 account, |
8076 | 137 gaim_conversation_get_name(conv), sent); |
2102
899c22dcee42
[gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2094
diff
changeset
|
138 } |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
139 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
140 else { |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
141 gaim_signal_emit(gaim_conversations_get_handle(), "sending-chat-msg", |
10132 | 142 account, &sent, |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
143 gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv))); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
144 |
8076 | 145 if (sent != NULL && sent[0] != '\0') { |
12216 | 146 err = serv_chat_send(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv)), sent, msgflags); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
147 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
148 gaim_signal_emit(gaim_conversations_get_handle(), "sent-chat-msg", |
10132 | 149 account, sent, |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
150 gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv))); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
151 } |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
152 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
153 |
2123
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
154 if (err < 0) { |
10132 | 155 const char *who; |
13106
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12902
diff
changeset
|
156 const char *msg; |
10132 | 157 |
158 who = gaim_conversation_get_name(conv); | |
159 | |
5213
1cf4eb75e3ee
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
160 if (err == -E2BIG) { |
10132 | 161 msg = _("Unable to send message: The message is too large."); |
162 | |
163 if (!gaim_conv_present_error(who, account, msg)) { | |
13106
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12902
diff
changeset
|
164 char *msg2 = g_strdup_printf(_("Unable to send message to %s."), who); |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12902
diff
changeset
|
165 gaim_notify_error(gc, NULL, msg2, _("The message is too large.")); |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12902
diff
changeset
|
166 g_free(msg2); |
10132 | 167 } |
5213
1cf4eb75e3ee
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
168 } |
1cf4eb75e3ee
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
169 else if (err == -ENOTCONN) { |
1cf4eb75e3ee
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
170 gaim_debug(GAIM_DEBUG_ERROR, "conversation", |
1cf4eb75e3ee
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
171 "Not yet connected.\n"); |
1cf4eb75e3ee
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
172 } |
1cf4eb75e3ee
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
173 else { |
10132 | 174 msg = _("Unable to send message."); |
175 | |
176 if (!gaim_conv_present_error(who, account, msg)) { | |
13106
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12902
diff
changeset
|
177 char *msg2 = g_strdup_printf(_("Unable to send message to %s."), who); |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12902
diff
changeset
|
178 gaim_notify_error(gc, NULL, msg2, NULL); |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12902
diff
changeset
|
179 g_free(msg2); |
10132 | 180 } |
5213
1cf4eb75e3ee
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
181 } |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
182 } |
8076 | 183 |
184 g_free(displayed); | |
185 g_free(sent); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
186 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
187 |
11672
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
188 static void |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
189 open_log(GaimConversation *conv) |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
190 { |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
191 conv->logs = g_list_append(NULL, gaim_log_new(conv->type == GAIM_CONV_TYPE_CHAT ? GAIM_LOG_CHAT : |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
192 GAIM_LOG_IM, conv->name, conv->account, |
13119
fcde3faa1f57
[gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents:
13106
diff
changeset
|
193 conv, time(NULL), NULL)); |
11672
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
194 } |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
195 |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
196 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
197 /************************************************************************** |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
198 * Conversation API |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
199 **************************************************************************/ |
8256
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
200 static void |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
201 gaim_conversation_chat_cleanup_for_rejoin(GaimConversation *conv) |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
202 { |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
203 const char *disp; |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
204 GaimAccount *account; |
8373
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
205 GaimConnection *gc; |
8256
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
206 |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
207 account = gaim_conversation_get_account(conv); |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
208 |
11672
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
209 gaim_conversation_close_logs(conv); |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
210 open_log(conv); |
8373
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
211 |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
212 gc = gaim_account_get_connection(account); |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
213 |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
214 if ((disp = gaim_connection_get_display_name(gc)) != NULL) |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
215 gaim_conv_chat_set_nick(GAIM_CONV_CHAT(conv), disp); |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
216 else |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
217 { |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
218 gaim_conv_chat_set_nick(GAIM_CONV_CHAT(conv), |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
219 gaim_account_get_username(account)); |
8256
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
220 } |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
221 |
8373
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
222 gaim_conv_chat_clear_users(GAIM_CONV_CHAT(conv)); |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
223 gaim_conv_chat_set_topic(GAIM_CONV_CHAT(conv), NULL, NULL); |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
224 GAIM_CONV_CHAT(conv)->left = FALSE; |
8256
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
225 |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
226 gaim_conversation_update(conv, GAIM_CONV_UPDATE_CHATLEFT); |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
227 } |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
228 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
229 GaimConversation * |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
230 gaim_conversation_new(GaimConversationType type, GaimAccount *account, |
4476
62c1e5e656d0
[gaim-migrate @ 4751]
Christian Hammond <chipx86@chipx86.com>
parents:
4471
diff
changeset
|
231 const char *name) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
232 { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
233 GaimConversation *conv; |
10665 | 234 GaimConnection *gc; |
11581 | 235 GaimConversationUiOps *ops; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
236 |
11338 | 237 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
|
238 g_return_val_if_fail(account != NULL, NULL); |
7fd2fd7c6980
[gaim-migrate @ 7653]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
239 g_return_val_if_fail(name != NULL, NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
240 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
241 /* Check if this conversation already exists. */ |
10246 | 242 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
|
243 { |
11338 | 244 if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_CHAT || |
8271
5c9cd9c97727
[gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents:
8256
diff
changeset
|
245 gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv))) |
5c9cd9c97727
[gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents:
8256
diff
changeset
|
246 { |
11338 | 247 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) |
8256
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
248 gaim_conversation_chat_cleanup_for_rejoin(conv); |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
249 |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
250 return conv; |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
251 } |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
252 } |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
253 |
10665 | 254 gc = gaim_account_get_connection(account); |
255 g_return_val_if_fail(gc != NULL, NULL); | |
256 | |
6402
cc35d07a0dcc
[gaim-migrate @ 6907]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
257 conv = g_new0(GaimConversation, 1); |
11146 | 258 GAIM_DBUS_REGISTER_POINTER(conv, GaimConversation); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
259 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
260 conv->type = type; |
4491 | 261 conv->account = account; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
262 conv->name = g_strdup(name); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
263 conv->title = g_strdup(name); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
264 conv->send_history = g_list_append(NULL, NULL); |
5139
d0182ae31ab8
[gaim-migrate @ 5503]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
265 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
|
266 g_free, NULL); |
10665 | 267 /* copy features from the connection. */ |
268 conv->features = gc->flags; | |
11581 | 269 |
11338 | 270 if (type == GAIM_CONV_TYPE_IM) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
271 { |
9324 | 272 GaimBuddyIcon *icon; |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
273 conv->u.im = g_new0(GaimConvIm, 1); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
274 conv->u.im->conv = conv; |
11146 | 275 GAIM_DBUS_REGISTER_POINTER(conv->u.im, GaimConvIm); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
276 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
277 ims = g_list_append(ims, conv); |
9324 | 278 if ((icon = gaim_buddy_icons_find(account, name))) |
279 gaim_conv_im_set_icon(conv->u.im, icon); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
280 |
11672
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
281 if (gaim_prefs_get_bool("/core/logging/log_ims")) |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
282 { |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
283 gaim_conversation_set_logging(conv, TRUE); |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
284 open_log(conv); |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
285 } |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
286 } |
11338 | 287 else if (type == GAIM_CONV_TYPE_CHAT) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
288 { |
8158 | 289 const char *disp; |
290 | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
291 conv->u.chat = g_new0(GaimConvChat, 1); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
292 conv->u.chat->conv = conv; |
11146 | 293 GAIM_DBUS_REGISTER_POINTER(conv->u.chat, GaimConvChat); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
294 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
295 chats = g_list_append(chats, conv); |
8271
5c9cd9c97727
[gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents:
8256
diff
changeset
|
296 |
5c9cd9c97727
[gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents:
8256
diff
changeset
|
297 if ((disp = gaim_connection_get_display_name(account->gc))) |
8158 | 298 gaim_conv_chat_set_nick(conv->u.chat, disp); |
8271
5c9cd9c97727
[gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents:
8256
diff
changeset
|
299 else |
5c9cd9c97727
[gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents:
8256
diff
changeset
|
300 gaim_conv_chat_set_nick(conv->u.chat, |
5c9cd9c97727
[gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents:
8256
diff
changeset
|
301 gaim_account_get_username(account)); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
302 |
11672
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
303 if (gaim_prefs_get_bool("/core/logging/log_chats")) |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
304 { |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
305 gaim_conversation_set_logging(conv, TRUE); |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
306 open_log(conv); |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
307 } |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
308 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
309 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
310 conversations = g_list_append(conversations, conv); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
311 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
312 /* Auto-set the title. */ |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
313 gaim_conversation_autoset_title(conv); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
314 |
11602
24274a79d6b0
[gaim-migrate @ 13873]
Gary Kramlich <grim@reaperworld.com>
parents:
11598
diff
changeset
|
315 /* Don't move this.. it needs to be one of the last things done otherwise |
24274a79d6b0
[gaim-migrate @ 13873]
Gary Kramlich <grim@reaperworld.com>
parents:
11598
diff
changeset
|
316 * it causes mysterious crashes on my system. |
24274a79d6b0
[gaim-migrate @ 13873]
Gary Kramlich <grim@reaperworld.com>
parents:
11598
diff
changeset
|
317 * -- Gary |
24274a79d6b0
[gaim-migrate @ 13873]
Gary Kramlich <grim@reaperworld.com>
parents:
11598
diff
changeset
|
318 */ |
24274a79d6b0
[gaim-migrate @ 13873]
Gary Kramlich <grim@reaperworld.com>
parents:
11598
diff
changeset
|
319 ops = conv->ui_ops = default_ops; |
24274a79d6b0
[gaim-migrate @ 13873]
Gary Kramlich <grim@reaperworld.com>
parents:
11598
diff
changeset
|
320 if (ops != NULL && ops->create_conversation != NULL) |
24274a79d6b0
[gaim-migrate @ 13873]
Gary Kramlich <grim@reaperworld.com>
parents:
11598
diff
changeset
|
321 ops->create_conversation(conv); |
24274a79d6b0
[gaim-migrate @ 13873]
Gary Kramlich <grim@reaperworld.com>
parents:
11598
diff
changeset
|
322 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
323 gaim_signal_emit(gaim_conversations_get_handle(), |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
324 "conversation-created", conv); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
325 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
326 return conv; |
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 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
329 void |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
330 gaim_conversation_destroy(GaimConversation *conv) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
331 { |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5139
diff
changeset
|
332 GaimPluginProtocolInfo *prpl_info = NULL; |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
333 GaimConversationUiOps *ops; |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
334 GaimConnection *gc; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
335 const char *name; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
336 GList *node; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
337 |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
338 g_return_if_fail(conv != NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
339 |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
340 ops = gaim_conversation_get_ui_ops(conv); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
341 gc = gaim_conversation_get_gc(conv); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
342 name = gaim_conversation_get_name(conv); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
343 |
8373
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
344 if (gc != NULL) |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
345 { |
5262 | 346 /* Still connected */ |
347 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); | |
348 | |
11338 | 349 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) |
8373
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
350 { |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
351 if (gaim_prefs_get_bool("/core/conversations/im/send_typing")) |
6403
01963a303f43
[gaim-migrate @ 6908]
Christian Hammond <chipx86@chipx86.com>
parents:
6402
diff
changeset
|
352 serv_send_typing(gc, name, GAIM_NOT_TYPING); |
5262 | 353 |
354 if (gc && prpl_info->convo_closed != NULL) | |
6403
01963a303f43
[gaim-migrate @ 6908]
Christian Hammond <chipx86@chipx86.com>
parents:
6402
diff
changeset
|
355 prpl_info->convo_closed(gc, name); |
5262 | 356 } |
11338 | 357 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
|
358 { |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
359 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
|
360 #if 0 |
5262 | 361 /* |
6030
54c37db13279
[gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents:
6020
diff
changeset
|
362 * This is unfortunately necessary, because calling |
54c37db13279
[gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents:
6020
diff
changeset
|
363 * serv_chat_leave() calls this gaim_conversation_destroy(), |
54c37db13279
[gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents:
6020
diff
changeset
|
364 * 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
|
365 * 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
|
366 * serv_got_chat_left(), which is eventually called from the |
54c37db13279
[gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents:
6020
diff
changeset
|
367 * prpl that serv_chat_leave() calls, removes this conversation |
54c37db13279
[gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents:
6020
diff
changeset
|
368 * 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
|
369 * 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
|
370 * calling this, because it'll be called again. If not, fall |
54c37db13279
[gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents:
6020
diff
changeset
|
371 * through, because it'll have already been removed, and we'd |
5262 | 372 * be on the 2nd pass. |
373 * | |
374 * Long paragraph. <-- Short sentence. | |
375 * | |
376 * -- ChipX86 | |
377 */ | |
378 | |
379 if (gc && g_slist_find(gc->buddy_chats, conv) != NULL) { | |
8373
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
380 serv_chat_leave(gc, chat_id); |
5262 | 381 |
382 return; | |
383 } | |
8271
5c9cd9c97727
[gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents:
8256
diff
changeset
|
384 #endif |
8373
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
385 /* |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
386 * Instead of all of that, lets just close the window when |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
387 * 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
|
388 * 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
|
389 * knows it left the chat. |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
390 */ |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
391 if (!gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv))) |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
392 serv_chat_leave(gc, chat_id); |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
393 |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
394 /* |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
395 * 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
|
396 * 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
|
397 */ |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
398 if (!gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv))) |
7a58f6f9fc3e
[gaim-migrate @ 9100]
Christian Hammond <chipx86@chipx86.com>
parents:
8348
diff
changeset
|
399 serv_got_chat_left(gc, chat_id); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
400 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
401 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
402 |
12018
014c22dd9d06
[gaim-migrate @ 14311]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11921
diff
changeset
|
403 /* remove from conversations and im/chats lists prior to emit */ |
014c22dd9d06
[gaim-migrate @ 14311]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11921
diff
changeset
|
404 conversations = g_list_remove(conversations, conv); |
014c22dd9d06
[gaim-migrate @ 14311]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11921
diff
changeset
|
405 |
014c22dd9d06
[gaim-migrate @ 14311]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11921
diff
changeset
|
406 if(conv->type==GAIM_CONV_TYPE_IM) |
014c22dd9d06
[gaim-migrate @ 14311]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11921
diff
changeset
|
407 ims = g_list_remove(ims, conv); |
014c22dd9d06
[gaim-migrate @ 14311]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11921
diff
changeset
|
408 else if(conv->type==GAIM_CONV_TYPE_CHAT) |
014c22dd9d06
[gaim-migrate @ 14311]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11921
diff
changeset
|
409 chats = g_list_remove(chats, conv); |
014c22dd9d06
[gaim-migrate @ 14311]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11921
diff
changeset
|
410 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
411 gaim_signal_emit(gaim_conversations_get_handle(), |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
412 "deleting-conversation", conv); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
413 |
11606 | 414 g_free(conv->name); |
415 g_free(conv->title); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
416 |
10116 | 417 conv->name = NULL; |
418 conv->title = NULL; | |
419 | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
420 for (node = g_list_first(conv->send_history); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
421 node != NULL; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
422 node = g_list_next(node)) { |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
423 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
424 if (node->data != NULL) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
425 g_free(node->data); |
10116 | 426 node->data = NULL; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
427 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
428 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
429 g_list_free(g_list_first(conv->send_history)); |
66 | 430 |
11338 | 431 if (conv->type == GAIM_CONV_TYPE_IM) { |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
432 gaim_conv_im_stop_typing_timeout(conv->u.im); |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
433 gaim_conv_im_stop_type_again_timeout(conv->u.im); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
434 |
6846
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
435 if (conv->u.im->icon != NULL) |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
436 gaim_buddy_icon_unref(conv->u.im->icon); |
10116 | 437 conv->u.im->icon = NULL; |
6846
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
438 |
11171 | 439 GAIM_DBUS_UNREGISTER_POINTER(conv->u.im); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
440 g_free(conv->u.im); |
10116 | 441 conv->u.im = NULL; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
442 } |
11338 | 443 else if (conv->type == GAIM_CONV_TYPE_CHAT) { |
4572
06084165a966
[gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents:
4522
diff
changeset
|
444 |
06084165a966
[gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents:
4522
diff
changeset
|
445 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
|
446 if (node->data != NULL) |
10504 | 447 gaim_conv_chat_cb_destroy((GaimConvChatBuddy *)node->data); |
10116 | 448 node->data = NULL; |
4572
06084165a966
[gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents:
4522
diff
changeset
|
449 } |
06084165a966
[gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents:
4522
diff
changeset
|
450 |
06084165a966
[gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents:
4522
diff
changeset
|
451 for (node = conv->u.chat->ignored; node != NULL; node = node->next) { |
06084165a966
[gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents:
4522
diff
changeset
|
452 if (node->data != NULL) |
06084165a966
[gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents:
4522
diff
changeset
|
453 g_free(node->data); |
10116 | 454 node->data = NULL; |
4572
06084165a966
[gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents:
4522
diff
changeset
|
455 } |
06084165a966
[gaim-migrate @ 4853]
Christian Hammond <chipx86@chipx86.com>
parents:
4522
diff
changeset
|
456 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
457 g_list_free(conv->u.chat->in_room); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
458 g_list_free(conv->u.chat->ignored); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
459 |
10116 | 460 conv->u.chat->in_room = NULL; |
461 conv->u.chat->ignored = NULL; | |
462 | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
463 if (conv->u.chat->who != NULL) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
464 g_free(conv->u.chat->who); |
10116 | 465 conv->u.chat->who = NULL; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
466 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
467 if (conv->u.chat->topic != NULL) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
468 g_free(conv->u.chat->topic); |
10116 | 469 conv->u.chat->topic = NULL; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
470 |
10504 | 471 if(conv->u.chat->nick) |
472 g_free(conv->u.chat->nick); | |
473 | |
11146 | 474 GAIM_DBUS_UNREGISTER_POINTER(conv->u.chat); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
475 g_free(conv->u.chat); |
10116 | 476 conv->u.chat = NULL; |
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 |
4877
249382064693
[gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents:
4876
diff
changeset
|
479 g_hash_table_destroy(conv->data); |
10116 | 480 conv->data = NULL; |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
481 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
482 if (ops != NULL && ops->destroy_conversation != NULL) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
483 ops->destroy_conversation(conv); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
484 |
11672
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
485 gaim_conversation_close_logs(conv); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
486 |
11146 | 487 GAIM_DBUS_UNREGISTER_POINTER(conv); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
488 g_free(conv); |
10116 | 489 conv = NULL; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
490 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
491 |
10665 | 492 |
493 void | |
12624
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
494 gaim_conversation_present(GaimConversation *conv) { |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
495 GaimConversationUiOps *ops; |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
496 |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
497 g_return_if_fail(conv != NULL); |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
498 |
12629
fee6a32644a4
[gaim-migrate @ 14965]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
499 ops = gaim_conversation_get_ui_ops(conv); |
12624
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
500 if(ops && ops->present) |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
501 ops->present(conv); |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
502 } |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
503 |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
504 |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
505 void |
10665 | 506 gaim_conversation_set_features(GaimConversation *conv, GaimConnectionFlags features) |
507 { | |
508 g_return_if_fail(conv != NULL); | |
509 | |
510 conv->features = features; | |
511 | |
11671
4ebd27e664c4
[gaim-migrate @ 13957]
Luke Schierer <lschiere@pidgin.im>
parents:
11669
diff
changeset
|
512 gaim_conversation_update(conv, GAIM_CONV_UPDATE_FEATURES); |
10665 | 513 } |
514 | |
515 | |
516 GaimConnectionFlags | |
517 gaim_conversation_get_features(GaimConversation *conv) | |
518 { | |
519 g_return_val_if_fail(conv != NULL, 0); | |
520 return conv->features; | |
521 } | |
522 | |
523 | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
524 GaimConversationType |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
525 gaim_conversation_get_type(const GaimConversation *conv) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
526 { |
11338 | 527 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
|
528 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
529 return conv->type; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
530 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
531 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
532 void |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
533 gaim_conversation_set_ui_ops(GaimConversation *conv, |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
534 GaimConversationUiOps *ops) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
535 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
536 g_return_if_fail(conv != NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
537 |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
538 if (conv->ui_ops == ops) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
539 return; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
540 |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
541 if (conv->ui_ops != NULL && conv->ui_ops->destroy_conversation != NULL) |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
542 conv->ui_ops->destroy_conversation(conv); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
543 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
544 conv->ui_data = NULL; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
545 |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
546 conv->ui_ops = ops; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
547 } |
66 | 548 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
549 GaimConversationUiOps * |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
550 gaim_conversation_get_ui_ops(const GaimConversation *conv) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
551 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
552 g_return_val_if_fail(conv != NULL, NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
553 |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
554 return conv->ui_ops; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
555 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
556 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
557 void |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
558 gaim_conversation_set_account(GaimConversation *conv, GaimAccount *account) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
559 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
560 g_return_if_fail(conv != NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
561 |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
562 if (account == gaim_conversation_get_account(conv)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
563 return; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
564 |
4491 | 565 conv->account = account; |
566 | |
567 gaim_conversation_update(conv, GAIM_CONV_UPDATE_ACCOUNT); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
568 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
569 |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
570 GaimAccount * |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
571 gaim_conversation_get_account(const GaimConversation *conv) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
572 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
573 g_return_val_if_fail(conv != NULL, NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
574 |
4491 | 575 return conv->account; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
576 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
577 |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
578 GaimConnection * |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
579 gaim_conversation_get_gc(const GaimConversation *conv) |
66 | 580 { |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
581 GaimAccount *account; |
4425
be8f9ca74ddf
[gaim-migrate @ 4700]
Christian Hammond <chipx86@chipx86.com>
parents:
4415
diff
changeset
|
582 |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
583 g_return_val_if_fail(conv != NULL, NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
584 |
4491 | 585 account = gaim_conversation_get_account(conv); |
586 | |
587 if (account == NULL) | |
4425
be8f9ca74ddf
[gaim-migrate @ 4700]
Christian Hammond <chipx86@chipx86.com>
parents:
4415
diff
changeset
|
588 return NULL; |
be8f9ca74ddf
[gaim-migrate @ 4700]
Christian Hammond <chipx86@chipx86.com>
parents:
4415
diff
changeset
|
589 |
4491 | 590 return account->gc; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
591 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
592 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
593 void |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
594 gaim_conversation_set_title(GaimConversation *conv, const char *title) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
595 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
596 g_return_if_fail(conv != NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
597 g_return_if_fail(title != NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
598 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
599 if (conv->title != NULL) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
600 g_free(conv->title); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
601 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
602 conv->title = g_strdup(title); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
603 |
11671
4ebd27e664c4
[gaim-migrate @ 13957]
Luke Schierer <lschiere@pidgin.im>
parents:
11669
diff
changeset
|
604 gaim_conversation_update(conv, GAIM_CONV_UPDATE_TITLE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
605 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
606 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
607 const char * |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
608 gaim_conversation_get_title(const GaimConversation *conv) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
609 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
610 g_return_val_if_fail(conv != NULL, NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
611 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
612 return conv->title; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
613 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
614 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
615 void |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
616 gaim_conversation_autoset_title(GaimConversation *conv) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
617 { |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
618 GaimAccount *account; |
6695 | 619 GaimBuddy *b; |
8015 | 620 GaimChat *chat; |
621 const char *text = NULL, *name; | |
3799 | 622 |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
623 g_return_if_fail(conv != NULL); |
2267
837aa71710c5
[gaim-migrate @ 2277]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2264
diff
changeset
|
624 |
4491 | 625 account = gaim_conversation_get_account(conv); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
626 name = gaim_conversation_get_name(conv); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
627 |
11338 | 628 if(gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) { |
10364 | 629 if(account && ((b = gaim_find_buddy(account, name)) != NULL)) |
12313
f9629b994b27
[gaim-migrate @ 14617]
Christopher O'Brien <siege@pidgin.im>
parents:
12216
diff
changeset
|
630 text = gaim_buddy_get_contact_alias(b); |
11338 | 631 } else if(gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) { |
10364 | 632 if(account && ((chat = gaim_blist_find_chat(account, name)) != NULL)) |
633 text = chat->alias; | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
634 } |
11581 | 635 |
8015 | 636 |
10116 | 637 if(text == NULL) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
638 text = name; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
639 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
640 gaim_conversation_set_title(conv, text); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
641 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
642 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
643 void |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
644 gaim_conversation_foreach(void (*func)(GaimConversation *conv)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
645 { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
646 GaimConversation *conv; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
647 GList *l; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
648 |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
649 g_return_if_fail(func != NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
650 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
651 for (l = gaim_get_conversations(); l != NULL; l = l->next) { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
652 conv = (GaimConversation *)l->data; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
653 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
654 func(conv); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
655 } |
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 |
7256
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
658 void |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
659 gaim_conversation_set_name(GaimConversation *conv, const char *name) |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
660 { |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
661 g_return_if_fail(conv != NULL); |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
662 |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
663 if (conv->name != NULL) |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
664 g_free(conv->name); |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
665 |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
666 conv->name = (name == NULL ? NULL : g_strdup(name)); |
7257
31abca48a631
[gaim-migrate @ 7834]
Christian Hammond <chipx86@chipx86.com>
parents:
7256
diff
changeset
|
667 |
31abca48a631
[gaim-migrate @ 7834]
Christian Hammond <chipx86@chipx86.com>
parents:
7256
diff
changeset
|
668 gaim_conversation_autoset_title(conv); |
7256
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
669 } |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
670 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
671 const char * |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
672 gaim_conversation_get_name(const GaimConversation *conv) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
673 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
674 g_return_val_if_fail(conv != NULL, NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
675 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
676 return conv->name; |
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 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
679 void |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
680 gaim_conversation_set_logging(GaimConversation *conv, gboolean log) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
681 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
682 g_return_if_fail(conv != NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
683 |
11672
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
684 if (conv->logging != log) |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
685 { |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
686 conv->logging = log; |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
687 gaim_conversation_update(conv, GAIM_CONV_UPDATE_LOGGING); |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
688 } |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
689 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
690 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
691 gboolean |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
692 gaim_conversation_is_logging(const GaimConversation *conv) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
693 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
694 g_return_val_if_fail(conv != NULL, FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
695 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
696 return conv->logging; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
697 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
698 |
11672
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
699 void |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
700 gaim_conversation_close_logs(GaimConversation *conv) |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
701 { |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
702 g_return_if_fail(conv != NULL); |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
703 |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
704 g_list_foreach(conv->logs, (GFunc)gaim_log_free, NULL); |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
705 g_list_free(conv->logs); |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
706 conv->logs = NULL; |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
707 } |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
708 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
709 GList * |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
710 gaim_conversation_get_send_history(const GaimConversation *conv) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
711 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
712 g_return_val_if_fail(conv != NULL, NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
713 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
714 return conv->send_history; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
715 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
716 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
717 GaimConvIm * |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
718 gaim_conversation_get_im_data(const GaimConversation *conv) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
719 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
720 g_return_val_if_fail(conv != NULL, NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
721 |
11338 | 722 if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_IM) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
723 return NULL; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
724 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
725 return conv->u.im; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
726 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
727 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
728 GaimConvChat * |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
729 gaim_conversation_get_chat_data(const GaimConversation *conv) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
730 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
731 g_return_val_if_fail(conv != NULL, NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
732 |
11338 | 733 if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_CHAT) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
734 return NULL; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
735 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
736 return conv->u.chat; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
737 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
738 |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
739 void |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
740 gaim_conversation_set_data(GaimConversation *conv, const char *key, |
4877
249382064693
[gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents:
4876
diff
changeset
|
741 gpointer data) |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
742 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
743 g_return_if_fail(conv != NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
744 g_return_if_fail(key != NULL); |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
745 |
4877
249382064693
[gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents:
4876
diff
changeset
|
746 g_hash_table_replace(conv->data, g_strdup(key), data); |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
747 } |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
748 |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
749 gpointer |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
750 gaim_conversation_get_data(GaimConversation *conv, const char *key) |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
751 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
752 g_return_val_if_fail(conv != NULL, NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
753 g_return_val_if_fail(key != NULL, NULL); |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
754 |
4877
249382064693
[gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents:
4876
diff
changeset
|
755 return g_hash_table_lookup(conv->data, key); |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
756 } |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
757 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
758 GList * |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
759 gaim_get_conversations(void) |
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 return conversations; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
762 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
763 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
764 GList * |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
765 gaim_get_ims(void) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
766 { |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
767 return ims; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
768 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
769 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
770 GList * |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
771 gaim_get_chats(void) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
772 { |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
773 return chats; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
774 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
775 |
7261 | 776 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
777 GaimConversation * |
10246 | 778 gaim_find_conversation_with_account(GaimConversationType type, |
779 const char *name, | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
780 const GaimAccount *account) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
781 { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
782 GaimConversation *c = NULL; |
10246 | 783 gchar *name1; |
784 const gchar *name2; | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
785 GList *cnv; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
786 |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
787 g_return_val_if_fail(name != NULL, NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
788 |
10246 | 789 name1 = g_strdup(gaim_normalize(account, name)); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
790 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
791 for (cnv = gaim_get_conversations(); cnv != NULL; cnv = cnv->next) { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
792 c = (GaimConversation *)cnv->data; |
10246 | 793 name2 = gaim_normalize(account, gaim_conversation_get_name(c)); |
794 | |
11338 | 795 if (((type == GAIM_CONV_TYPE_ANY) || (type == gaim_conversation_get_type(c))) && |
10246 | 796 (account == gaim_conversation_get_account(c)) && |
797 !gaim_utf8_strcasecmp(name1, name2)) { | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
798 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
799 break; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
800 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
801 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
802 c = NULL; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
803 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
804 |
10246 | 805 g_free(name1); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
806 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
807 return c; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
808 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
809 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
810 void |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
811 gaim_conversation_write(GaimConversation *conv, const char *who, |
6982 | 812 const char *message, GaimMessageFlags flags, |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
813 time_t mtime) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
814 { |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5139
diff
changeset
|
815 GaimPluginProtocolInfo *prpl_info = NULL; |
6496
e0c80bec996a
[gaim-migrate @ 7011]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
816 GaimConnection *gc = NULL; |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
817 GaimAccount *account; |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
818 GaimConversationUiOps *ops; |
11468
c3cb62d33f53
[gaim-migrate @ 13708]
Richard Laager <rlaager@wiktel.com>
parents:
11454
diff
changeset
|
819 const char *alias; |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
820 char *displayed = NULL; |
6695 | 821 GaimBuddy *b; |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
822 int plugin_return; |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
823 GaimConversationType type; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
824 /* int logging_font_options = 0; */ |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
825 |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
826 g_return_if_fail(conv != NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
827 g_return_if_fail(message != NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
828 |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
829 ops = gaim_conversation_get_ui_ops(conv); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
830 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
831 if (ops == NULL || ops->write_conv == NULL) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
832 return; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
833 |
4608 | 834 account = gaim_conversation_get_account(conv); |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
835 type = gaim_conversation_get_type(conv); |
6496
e0c80bec996a
[gaim-migrate @ 7011]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
836 |
e0c80bec996a
[gaim-migrate @ 7011]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
837 if (account != NULL) |
e0c80bec996a
[gaim-migrate @ 7011]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
838 gc = gaim_account_get_connection(account); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
839 |
11338 | 840 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT && |
6496
e0c80bec996a
[gaim-migrate @ 7011]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
841 (gc == NULL || !g_slist_find(gc->buddy_chats, conv))) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
842 return; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
843 |
11338 | 844 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM && |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
845 !g_list_find(gaim_get_conversations(), conv)) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
846 return; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
847 |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
848 displayed = g_strdup(message); |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
849 |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
850 plugin_return = |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
851 GPOINTER_TO_INT(gaim_signal_emit_return_1( |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
852 gaim_conversations_get_handle(), |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
853 (type == GAIM_CONV_TYPE_IM ? "writing-im-msg" : "writing-chat-msg"), |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
854 account, who, &displayed, conv, flags)); |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
855 |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
856 if (displayed == NULL) |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
857 return; |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
858 |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
859 if (plugin_return) { |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
860 g_free(displayed); |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
861 return; |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
862 } |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
863 |
11468
c3cb62d33f53
[gaim-migrate @ 13708]
Richard Laager <rlaager@wiktel.com>
parents:
11454
diff
changeset
|
864 if (who == NULL || *who == '\0') |
c3cb62d33f53
[gaim-migrate @ 13708]
Richard Laager <rlaager@wiktel.com>
parents:
11454
diff
changeset
|
865 who = gaim_conversation_get_name(conv); |
c3cb62d33f53
[gaim-migrate @ 13708]
Richard Laager <rlaager@wiktel.com>
parents:
11454
diff
changeset
|
866 |
c3cb62d33f53
[gaim-migrate @ 13708]
Richard Laager <rlaager@wiktel.com>
parents:
11454
diff
changeset
|
867 alias = who; |
c3cb62d33f53
[gaim-migrate @ 13708]
Richard Laager <rlaager@wiktel.com>
parents:
11454
diff
changeset
|
868 |
9613 | 869 if (account != NULL) { |
870 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
|
871 |
11338 | 872 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM || |
5350
a6146cbae03b
[gaim-migrate @ 5726]
Christian Hammond <chipx86@chipx86.com>
parents:
5262
diff
changeset
|
873 !(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
a6146cbae03b
[gaim-migrate @ 5726]
Christian Hammond <chipx86@chipx86.com>
parents:
5262
diff
changeset
|
874 |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
875 if (flags & GAIM_MESSAGE_SEND) { |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
876 b = gaim_find_buddy(account, |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
877 gaim_account_get_username(account)); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
878 |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
879 if (gaim_account_get_alias(account) != NULL) |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
880 alias = account->alias; |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
881 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
|
882 alias = gaim_buddy_get_contact_alias(b); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
883 else if (gaim_connection_get_display_name(gc) != NULL) |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
884 alias = gaim_connection_get_display_name(gc); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
885 else |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
886 alias = gaim_account_get_username(account); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
887 } |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
888 else |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
889 { |
5350
a6146cbae03b
[gaim-migrate @ 5726]
Christian Hammond <chipx86@chipx86.com>
parents:
5262
diff
changeset
|
890 b = gaim_find_buddy(account, who); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
891 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
892 if (b != NULL) |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
893 alias = gaim_buddy_get_contact_alias(b); |
1772
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
894 } |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
895 } |
474
7720d0f9da8e
[gaim-migrate @ 484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
473
diff
changeset
|
896 } |
8256
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
897 |
11804
648637d0a931
[gaim-migrate @ 14095]
Richard Laager <rlaager@wiktel.com>
parents:
11793
diff
changeset
|
898 if (!(flags & GAIM_MESSAGE_NO_LOG) && gaim_conversation_is_logging(conv)) { |
11672
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
899 GList *log; |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
900 |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
901 if (conv->logs == NULL) |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
902 open_log(conv); |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
903 |
04e0189bb519
[gaim-migrate @ 13958]
Richard Laager <rlaager@wiktel.com>
parents:
11671
diff
changeset
|
904 log = conv->logs; |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
905 while (log != NULL) { |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
906 gaim_log_write((GaimLog *)log->data, flags, alias, mtime, displayed); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
907 log = log->next; |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
908 } |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
909 } |
66 | 910 |
11338 | 911 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) { |
11664
38bbb0f15453
[gaim-migrate @ 13949]
Luke Schierer <lschiere@pidgin.im>
parents:
11606
diff
changeset
|
912 if ((flags & GAIM_MESSAGE_RECV) == GAIM_MESSAGE_RECV) { |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
913 gaim_conv_im_set_typing_state(GAIM_CONV_IM(conv), GAIM_NOT_TYPING); |
11664
38bbb0f15453
[gaim-migrate @ 13949]
Luke Schierer <lschiere@pidgin.im>
parents:
11606
diff
changeset
|
914 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
915 } |
12902
3bf3f489b64b
[gaim-migrate @ 15255]
Richard Laager <rlaager@wiktel.com>
parents:
12901
diff
changeset
|
916 |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
917 ops->write_conv(conv, who, alias, displayed, flags, mtime); |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
918 |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
919 gaim_signal_emit(gaim_conversations_get_handle(), |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
920 (type == GAIM_CONV_TYPE_IM ? "wrote-im-msg" : "wrote-chat-msg"), |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
921 account, who, displayed, conv, flags); |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
922 |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
923 g_free(displayed); |
66 | 924 } |
925 | |
9260
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
926 gboolean |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
927 gaim_conversation_has_focus(GaimConversation *conv) |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
928 { |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
929 gboolean ret = FALSE; |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
930 GaimConversationUiOps *ops; |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
931 |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
932 g_return_val_if_fail(conv != NULL, FALSE); |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
933 |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
934 ops = gaim_conversation_get_ui_ops(conv); |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
935 |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
936 if (ops != NULL && ops->has_focus != NULL) |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
937 ret = ops->has_focus(conv); |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
938 |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
939 return ret; |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
940 } |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9251
diff
changeset
|
941 |
7930 | 942 /* |
8256
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
943 * 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
|
944 * 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
|
945 * core/UI split is cleaner. Also need to make sure this is called |
7930 | 946 * when chats are added/removed from the blist. |
947 */ | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
948 void |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
949 gaim_conversation_update(GaimConversation *conv, GaimConvUpdateType type) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
950 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
951 g_return_if_fail(conv != NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
952 |
9734 | 953 gaim_signal_emit(gaim_conversations_get_handle(), |
954 "conversation-updated", conv, type); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
955 } |
2993 | 956 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
957 /************************************************************************** |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
958 * IM Conversation API |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
959 **************************************************************************/ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
960 GaimConversation * |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
961 gaim_conv_im_get_conversation(const GaimConvIm *im) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
962 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
963 g_return_val_if_fail(im != NULL, NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
964 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
965 return im->conv; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
966 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
967 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
968 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
969 gaim_conv_im_set_icon(GaimConvIm *im, GaimBuddyIcon *icon) |
6846
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
970 { |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
971 g_return_if_fail(im != NULL); |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
972 |
9261
77fdeb4c459f
[gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents:
9260
diff
changeset
|
973 if (im->icon != icon) |
77fdeb4c459f
[gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents:
9260
diff
changeset
|
974 { |
77fdeb4c459f
[gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents:
9260
diff
changeset
|
975 if (im->icon != NULL) |
77fdeb4c459f
[gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents:
9260
diff
changeset
|
976 gaim_buddy_icon_unref(im->icon); |
77fdeb4c459f
[gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents:
9260
diff
changeset
|
977 |
77fdeb4c459f
[gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents:
9260
diff
changeset
|
978 im->icon = (icon == NULL ? NULL : gaim_buddy_icon_ref(icon)); |
77fdeb4c459f
[gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents:
9260
diff
changeset
|
979 } |
6846
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
980 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
981 gaim_conversation_update(gaim_conv_im_get_conversation(im), |
6846
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
982 GAIM_CONV_UPDATE_ICON); |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
983 } |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
984 |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
985 GaimBuddyIcon * |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
986 gaim_conv_im_get_icon(const GaimConvIm *im) |
6846
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
987 { |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
988 g_return_val_if_fail(im != NULL, NULL); |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
989 |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
990 return im->icon; |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
991 } |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
992 |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
993 void |
8288
dde73afb3283
[gaim-migrate @ 9012]
Christian Hammond <chipx86@chipx86.com>
parents:
8287
diff
changeset
|
994 gaim_conv_im_set_typing_state(GaimConvIm *im, GaimTypingState state) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
995 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
996 g_return_if_fail(im != NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
997 |
12797
eda1572c788b
[gaim-migrate @ 15144]
Richard Laager <rlaager@wiktel.com>
parents:
12639
diff
changeset
|
998 if (im->typing_state != state) |
eda1572c788b
[gaim-migrate @ 15144]
Richard Laager <rlaager@wiktel.com>
parents:
12639
diff
changeset
|
999 { |
eda1572c788b
[gaim-migrate @ 15144]
Richard Laager <rlaager@wiktel.com>
parents:
12639
diff
changeset
|
1000 im->typing_state = state; |
eda1572c788b
[gaim-migrate @ 15144]
Richard Laager <rlaager@wiktel.com>
parents:
12639
diff
changeset
|
1001 |
eda1572c788b
[gaim-migrate @ 15144]
Richard Laager <rlaager@wiktel.com>
parents:
12639
diff
changeset
|
1002 if (state == GAIM_TYPING) |
eda1572c788b
[gaim-migrate @ 15144]
Richard Laager <rlaager@wiktel.com>
parents:
12639
diff
changeset
|
1003 { |
eda1572c788b
[gaim-migrate @ 15144]
Richard Laager <rlaager@wiktel.com>
parents:
12639
diff
changeset
|
1004 gaim_signal_emit(gaim_conversations_get_handle(), |
eda1572c788b
[gaim-migrate @ 15144]
Richard Laager <rlaager@wiktel.com>
parents:
12639
diff
changeset
|
1005 "buddy-typing", im->conv->account, im->conv->name); |
eda1572c788b
[gaim-migrate @ 15144]
Richard Laager <rlaager@wiktel.com>
parents:
12639
diff
changeset
|
1006 } |
eda1572c788b
[gaim-migrate @ 15144]
Richard Laager <rlaager@wiktel.com>
parents:
12639
diff
changeset
|
1007 else |
eda1572c788b
[gaim-migrate @ 15144]
Richard Laager <rlaager@wiktel.com>
parents:
12639
diff
changeset
|
1008 { |
eda1572c788b
[gaim-migrate @ 15144]
Richard Laager <rlaager@wiktel.com>
parents:
12639
diff
changeset
|
1009 gaim_signal_emit(gaim_conversations_get_handle(), |
eda1572c788b
[gaim-migrate @ 15144]
Richard Laager <rlaager@wiktel.com>
parents:
12639
diff
changeset
|
1010 "buddy-typing-stopped", im->conv->account, im->conv->name); |
eda1572c788b
[gaim-migrate @ 15144]
Richard Laager <rlaager@wiktel.com>
parents:
12639
diff
changeset
|
1011 } |
eda1572c788b
[gaim-migrate @ 15144]
Richard Laager <rlaager@wiktel.com>
parents:
12639
diff
changeset
|
1012 } |
2993 | 1013 } |
66 | 1014 |
8288
dde73afb3283
[gaim-migrate @ 9012]
Christian Hammond <chipx86@chipx86.com>
parents:
8287
diff
changeset
|
1015 GaimTypingState |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1016 gaim_conv_im_get_typing_state(const GaimConvIm *im) |
3671 | 1017 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1018 g_return_val_if_fail(im != NULL, 0); |
3671 | 1019 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1020 return im->typing_state; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1021 } |
3704 | 1022 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1023 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1024 gaim_conv_im_start_typing_timeout(GaimConvIm *im, int timeout) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1025 { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
1026 GaimConversation *conv; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1027 const char *name; |
3671 | 1028 |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1029 g_return_if_fail(im != NULL); |
3671 | 1030 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1031 if (im->typing_timeout > 0) |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1032 gaim_conv_im_stop_typing_timeout(im); |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1033 |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1034 conv = gaim_conv_im_get_conversation(im); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1035 name = gaim_conversation_get_name(conv); |
3671 | 1036 |
8273
f24172f53650
[gaim-migrate @ 8997]
Christian Hammond <chipx86@chipx86.com>
parents:
8271
diff
changeset
|
1037 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
|
1038 } |
3671 | 1039 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1040 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1041 gaim_conv_im_stop_typing_timeout(GaimConvIm *im) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1042 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1043 g_return_if_fail(im != NULL); |
3671 | 1044 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1045 if (im->typing_timeout == 0) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1046 return; |
3671 | 1047 |
8287
ef881489396e
[gaim-migrate @ 9011]
Christian Hammond <chipx86@chipx86.com>
parents:
8273
diff
changeset
|
1048 gaim_timeout_remove(im->typing_timeout); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1049 im->typing_timeout = 0; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1050 } |
3671 | 1051 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1052 guint |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1053 gaim_conv_im_get_typing_timeout(const GaimConvIm *im) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1054 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1055 g_return_val_if_fail(im != NULL, 0); |
3699 | 1056 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1057 return im->typing_timeout; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1058 } |
3699 | 1059 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1060 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1061 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
|
1062 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1063 g_return_if_fail(im != NULL); |
3671 | 1064 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1065 im->type_again = val; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1066 } |
3671 | 1067 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1068 time_t |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1069 gaim_conv_im_get_type_again(const GaimConvIm *im) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1070 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1071 g_return_val_if_fail(im != NULL, 0); |
3671 | 1072 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1073 return im->type_again; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1074 } |
3671 | 1075 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1076 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1077 gaim_conv_im_start_type_again_timeout(GaimConvIm *im) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1078 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1079 g_return_if_fail(im != NULL); |
3671 | 1080 |
8273
f24172f53650
[gaim-migrate @ 8997]
Christian Hammond <chipx86@chipx86.com>
parents:
8271
diff
changeset
|
1081 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
|
1082 gaim_conv_im_get_conversation(im)); |
3671 | 1083 } |
1084 | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1085 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1086 gaim_conv_im_stop_type_again_timeout(GaimConvIm *im) |
3671 | 1087 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1088 g_return_if_fail(im != NULL); |
3671 | 1089 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1090 if (im->type_again_timeout == 0) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1091 return; |
3671 | 1092 |
8287
ef881489396e
[gaim-migrate @ 9011]
Christian Hammond <chipx86@chipx86.com>
parents:
8273
diff
changeset
|
1093 gaim_timeout_remove(im->type_again_timeout); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1094 im->type_again_timeout = 0; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1095 } |
3671 | 1096 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1097 guint |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1098 gaim_conv_im_get_type_again_timeout(const GaimConvIm *im) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1099 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1100 g_return_val_if_fail(im != NULL, 0); |
3671 | 1101 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1102 return im->type_again_timeout; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1103 } |
3671 | 1104 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1105 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1106 gaim_conv_im_update_typing(GaimConvIm *im) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1107 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1108 g_return_if_fail(im != NULL); |
3671 | 1109 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1110 gaim_conversation_update(gaim_conv_im_get_conversation(im), |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1111 GAIM_CONV_UPDATE_TYPING); |
3671 | 1112 } |
1113 | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1114 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1115 gaim_conv_im_write(GaimConvIm *im, const char *who, const char *message, |
6982 | 1116 GaimMessageFlags flags, time_t mtime) |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1117 { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
1118 GaimConversation *c; |
1898
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
1119 |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1120 g_return_if_fail(im != NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1121 g_return_if_fail(message != NULL); |
1898
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
1122 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1123 c = gaim_conv_im_get_conversation(im); |
2787
feea7103a235
[gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2773
diff
changeset
|
1124 |
4382
76223649765b
[gaim-migrate @ 4648]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
1125 /* Raise the window, if specified in prefs. */ |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
1126 if (c->ui_ops != NULL && c->ui_ops->write_im != NULL) |
6982 | 1127 c->ui_ops->write_im(c, who, message, flags, mtime); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1128 else |
6982 | 1129 gaim_conversation_write(c, who, message, flags, mtime); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1130 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1131 |
9627 | 1132 gboolean gaim_conv_present_error(const char *who, GaimAccount *account, const char *what) |
1133 { | |
1134 GaimConversation *conv; | |
1135 | |
1136 g_return_val_if_fail(who != NULL, FALSE); | |
1137 g_return_val_if_fail(account !=NULL, FALSE); | |
1138 g_return_val_if_fail(what != NULL, FALSE); | |
1139 | |
11338 | 1140 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_ANY, who, account); |
9627 | 1141 if (conv != NULL) |
1142 gaim_conversation_write(conv, NULL, what, GAIM_MESSAGE_ERROR, time(NULL)); | |
1143 else | |
1144 return FALSE; | |
1145 | |
1146 return TRUE; | |
1147 } | |
1148 | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1149 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1150 gaim_conv_im_send(GaimConvIm *im, const char *message) |
2379
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1151 { |
11921 | 1152 gaim_conv_im_send_with_flags(im, message, 0); |
1153 } | |
1154 | |
1155 void | |
1156 gaim_conv_im_send_with_flags(GaimConvIm *im, const char *message, GaimMessageFlags flags) | |
1157 { | |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1158 g_return_if_fail(im != NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1159 g_return_if_fail(message != NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1160 |
11921 | 1161 common_send(gaim_conv_im_get_conversation(im), message, flags); |
4359
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 |
10526 | 1164 gboolean |
1165 gaim_conv_custom_smiley_add(GaimConversation *conv, const char *smile, | |
12618
204bd8fac61f
[gaim-migrate @ 14954]
Richard Laager <rlaager@wiktel.com>
parents:
12604
diff
changeset
|
1166 const char *cksum_type, const char *chksum, |
204bd8fac61f
[gaim-migrate @ 14954]
Richard Laager <rlaager@wiktel.com>
parents:
12604
diff
changeset
|
1167 gboolean remote) |
10526 | 1168 { |
1169 if (conv == NULL || smile == NULL || !*smile) { | |
1170 return FALSE; | |
1171 } | |
1172 | |
1173 /* TODO: check if the icon is in the cache and return false if so */ | |
1174 /* TODO: add an icon cache (that doesn't suck) */ | |
1175 if (conv->ui_ops != NULL && conv->ui_ops->custom_smiley_add !=NULL) { | |
12618
204bd8fac61f
[gaim-migrate @ 14954]
Richard Laager <rlaager@wiktel.com>
parents:
12604
diff
changeset
|
1176 return conv->ui_ops->custom_smiley_add(conv, smile, remote); |
10526 | 1177 } else { |
1178 gaim_debug_info("conversation", "Could not find add custom smiley function"); | |
1179 return FALSE; | |
1180 } | |
1181 | |
1182 } | |
1183 | |
1184 void | |
1185 gaim_conv_custom_smiley_write(GaimConversation *conv, const char *smile, | |
11137 | 1186 const guchar *data, gsize size) |
10526 | 1187 { |
1188 g_return_if_fail(conv != NULL); | |
1189 g_return_if_fail(smile != NULL && *smile); | |
1190 | |
1191 if (conv->ui_ops != NULL && conv->ui_ops->custom_smiley_write != NULL) | |
1192 conv->ui_ops->custom_smiley_write(conv, smile, data, size); | |
1193 else | |
1194 gaim_debug_info("conversation", "Could not find the smiley write function"); | |
1195 } | |
1196 | |
1197 void | |
1198 gaim_conv_custom_smiley_close(GaimConversation *conv, const char *smile) | |
1199 { | |
1200 g_return_if_fail(conv != NULL); | |
1201 g_return_if_fail(smile != NULL && *smile); | |
1202 | |
1203 if (conv->ui_ops != NULL && conv->ui_ops->custom_smiley_close != NULL) | |
1204 conv->ui_ops->custom_smiley_close(conv, smile); | |
1205 else | |
1206 gaim_debug_info("conversation", "Could not find custom smiley close function"); | |
1207 } | |
1208 | |
1209 | |
4359
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 * Chat Conversation API |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1212 **************************************************************************/ |
2379
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1213 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
1214 GaimConversation * |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1215 gaim_conv_chat_get_conversation(const GaimConvChat *chat) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1216 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1217 g_return_val_if_fail(chat != NULL, NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1218 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1219 return chat->conv; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1220 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1221 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1222 GList * |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1223 gaim_conv_chat_set_users(GaimConvChat *chat, GList *users) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1224 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1225 g_return_val_if_fail(chat != NULL, NULL); |
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 chat->in_room = users; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1228 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1229 return users; |
2379
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1230 } |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1231 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1232 GList * |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1233 gaim_conv_chat_get_users(const GaimConvChat *chat) |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1234 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1235 g_return_val_if_fail(chat != NULL, NULL); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1236 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1237 return chat->in_room; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1238 } |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1239 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1240 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1241 gaim_conv_chat_ignore(GaimConvChat *chat, const char *name) |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1242 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1243 g_return_if_fail(chat != NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1244 g_return_if_fail(name != NULL); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1245 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1246 /* Make sure the user isn't already ignored. */ |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1247 if (gaim_conv_chat_is_user_ignored(chat, name)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1248 return; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1249 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1250 gaim_conv_chat_set_ignored(chat, |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1251 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
|
1252 } |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1253 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1254 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1255 gaim_conv_chat_unignore(GaimConvChat *chat, const char *name) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1256 { |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1257 GList *item; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1258 |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1259 g_return_if_fail(chat != NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1260 g_return_if_fail(name != NULL); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1261 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1262 /* Make sure the user is actually ignored. */ |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1263 if (!gaim_conv_chat_is_user_ignored(chat, name)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1264 return; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1265 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1266 item = g_list_find(gaim_conv_chat_get_ignored(chat), |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1267 gaim_conv_chat_get_ignored_user(chat, name)); |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1268 |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1269 gaim_conv_chat_set_ignored(chat, |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1270 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
|
1271 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1272 g_free(item->data); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1273 g_list_free_1(item); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1274 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1275 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1276 GList * |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1277 gaim_conv_chat_set_ignored(GaimConvChat *chat, GList *ignored) |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1278 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1279 g_return_val_if_fail(chat != NULL, NULL); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1280 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1281 chat->ignored = ignored; |
993
eacd93d0089a
[gaim-migrate @ 1003]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1282 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1283 return ignored; |
2111
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1284 } |
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1285 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1286 GList * |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1287 gaim_conv_chat_get_ignored(const GaimConvChat *chat) |
2111
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1288 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1289 g_return_val_if_fail(chat != NULL, NULL); |
1898
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
1290 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1291 return chat->ignored; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1292 } |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1293 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1294 const char * |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1295 gaim_conv_chat_get_ignored_user(const GaimConvChat *chat, const char *user) |
1340 | 1296 { |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1297 GList *ignored; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1298 |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1299 g_return_val_if_fail(chat != NULL, NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1300 g_return_val_if_fail(user != NULL, NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1301 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1302 for (ignored = gaim_conv_chat_get_ignored(chat); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1303 ignored != NULL; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1304 ignored = ignored->next) { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1305 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1306 const char *ign = (const char *)ignored->data; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1307 |
4793 | 1308 if (!gaim_utf8_strcasecmp(user, ign) || |
1309 ((*ign == '+' || *ign == '%') && !gaim_utf8_strcasecmp(user, ign + 1))) | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1310 return ign; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1311 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1312 if (*ign == '@') { |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1313 ign++; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1314 |
4793 | 1315 if ((*ign == '+' && !gaim_utf8_strcasecmp(user, ign + 1)) || |
1316 (*ign != '+' && !gaim_utf8_strcasecmp(user, ign))) | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1317 return ign; |
3671 | 1318 } |
2094
be10a1243ed7
[gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2090
diff
changeset
|
1319 } |
1341 | 1320 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1321 return NULL; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1322 } |
1341 | 1323 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1324 gboolean |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1325 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
|
1326 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1327 g_return_val_if_fail(chat != NULL, FALSE); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1328 g_return_val_if_fail(user != NULL, FALSE); |
1341 | 1329 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1330 return (gaim_conv_chat_get_ignored_user(chat, user) != NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1331 } |
1343 | 1332 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1333 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1334 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
|
1335 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1336 g_return_if_fail(chat != NULL); |
1343 | 1337 |
7606 | 1338 if (chat->who != NULL) g_free(chat->who); |
1339 if (chat->topic != NULL) g_free(chat->topic); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1340 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1341 chat->who = (who == NULL ? NULL : g_strdup(who)); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1342 chat->topic = (topic == NULL ? NULL : g_strdup(topic)); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1343 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1344 gaim_conversation_update(gaim_conv_chat_get_conversation(chat), |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1345 GAIM_CONV_UPDATE_TOPIC); |
9517 | 1346 |
1347 gaim_signal_emit(gaim_conversations_get_handle(), "chat-topic-changed", | |
1348 chat->conv, chat->who, chat->topic); | |
1340 | 1349 } |
1350 | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1351 const char * |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1352 gaim_conv_chat_get_topic(const GaimConvChat *chat) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1353 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1354 g_return_val_if_fail(chat != NULL, NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1355 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1356 return chat->topic; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1357 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1358 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1359 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1360 gaim_conv_chat_set_id(GaimConvChat *chat, int id) |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1361 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1362 g_return_if_fail(chat != NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1363 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1364 chat->id = id; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1365 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1366 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1367 int |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1368 gaim_conv_chat_get_id(const GaimConvChat *chat) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1369 { |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1370 g_return_val_if_fail(chat != NULL, -1); |
3951 | 1371 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1372 return chat->id; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1373 } |
3951 | 1374 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1375 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1376 gaim_conv_chat_write(GaimConvChat *chat, const char *who, const char *message, |
6621 | 1377 GaimMessageFlags flags, time_t mtime) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1378 { |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
1379 GaimAccount *account; |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
1380 GaimConversation *conv; |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
1381 GaimConnection *gc; |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1382 GaimPluginProtocolInfo *prpl_info; |
3866 | 1383 |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1384 g_return_if_fail(chat != NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1385 g_return_if_fail(who != NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1386 g_return_if_fail(message != NULL); |
3866 | 1387 |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1388 conv = gaim_conv_chat_get_conversation(chat); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1389 gc = gaim_conversation_get_gc(conv); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1390 account = gaim_connection_get_account(gc); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1391 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1392 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1393 /* 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
|
1394 if (gaim_conv_chat_is_user_ignored(chat, who)) |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1395 return; |
3677 | 1396 |
6621 | 1397 if (!(flags & GAIM_MESSAGE_WHISPER)) { |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1398 char *str; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1399 |
7261 | 1400 str = g_strdup(gaim_normalize(account, who)); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1401 |
11500
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1402 if (!strcmp(str, gaim_normalize(account, chat->nick))) { |
6621 | 1403 flags |= GAIM_MESSAGE_SEND; |
8158 | 1404 } else { |
6621 | 1405 flags |= GAIM_MESSAGE_RECV; |
3677 | 1406 |
11552
11d30825c1bb
[gaim-migrate @ 13812]
Gary Kramlich <grim@reaperworld.com>
parents:
11500
diff
changeset
|
1407 if (gaim_utf8_has_word(message, chat->nick)) |
6621 | 1408 flags |= GAIM_MESSAGE_NICK; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1409 } |
6060 | 1410 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1411 g_free(str); |
3677 | 1412 } |
3705 | 1413 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1414 /* 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
|
1415 if (conv->ui_ops != NULL && conv->ui_ops->write_chat != NULL) |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
1416 conv->ui_ops->write_chat(conv, who, message, flags, mtime); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1417 else |
6982 | 1418 gaim_conversation_write(conv, who, message, flags, mtime); |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1419 } |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1420 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1421 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1422 gaim_conv_chat_send(GaimConvChat *chat, const char *message) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1423 { |
11921 | 1424 gaim_conv_chat_send_with_flags(chat, message, 0); |
1425 } | |
1426 | |
1427 void | |
1428 gaim_conv_chat_send_with_flags(GaimConvChat *chat, const char *message, GaimMessageFlags flags) | |
1429 { | |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1430 g_return_if_fail(chat != NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1431 g_return_if_fail(message != NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1432 |
11921 | 1433 common_send(gaim_conv_chat_get_conversation(chat), message, flags); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1434 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1435 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1436 void |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1437 gaim_conv_chat_add_user(GaimConvChat *chat, const char *user, |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1438 const char *extra_msg, GaimConvChatBuddyFlags flags, |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1439 gboolean new_arrival) |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1440 { |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1441 GList *users = g_list_append(NULL, (char *)user); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1442 GList *extra_msgs = g_list_append(NULL, (char *)extra_msg); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1443 GList *flags2 = g_list_append(NULL, GINT_TO_POINTER(flags)); |
11581 | 1444 |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1445 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
|
1446 |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1447 g_list_free(users); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1448 g_list_free(extra_msgs); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1449 g_list_free(flags2); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1450 } |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1451 |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1452 void |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1453 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
|
1454 GList *flags, gboolean new_arrivals) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1455 { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
1456 GaimConversation *conv; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
1457 GaimConversationUiOps *ops; |
9554 | 1458 GaimConvChatBuddy *cb; |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1459 GaimConnection *gc; |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1460 GaimPluginProtocolInfo *prpl_info; |
9554 | 1461 GList *ul, *fl; |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1462 GList *aliases = NULL; |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1463 |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1464 g_return_if_fail(chat != NULL); |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1465 g_return_if_fail(users != NULL); |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1466 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1467 conv = gaim_conv_chat_get_conversation(chat); |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1468 ops = gaim_conversation_get_ui_ops(conv); |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1469 |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1470 gc = gaim_conversation_get_gc(conv); |
12867
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1471 g_return_if_fail(gc != NULL); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1472 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1473 g_return_if_fail(prpl_info != NULL); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1474 |
9554 | 1475 ul = users; |
1476 fl = flags; | |
1477 while ((ul != NULL) && (fl != NULL)) { | |
1478 const char *user = (const char *)ul->data; | |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1479 const char *alias = user; |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1480 gboolean quiet; |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1481 GaimConvChatBuddyFlags flags = GPOINTER_TO_INT(fl->data); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1482 const char *extra_msg = (extra_msgs ? extra_msgs->data : NULL); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1483 |
11500
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1484 if (!strcmp(chat->nick, gaim_normalize(conv->account, user))) { |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1485 const char *alias2 = gaim_account_get_alias(conv->account); |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1486 if (alias2 != NULL) |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1487 alias = alias2; |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1488 else |
11500
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1489 { |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1490 const char *display_name = gaim_connection_get_display_name(gc); |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1491 if (display_name != NULL) |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1492 alias = display_name; |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1493 } |
11500
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1494 } else if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1495 GaimBuddy *buddy; |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1496 if ((buddy = gaim_find_buddy(gc->account, user)) != NULL) |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1497 alias = gaim_buddy_get_contact_alias(buddy); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1498 } |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1499 |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1500 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
|
1501 "chat-buddy-joining", conv, user, flags)) | |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1502 gaim_conv_chat_is_user_ignored(chat, user); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1503 |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1504 cb = gaim_conv_chat_cb_new(user, flags); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1505 gaim_conv_chat_set_users(chat, |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1506 g_list_prepend(gaim_conv_chat_get_users(chat), cb)); |
11866
2bee8d023e23
[gaim-migrate @ 14157]
Richard Laager <rlaager@wiktel.com>
parents:
11804
diff
changeset
|
1507 /* We reverse this later to keep it in the same order as users. */ |
2bee8d023e23
[gaim-migrate @ 14157]
Richard Laager <rlaager@wiktel.com>
parents:
11804
diff
changeset
|
1508 aliases = g_list_prepend(aliases, (char *)alias); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1509 |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1510 if (!quiet && new_arrivals) { |
12840
12b23eaa4911
[gaim-migrate @ 15188]
Richard Laager <rlaager@wiktel.com>
parents:
12797
diff
changeset
|
1511 char *escaped = g_markup_escape_text(alias, -1); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1512 char *tmp; |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1513 |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1514 if (extra_msg == NULL) |
12840
12b23eaa4911
[gaim-migrate @ 15188]
Richard Laager <rlaager@wiktel.com>
parents:
12797
diff
changeset
|
1515 tmp = g_strdup_printf(_("%s entered the room."), escaped); |
12b23eaa4911
[gaim-migrate @ 15188]
Richard Laager <rlaager@wiktel.com>
parents:
12797
diff
changeset
|
1516 else { |
12b23eaa4911
[gaim-migrate @ 15188]
Richard Laager <rlaager@wiktel.com>
parents:
12797
diff
changeset
|
1517 char *escaped2 = g_markup_escape_text(extra_msg, -1); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1518 tmp = g_strdup_printf(_("%s [<I>%s</I>] entered the room."), |
12840
12b23eaa4911
[gaim-migrate @ 15188]
Richard Laager <rlaager@wiktel.com>
parents:
12797
diff
changeset
|
1519 escaped, escaped2); |
12b23eaa4911
[gaim-migrate @ 15188]
Richard Laager <rlaager@wiktel.com>
parents:
12797
diff
changeset
|
1520 g_free(escaped2); |
12b23eaa4911
[gaim-migrate @ 15188]
Richard Laager <rlaager@wiktel.com>
parents:
12797
diff
changeset
|
1521 } |
12b23eaa4911
[gaim-migrate @ 15188]
Richard Laager <rlaager@wiktel.com>
parents:
12797
diff
changeset
|
1522 g_free(escaped); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1523 |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1524 gaim_conversation_write(conv, NULL, tmp, GAIM_MESSAGE_SYSTEM, time(NULL)); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1525 g_free(tmp); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1526 } |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1527 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1528 gaim_signal_emit(gaim_conversations_get_handle(), |
12850
49b2347863b2
[gaim-migrate @ 15200]
Richard Laager <rlaager@wiktel.com>
parents:
12840
diff
changeset
|
1529 "chat-buddy-joined", conv, user, flags, new_arrivals); |
9554 | 1530 ul = ul->next; |
1531 fl = fl->next; | |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1532 if (extra_msgs != NULL) |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1533 extra_msgs = extra_msgs->next; |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1534 } |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1535 |
11866
2bee8d023e23
[gaim-migrate @ 14157]
Richard Laager <rlaager@wiktel.com>
parents:
11804
diff
changeset
|
1536 /* This needs to be in the same order as users, but it's faster |
2bee8d023e23
[gaim-migrate @ 14157]
Richard Laager <rlaager@wiktel.com>
parents:
11804
diff
changeset
|
1537 * to prepend, so we do that above. */ |
2bee8d023e23
[gaim-migrate @ 14157]
Richard Laager <rlaager@wiktel.com>
parents:
11804
diff
changeset
|
1538 aliases = g_list_reverse(aliases); |
2bee8d023e23
[gaim-migrate @ 14157]
Richard Laager <rlaager@wiktel.com>
parents:
11804
diff
changeset
|
1539 |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1540 if (ops != NULL && ops->chat_add_users != NULL) |
12463
b1717befbb26
[gaim-migrate @ 14773]
Richard Laager <rlaager@wiktel.com>
parents:
12313
diff
changeset
|
1541 ops->chat_add_users(conv, users, flags, aliases, new_arrivals); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1542 |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1543 g_list_free(aliases); |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1544 } |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1545 |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1546 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1547 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
|
1548 const char *new_user) |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1549 { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
1550 GaimConversation *conv; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
1551 GaimConversationUiOps *ops; |
11485
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11481
diff
changeset
|
1552 GaimConnection *gc; |
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11481
diff
changeset
|
1553 GaimPluginProtocolInfo *prpl_info; |
9554 | 1554 GaimConvChatBuddy *cb; |
1555 GaimConvChatBuddyFlags flags; | |
11485
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11481
diff
changeset
|
1556 const char *new_alias = new_user; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1557 char tmp[BUF_LONG]; |
11485
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11481
diff
changeset
|
1558 gboolean is_me = FALSE; |
3866 | 1559 |
5677
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1560 g_return_if_fail(chat != NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1561 g_return_if_fail(old_user != NULL); |
0adfd56b46b5
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1562 g_return_if_fail(new_user != NULL); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1563 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1564 conv = gaim_conv_chat_get_conversation(chat); |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
1565 ops = gaim_conversation_get_ui_ops(conv); |
3304 | 1566 |
11485
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11481
diff
changeset
|
1567 gc = gaim_conversation_get_gc(conv); |
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11481
diff
changeset
|
1568 g_return_if_fail(gc != NULL); |
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11481
diff
changeset
|
1569 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); |
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11481
diff
changeset
|
1570 g_return_if_fail(prpl_info != NULL); |
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11481
diff
changeset
|
1571 |
9554 | 1572 flags = gaim_conv_chat_user_get_flags(chat, old_user); |
1573 cb = gaim_conv_chat_cb_new(new_user, flags); | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1574 gaim_conv_chat_set_users(chat, |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1575 g_list_prepend(gaim_conv_chat_get_users(chat), cb)); |
3671 | 1576 |
11500
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1577 if (!strcmp(chat->nick, gaim_normalize(conv->account, old_user))) { |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1578 const char *alias; |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1579 |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1580 /* Note this for later. */ |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1581 is_me = TRUE; |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1582 |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1583 alias = gaim_account_get_alias(conv->account); |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1584 if (alias != NULL) |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1585 new_alias = alias; |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1586 else |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1587 { |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1588 const char *display_name = gaim_connection_get_display_name(gc); |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1589 if (display_name != NULL) |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1590 alias = display_name; |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1591 } |
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1592 } else if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
11485
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11481
diff
changeset
|
1593 GaimBuddy *buddy; |
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11481
diff
changeset
|
1594 if ((buddy = gaim_find_buddy(gc->account, new_user)) != NULL) |
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11481
diff
changeset
|
1595 new_alias = gaim_buddy_get_contact_alias(buddy); |
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11481
diff
changeset
|
1596 } |
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11481
diff
changeset
|
1597 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1598 if (ops != NULL && ops->chat_rename_user != NULL) |
11485
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11481
diff
changeset
|
1599 ops->chat_rename_user(conv, old_user, new_user, new_alias); |
3671 | 1600 |
9554 | 1601 cb = gaim_conv_chat_cb_find(chat, old_user); |
1602 | |
1603 if (cb) { | |
1604 gaim_conv_chat_set_users(chat, | |
1605 g_list_remove(gaim_conv_chat_get_users(chat), cb)); | |
1606 gaim_conv_chat_cb_destroy(cb); | |
4506
f3afcc4dd133
[gaim-migrate @ 4781]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
1607 } |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
1608 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1609 if (gaim_conv_chat_is_user_ignored(chat, old_user)) { |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1610 gaim_conv_chat_unignore(chat, old_user); |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1611 gaim_conv_chat_ignore(chat, new_user); |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
1612 } |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1613 else if (gaim_conv_chat_is_user_ignored(chat, new_user)) |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1614 gaim_conv_chat_unignore(chat, new_user); |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1615 |
11500
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1616 if (is_me) |
8158 | 1617 gaim_conv_chat_set_nick(chat, new_user); |
1618 | |
11481
c80edbd8961a
[gaim-migrate @ 13723]
Richard Laager <rlaager@wiktel.com>
parents:
11478
diff
changeset
|
1619 if (gaim_prefs_get_bool("/core/conversations/chat/show_nick_change") && |
c80edbd8961a
[gaim-migrate @ 13723]
Richard Laager <rlaager@wiktel.com>
parents:
11478
diff
changeset
|
1620 !gaim_conv_chat_is_user_ignored(chat, new_user)) { |
c80edbd8961a
[gaim-migrate @ 13723]
Richard Laager <rlaager@wiktel.com>
parents:
11478
diff
changeset
|
1621 |
11500
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1622 if (is_me) { |
12853
3612e3e5dc3d
[gaim-migrate @ 15203]
Richard Laager <rlaager@wiktel.com>
parents:
12850
diff
changeset
|
1623 char *escaped = g_markup_escape_text(new_user, -1); |
8158 | 1624 g_snprintf(tmp, sizeof(tmp), |
12853
3612e3e5dc3d
[gaim-migrate @ 15203]
Richard Laager <rlaager@wiktel.com>
parents:
12850
diff
changeset
|
1625 _("You are now known as %s"), escaped); |
3612e3e5dc3d
[gaim-migrate @ 15203]
Richard Laager <rlaager@wiktel.com>
parents:
12850
diff
changeset
|
1626 g_free(escaped); |
8158 | 1627 } else { |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1628 const char *old_alias = old_user; |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1629 const char *new_alias = new_user; |
12853
3612e3e5dc3d
[gaim-migrate @ 15203]
Richard Laager <rlaager@wiktel.com>
parents:
12850
diff
changeset
|
1630 char *escaped; |
3612e3e5dc3d
[gaim-migrate @ 15203]
Richard Laager <rlaager@wiktel.com>
parents:
12850
diff
changeset
|
1631 char *escaped2; |
11581 | 1632 |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1633 if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1634 GaimBuddy *buddy; |
11581 | 1635 |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1636 if ((buddy = gaim_find_buddy(gc->account, old_user)) != NULL) |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1637 old_alias = gaim_buddy_get_contact_alias(buddy); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1638 if ((buddy = gaim_find_buddy(gc->account, new_user)) != NULL) |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1639 new_alias = gaim_buddy_get_contact_alias(buddy); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1640 } |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1641 |
12853
3612e3e5dc3d
[gaim-migrate @ 15203]
Richard Laager <rlaager@wiktel.com>
parents:
12850
diff
changeset
|
1642 escaped = g_markup_escape_text(old_alias, -1); |
3612e3e5dc3d
[gaim-migrate @ 15203]
Richard Laager <rlaager@wiktel.com>
parents:
12850
diff
changeset
|
1643 escaped2 = g_markup_escape_text(new_alias, -1); |
8158 | 1644 g_snprintf(tmp, sizeof(tmp), |
12853
3612e3e5dc3d
[gaim-migrate @ 15203]
Richard Laager <rlaager@wiktel.com>
parents:
12850
diff
changeset
|
1645 _("%s is now known as %s"), escaped, escaped2); |
3612e3e5dc3d
[gaim-migrate @ 15203]
Richard Laager <rlaager@wiktel.com>
parents:
12850
diff
changeset
|
1646 g_free(escaped); |
3612e3e5dc3d
[gaim-migrate @ 15203]
Richard Laager <rlaager@wiktel.com>
parents:
12850
diff
changeset
|
1647 g_free(escaped2); |
8158 | 1648 } |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1649 |
6982 | 1650 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
|
1651 } |
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2834
diff
changeset
|
1652 } |
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2834
diff
changeset
|
1653 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1654 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1655 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
|
1656 { |
12867
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1657 GList *users = g_list_append(NULL, (char *)user); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1658 |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1659 gaim_conv_chat_remove_users(chat, users, reason); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1660 |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1661 g_list_free(users); |
1759
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
1662 } |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
1663 |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1664 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1665 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
|
1666 { |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1667 GaimConversation *conv; |
12867
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1668 GaimConnection *gc; |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1669 GaimPluginProtocolInfo *prpl_info; |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1670 GaimConversationUiOps *ops; |
9554 | 1671 GaimConvChatBuddy *cb; |
1672 GList *l; | |
12867
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1673 gboolean quiet; |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1674 |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1675 g_return_if_fail(chat != NULL); |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1676 g_return_if_fail(users != NULL); |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1677 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1678 conv = gaim_conv_chat_get_conversation(chat); |
12867
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1679 |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1680 gc = gaim_conversation_get_gc(conv); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1681 g_return_if_fail(gc != NULL); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1682 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1683 g_return_if_fail(prpl_info != NULL); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1684 |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1685 ops = gaim_conversation_get_ui_ops(conv); |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1686 |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1687 for (l = users; l != NULL; l = l->next) { |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1688 const char *user = (const char *)l->data; |
9587 | 1689 quiet = GPOINTER_TO_INT(gaim_signal_emit_return_1(gaim_conversations_get_handle(), |
12867
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1690 "chat-buddy-leaving", conv, user, reason)) | |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1691 gaim_conv_chat_is_user_ignored(chat, user); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1692 |
9554 | 1693 cb = gaim_conv_chat_cb_find(chat, user); |
1694 | |
1695 if (cb) { | |
1696 gaim_conv_chat_set_users(chat, | |
1697 g_list_remove(gaim_conv_chat_get_users(chat), cb)); | |
1698 gaim_conv_chat_cb_destroy(cb); | |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1699 } |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1700 |
12867
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1701 /* NOTE: Don't remove them from ignored in case they re-enter. */ |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1702 |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1703 if (!quiet) { |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1704 const char *alias = user; |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1705 char *escaped; |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1706 char *tmp; |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1707 |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1708 if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1709 GaimBuddy *buddy; |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1710 |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1711 if ((buddy = gaim_find_buddy(gc->account, user)) != NULL) |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1712 alias = gaim_buddy_get_contact_alias(buddy); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1713 } |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1714 |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1715 escaped = g_markup_escape_text(alias, -1); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1716 |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1717 if (reason == NULL || !*reason) |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1718 tmp = g_strdup_printf(_("%s left the room."), escaped); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1719 else { |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1720 char *escaped2 = g_markup_escape_text(reason, -1); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1721 tmp = g_strdup_printf(_("%s left the room (%s)."), |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1722 escaped, escaped2); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1723 g_free(escaped2); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1724 } |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1725 g_free(escaped); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1726 |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1727 gaim_conversation_write(conv, NULL, tmp, GAIM_MESSAGE_SYSTEM, time(NULL)); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1728 g_free(tmp); |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1729 } |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1730 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1731 gaim_signal_emit(gaim_conversations_get_handle(), "chat-buddy-left", |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1732 conv, user, reason); |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1733 } |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1734 |
12867
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1735 if (ops != NULL && ops->chat_remove_users != NULL) |
cf3540702d21
[gaim-migrate @ 15218]
Richard Laager <rlaager@wiktel.com>
parents:
12853
diff
changeset
|
1736 ops->chat_remove_users(conv, users); |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1737 } |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1738 |
6414
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1739 void |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1740 gaim_conv_chat_clear_users(GaimConvChat *chat) |
6414
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1741 { |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1742 GaimConversation *conv; |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1743 GaimConversationUiOps *ops; |
9554 | 1744 GList *users, *names = NULL; |
1745 GList *l; | |
6414
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1746 |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1747 g_return_if_fail(chat != NULL); |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1748 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1749 conv = gaim_conv_chat_get_conversation(chat); |
6414
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1750 ops = gaim_conversation_get_ui_ops(conv); |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1751 users = gaim_conv_chat_get_users(chat); |
6414
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1752 |
9554 | 1753 if (ops != NULL && ops->chat_remove_users != NULL) { |
1754 for (l = users; l; l = l->next) { | |
1755 GaimConvChatBuddy *cb = l->data; | |
1756 names = g_list_append(names, cb->name); | |
1757 } | |
1758 ops->chat_remove_users(conv, names); | |
1759 g_list_free(names); | |
1760 } | |
1761 | |
1762 for (l = users; l; l = l->next) | |
6414
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1763 { |
9554 | 1764 GaimConvChatBuddy *cb = l->data; |
6414
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1765 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1766 gaim_signal_emit(gaim_conversations_get_handle(), |
9554 | 1767 "chat-buddy-leaving", conv, cb->name, NULL); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1768 gaim_signal_emit(gaim_conversations_get_handle(), |
9554 | 1769 "chat-buddy-left", conv, cb->name, NULL); |
1770 | |
1771 gaim_conv_chat_cb_destroy(cb); | |
6414
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1772 } |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1773 |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1774 g_list_free(users); |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1775 gaim_conv_chat_set_users(chat, NULL); |
6414
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1776 } |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1777 |
9554 | 1778 |
1779 gboolean | |
1780 gaim_conv_chat_find_user(GaimConvChat *chat, const char *user) | |
1781 { | |
1782 g_return_val_if_fail(chat != NULL, FALSE); | |
1783 g_return_val_if_fail(user != NULL, FALSE); | |
1784 | |
1785 return (gaim_conv_chat_cb_find(chat, user) != NULL); | |
1786 } | |
1787 | |
1788 void | |
1789 gaim_conv_chat_user_set_flags(GaimConvChat *chat, const char *user, | |
1790 GaimConvChatBuddyFlags flags) | |
1791 { | |
1792 GaimConversation *conv; | |
1793 GaimConversationUiOps *ops; | |
1794 GaimConvChatBuddy *cb; | |
1795 GaimConvChatBuddyFlags oldflags; | |
1796 | |
1797 g_return_if_fail(chat != NULL); | |
1798 g_return_if_fail(user != NULL); | |
1799 | |
1800 cb = gaim_conv_chat_cb_find(chat, user); | |
1801 | |
1802 if (!cb) | |
1803 return; | |
1804 | |
1805 if (flags == cb->flags) | |
1806 return; | |
1807 | |
1808 oldflags = cb->flags; | |
1809 cb->flags = flags; | |
1810 | |
1811 conv = gaim_conv_chat_get_conversation(chat); | |
1812 ops = gaim_conversation_get_ui_ops(conv); | |
1813 | |
1814 if (ops != NULL && ops->chat_update_user != NULL) | |
11500
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1815 ops->chat_update_user(conv, user); |
9554 | 1816 |
1817 gaim_signal_emit(gaim_conversations_get_handle(), | |
1818 "chat-buddy-flags", conv, user, oldflags, flags); | |
1819 } | |
1820 | |
1821 GaimConvChatBuddyFlags | |
1822 gaim_conv_chat_user_get_flags(GaimConvChat *chat, const char *user) | |
1823 { | |
1824 GaimConvChatBuddy *cb; | |
1825 | |
1826 g_return_val_if_fail(chat != NULL, 0); | |
1827 g_return_val_if_fail(user != NULL, 0); | |
1828 | |
1829 cb = gaim_conv_chat_cb_find(chat, user); | |
1830 | |
1831 if (!cb) | |
1832 return GAIM_CBFLAGS_NONE; | |
1833 | |
1834 return cb->flags; | |
1835 } | |
1836 | |
8158 | 1837 void gaim_conv_chat_set_nick(GaimConvChat *chat, const char *nick) { |
1838 g_return_if_fail(chat != NULL); | |
1839 | |
1840 if(chat->nick) | |
1841 g_free(chat->nick); | |
11500
9fc7d0153332
[gaim-migrate @ 13745]
Richard Laager <rlaager@wiktel.com>
parents:
11485
diff
changeset
|
1842 chat->nick = g_strdup(gaim_normalize(chat->conv->account, nick)); |
8158 | 1843 } |
1844 | |
1845 const char *gaim_conv_chat_get_nick(GaimConvChat *chat) { | |
1846 g_return_val_if_fail(chat != NULL, NULL); | |
1847 | |
1848 return chat->nick; | |
1849 } | |
1850 | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
1851 GaimConversation * |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
1852 gaim_find_chat(const GaimConnection *gc, int id) |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
1853 { |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1854 GList *l; |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
1855 GaimConversation *conv; |
2499
933e139fd0d3
[gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2487
diff
changeset
|
1856 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1857 for (l = gaim_get_chats(); l != NULL; l = l->next) { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5621
diff
changeset
|
1858 conv = (GaimConversation *)l->data; |
2499
933e139fd0d3
[gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2487
diff
changeset
|
1859 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1860 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
|
1861 gaim_conversation_get_gc(conv) == gc) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1862 return conv; |
2499
933e139fd0d3
[gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2487
diff
changeset
|
1863 } |
933e139fd0d3
[gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2487
diff
changeset
|
1864 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1865 return NULL; |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
1866 } |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4467
diff
changeset
|
1867 |
8256
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1868 void |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1869 gaim_conv_chat_left(GaimConvChat *chat) |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1870 { |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1871 g_return_if_fail(chat != NULL); |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1872 |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1873 chat->left = TRUE; |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1874 gaim_conversation_update(chat->conv, GAIM_CONV_UPDATE_CHATLEFT); |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1875 } |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1876 |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1877 gboolean |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1878 gaim_conv_chat_has_left(GaimConvChat *chat) |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1879 { |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1880 g_return_val_if_fail(chat != NULL, TRUE); |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1881 |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1882 return chat->left; |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1883 } |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1884 |
9554 | 1885 GaimConvChatBuddy * |
1886 gaim_conv_chat_cb_new(const char *name, GaimConvChatBuddyFlags flags) | |
1887 { | |
1888 GaimConvChatBuddy *cb; | |
1889 | |
1890 g_return_val_if_fail(name != NULL, NULL); | |
1891 | |
1892 cb = g_new0(GaimConvChatBuddy, 1); | |
1893 cb->name = g_strdup(name); | |
1894 cb->flags = flags; | |
1895 | |
11146 | 1896 GAIM_DBUS_REGISTER_POINTER(cb, GaimConvChatBuddy); |
9554 | 1897 return cb; |
1898 } | |
1899 | |
1900 GaimConvChatBuddy * | |
1901 gaim_conv_chat_cb_find(GaimConvChat *chat, const char *name) | |
1902 { | |
1903 GList *l; | |
1904 GaimConvChatBuddy *cb = NULL; | |
1905 | |
1906 g_return_val_if_fail(chat != NULL, NULL); | |
1907 g_return_val_if_fail(name != NULL, NULL); | |
1908 | |
1909 for (l = gaim_conv_chat_get_users(chat); l; l = l->next) { | |
1910 cb = l->data; | |
1911 if (!gaim_utf8_strcasecmp(cb->name, name)) | |
1912 return cb; | |
1913 } | |
1914 | |
1915 return NULL; | |
1916 } | |
1917 | |
1918 void | |
1919 gaim_conv_chat_cb_destroy(GaimConvChatBuddy *cb) | |
1920 { | |
1921 g_return_if_fail(cb != NULL); | |
1922 | |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
1923 g_free(cb->name); |
9554 | 1924 cb->name = NULL; |
1925 cb->flags = 0; | |
11146 | 1926 |
1927 GAIM_DBUS_UNREGISTER_POINTER(cb); | |
9554 | 1928 g_free(cb); |
1929 } | |
1930 | |
1931 const char * | |
1932 gaim_conv_chat_cb_get_name(GaimConvChatBuddy *cb) | |
1933 { | |
1934 g_return_val_if_fail(cb != NULL, NULL); | |
1935 | |
1936 return cb->name; | |
1937 } | |
1938 | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1939 void * |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1940 gaim_conversations_get_handle(void) |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1941 { |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1942 static int handle; |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1943 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1944 return &handle; |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1945 } |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1946 |
5858 | 1947 void |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1948 gaim_conversations_init(void) |
5858 | 1949 { |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1950 void *handle = gaim_conversations_get_handle(); |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1951 |
6846
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1952 /********************************************************************** |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1953 * Register preferences |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1954 **********************************************************************/ |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1955 |
5858 | 1956 /* Conversations */ |
1957 gaim_prefs_add_none("/core/conversations"); | |
1958 | |
1959 /* Conversations -> Chat */ | |
1960 gaim_prefs_add_none("/core/conversations/chat"); | |
1961 gaim_prefs_add_bool("/core/conversations/chat/show_nick_change", TRUE); | |
1962 | |
1963 /* Conversations -> IM */ | |
1964 gaim_prefs_add_none("/core/conversations/im"); | |
1965 gaim_prefs_add_bool("/core/conversations/im/send_typing", TRUE); | |
1966 | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1967 |
6846
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1968 /********************************************************************** |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1969 * Register signals |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1970 **********************************************************************/ |
8078 | 1971 gaim_signal_register(handle, "writing-im-msg", |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
1972 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER, |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
1973 gaim_value_new(GAIM_TYPE_BOOLEAN), 5, |
8078 | 1974 gaim_value_new(GAIM_TYPE_SUBTYPE, |
1975 GAIM_SUBTYPE_ACCOUNT), | |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
1976 gaim_value_new(GAIM_TYPE_STRING), |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
1977 gaim_value_new_outgoing(GAIM_TYPE_STRING), |
8078 | 1978 gaim_value_new(GAIM_TYPE_SUBTYPE, |
1979 GAIM_SUBTYPE_CONVERSATION), | |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
1980 gaim_value_new(GAIM_TYPE_UINT)); |
8078 | 1981 |
1982 gaim_signal_register(handle, "wrote-im-msg", | |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
1983 gaim_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT, |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
1984 NULL, 5, |
8078 | 1985 gaim_value_new(GAIM_TYPE_SUBTYPE, |
1986 GAIM_SUBTYPE_ACCOUNT), | |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
1987 gaim_value_new(GAIM_TYPE_STRING), |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
1988 gaim_value_new(GAIM_TYPE_STRING), |
8078 | 1989 gaim_value_new(GAIM_TYPE_SUBTYPE, |
1990 GAIM_SUBTYPE_CONVERSATION), | |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
1991 gaim_value_new(GAIM_TYPE_UINT)); |
8078 | 1992 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1993 gaim_signal_register(handle, "sending-im-msg", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
1994 gaim_marshal_VOID__POINTER_POINTER_POINTER, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
1995 NULL, 3, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
1996 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
1997 GAIM_SUBTYPE_ACCOUNT), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
1998 gaim_value_new(GAIM_TYPE_STRING), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
1999 gaim_value_new_outgoing(GAIM_TYPE_STRING)); |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2000 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2001 gaim_signal_register(handle, "sent-im-msg", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2002 gaim_marshal_VOID__POINTER_POINTER_POINTER, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2003 NULL, 3, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2004 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2005 GAIM_SUBTYPE_ACCOUNT), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2006 gaim_value_new(GAIM_TYPE_STRING), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2007 gaim_value_new(GAIM_TYPE_STRING)); |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2008 |
8999 | 2009 gaim_signal_register(handle, "receiving-im-msg", |
10104 | 2010 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER, |
2011 gaim_value_new(GAIM_TYPE_BOOLEAN), 5, | |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2012 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2013 GAIM_SUBTYPE_ACCOUNT), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2014 gaim_value_new_outgoing(GAIM_TYPE_STRING), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2015 gaim_value_new_outgoing(GAIM_TYPE_STRING), |
10104 | 2016 gaim_value_new(GAIM_TYPE_SUBTYPE, |
2017 GAIM_SUBTYPE_CONVERSATION), | |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2018 gaim_value_new_outgoing(GAIM_TYPE_UINT)); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2019 |
8999 | 2020 gaim_signal_register(handle, "received-im-msg", |
10104 | 2021 gaim_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT, |
2022 NULL, 5, | |
8999 | 2023 gaim_value_new(GAIM_TYPE_SUBTYPE, |
2024 GAIM_SUBTYPE_ACCOUNT), | |
2025 gaim_value_new(GAIM_TYPE_STRING), | |
2026 gaim_value_new(GAIM_TYPE_STRING), | |
10104 | 2027 gaim_value_new(GAIM_TYPE_SUBTYPE, |
2028 GAIM_SUBTYPE_CONVERSATION), | |
8999 | 2029 gaim_value_new(GAIM_TYPE_UINT)); |
2030 | |
8078 | 2031 gaim_signal_register(handle, "writing-chat-msg", |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
2032 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER, |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
2033 gaim_value_new(GAIM_TYPE_BOOLEAN), 5, |
8078 | 2034 gaim_value_new(GAIM_TYPE_SUBTYPE, |
2035 GAIM_SUBTYPE_ACCOUNT), | |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
2036 gaim_value_new(GAIM_TYPE_STRING), |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
2037 gaim_value_new_outgoing(GAIM_TYPE_STRING), |
8078 | 2038 gaim_value_new(GAIM_TYPE_SUBTYPE, |
2039 GAIM_SUBTYPE_CONVERSATION), | |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
2040 gaim_value_new(GAIM_TYPE_UINT)); |
8078 | 2041 |
2042 gaim_signal_register(handle, "wrote-chat-msg", | |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
2043 gaim_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT, |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
2044 NULL, 5, |
8078 | 2045 gaim_value_new(GAIM_TYPE_SUBTYPE, |
2046 GAIM_SUBTYPE_ACCOUNT), | |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
2047 gaim_value_new(GAIM_TYPE_STRING), |
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
2048 gaim_value_new(GAIM_TYPE_STRING), |
8078 | 2049 gaim_value_new(GAIM_TYPE_SUBTYPE, |
2050 GAIM_SUBTYPE_CONVERSATION), | |
13233
f09c6e8df82c
[gaim-migrate @ 15598]
Richard Laager <rlaager@wiktel.com>
parents:
13119
diff
changeset
|
2051 gaim_value_new(GAIM_TYPE_UINT)); |
8078 | 2052 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2053 gaim_signal_register(handle, "sending-chat-msg", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2054 gaim_marshal_VOID__POINTER_POINTER_UINT, NULL, 3, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2055 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2056 GAIM_SUBTYPE_ACCOUNT), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2057 gaim_value_new_outgoing(GAIM_TYPE_STRING), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2058 gaim_value_new(GAIM_TYPE_UINT)); |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2059 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2060 gaim_signal_register(handle, "sent-chat-msg", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2061 gaim_marshal_VOID__POINTER_POINTER_UINT, NULL, 3, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2062 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2063 GAIM_SUBTYPE_ACCOUNT), |
6607
d8fd7c29eaf0
[gaim-migrate @ 7131]
Christian Hammond <chipx86@chipx86.com>
parents:
6605
diff
changeset
|
2064 gaim_value_new(GAIM_TYPE_STRING), |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2065 gaim_value_new(GAIM_TYPE_UINT)); |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2066 |
8999 | 2067 gaim_signal_register(handle, "receiving-chat-msg", |
10104 | 2068 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER, |
2069 gaim_value_new(GAIM_TYPE_BOOLEAN), 5, | |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2070 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2071 GAIM_SUBTYPE_ACCOUNT), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2072 gaim_value_new_outgoing(GAIM_TYPE_STRING), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2073 gaim_value_new_outgoing(GAIM_TYPE_STRING), |
7511
a899742289c2
[gaim-migrate @ 8124]
Christian Hammond <chipx86@chipx86.com>
parents:
7431
diff
changeset
|
2074 gaim_value_new(GAIM_TYPE_SUBTYPE, |
10104 | 2075 GAIM_SUBTYPE_CONVERSATION), |
2076 gaim_value_new_outgoing(GAIM_TYPE_UINT)); | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2077 |
8999 | 2078 gaim_signal_register(handle, "received-chat-msg", |
10104 | 2079 gaim_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT, |
2080 NULL, 5, | |
8999 | 2081 gaim_value_new(GAIM_TYPE_SUBTYPE, |
2082 GAIM_SUBTYPE_ACCOUNT), | |
2083 gaim_value_new(GAIM_TYPE_STRING), | |
2084 gaim_value_new(GAIM_TYPE_STRING), | |
2085 gaim_value_new(GAIM_TYPE_SUBTYPE, | |
10104 | 2086 GAIM_SUBTYPE_CONVERSATION), |
2087 gaim_value_new(GAIM_TYPE_UINT)); | |
8999 | 2088 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2089 gaim_signal_register(handle, "conversation-created", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2090 gaim_marshal_VOID__POINTER, NULL, 1, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2091 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2092 GAIM_SUBTYPE_CONVERSATION)); |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2093 |
9734 | 2094 gaim_signal_register(handle, "conversation-updated", |
9909 | 2095 gaim_marshal_VOID__POINTER_UINT, NULL, 2, |
9734 | 2096 gaim_value_new(GAIM_TYPE_SUBTYPE, |
2097 GAIM_SUBTYPE_CONVERSATION), | |
2098 gaim_value_new(GAIM_TYPE_UINT)); | |
2099 | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2100 gaim_signal_register(handle, "deleting-conversation", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2101 gaim_marshal_VOID__POINTER, NULL, 1, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2102 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2103 GAIM_SUBTYPE_CONVERSATION)); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2104 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2105 gaim_signal_register(handle, "buddy-typing", |
11793
dfdc286878f9
[gaim-migrate @ 14084]
Gary Kramlich <grim@reaperworld.com>
parents:
11706
diff
changeset
|
2106 gaim_marshal_VOID__POINTER_POINTER, NULL, 2, |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2107 gaim_value_new(GAIM_TYPE_SUBTYPE, |
11706
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11676
diff
changeset
|
2108 GAIM_SUBTYPE_ACCOUNT), |
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11676
diff
changeset
|
2109 gaim_value_new(GAIM_TYPE_STRING)); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2110 |
6837
f098765ac919
[gaim-migrate @ 7382]
Christian Hammond <chipx86@chipx86.com>
parents:
6787
diff
changeset
|
2111 gaim_signal_register(handle, "buddy-typing-stopped", |
11793
dfdc286878f9
[gaim-migrate @ 14084]
Gary Kramlich <grim@reaperworld.com>
parents:
11706
diff
changeset
|
2112 gaim_marshal_VOID__POINTER_POINTER, NULL, 2, |
6837
f098765ac919
[gaim-migrate @ 7382]
Christian Hammond <chipx86@chipx86.com>
parents:
6787
diff
changeset
|
2113 gaim_value_new(GAIM_TYPE_SUBTYPE, |
11706
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11676
diff
changeset
|
2114 GAIM_SUBTYPE_ACCOUNT), |
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11676
diff
changeset
|
2115 gaim_value_new(GAIM_TYPE_STRING)); |
6837
f098765ac919
[gaim-migrate @ 7382]
Christian Hammond <chipx86@chipx86.com>
parents:
6787
diff
changeset
|
2116 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2117 gaim_signal_register(handle, "chat-buddy-joining", |
9587 | 2118 gaim_marshal_BOOLEAN__POINTER_POINTER_UINT, |
2119 gaim_value_new(GAIM_TYPE_BOOLEAN), 3, | |
9554 | 2120 gaim_value_new(GAIM_TYPE_SUBTYPE, |
2121 GAIM_SUBTYPE_CONVERSATION), | |
2122 gaim_value_new(GAIM_TYPE_STRING), | |
2123 gaim_value_new(GAIM_TYPE_UINT)); | |
2124 | |
2125 gaim_signal_register(handle, "chat-buddy-joined", | |
12850
49b2347863b2
[gaim-migrate @ 15200]
Richard Laager <rlaager@wiktel.com>
parents:
12840
diff
changeset
|
2126 gaim_marshal_VOID__POINTER_POINTER_UINT_UINT, NULL, 4, |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2127 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2128 GAIM_SUBTYPE_CONVERSATION), |
9554 | 2129 gaim_value_new(GAIM_TYPE_STRING), |
12850
49b2347863b2
[gaim-migrate @ 15200]
Richard Laager <rlaager@wiktel.com>
parents:
12840
diff
changeset
|
2130 gaim_value_new(GAIM_TYPE_UINT), |
49b2347863b2
[gaim-migrate @ 15200]
Richard Laager <rlaager@wiktel.com>
parents:
12840
diff
changeset
|
2131 gaim_value_new(GAIM_TYPE_BOOLEAN)); |
9554 | 2132 |
2133 gaim_signal_register(handle, "chat-buddy-flags", | |
2134 gaim_marshal_VOID__POINTER_POINTER_UINT_UINT, NULL, 4, | |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2135 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2136 GAIM_SUBTYPE_CONVERSATION), |
9554 | 2137 gaim_value_new(GAIM_TYPE_STRING), |
2138 gaim_value_new(GAIM_TYPE_UINT), | |
2139 gaim_value_new(GAIM_TYPE_UINT)); | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2140 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2141 gaim_signal_register(handle, "chat-buddy-leaving", |
9587 | 2142 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER, |
2143 gaim_value_new(GAIM_TYPE_BOOLEAN), 3, | |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2144 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2145 GAIM_SUBTYPE_CONVERSATION), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2146 gaim_value_new(GAIM_TYPE_STRING), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2147 gaim_value_new(GAIM_TYPE_STRING)); |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2148 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2149 gaim_signal_register(handle, "chat-buddy-left", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2150 gaim_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2151 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2152 GAIM_SUBTYPE_CONVERSATION), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2153 gaim_value_new(GAIM_TYPE_STRING), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2154 gaim_value_new(GAIM_TYPE_STRING)); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2155 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2156 gaim_signal_register(handle, "chat-inviting-user", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2157 gaim_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2158 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2159 GAIM_SUBTYPE_CONVERSATION), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2160 gaim_value_new(GAIM_TYPE_STRING), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2161 gaim_value_new_outgoing(GAIM_TYPE_STRING)); |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2162 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2163 gaim_signal_register(handle, "chat-invited-user", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2164 gaim_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2165 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2166 GAIM_SUBTYPE_CONVERSATION), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2167 gaim_value_new(GAIM_TYPE_STRING), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2168 gaim_value_new(GAIM_TYPE_STRING)); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2169 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2170 gaim_signal_register(handle, "chat-invited", |
11064
e4459e8ccfb5
[gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents:
11048
diff
changeset
|
2171 gaim_marshal_INT__POINTER_POINTER_POINTER_POINTER_POINTER, |
9514 | 2172 NULL, 5, |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2173 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2174 GAIM_SUBTYPE_ACCOUNT), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2175 gaim_value_new(GAIM_TYPE_STRING), |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2176 gaim_value_new(GAIM_TYPE_STRING), |
9514 | 2177 gaim_value_new(GAIM_TYPE_STRING), |
2178 gaim_value_new(GAIM_TYPE_POINTER)); | |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2179 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2180 gaim_signal_register(handle, "chat-joined", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2181 gaim_marshal_VOID__POINTER, NULL, 1, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2182 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2183 GAIM_SUBTYPE_CONVERSATION)); |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2184 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2185 gaim_signal_register(handle, "chat-left", |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2186 gaim_marshal_VOID__POINTER, NULL, 1, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2187 gaim_value_new(GAIM_TYPE_SUBTYPE, |
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2188 GAIM_SUBTYPE_CONVERSATION)); |
9517 | 2189 |
2190 gaim_signal_register(handle, "chat-topic-changed", | |
9528 | 2191 gaim_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3, |
9517 | 2192 gaim_value_new(GAIM_TYPE_SUBTYPE, |
2193 GAIM_SUBTYPE_CONVERSATION), | |
2194 gaim_value_new(GAIM_TYPE_STRING), | |
2195 gaim_value_new(GAIM_TYPE_STRING)); | |
5858 | 2196 } |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2197 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2198 void |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2199 gaim_conversations_uninit(void) |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2200 { |
9909 | 2201 while (conversations) |
2202 gaim_conversation_destroy((GaimConversation*)conversations->data); | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2203 gaim_signals_unregister_by_instance(gaim_conversations_get_handle()); |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2204 } |