comparison src/conversation.c @ 9166:1e51236d825e

[gaim-migrate @ 9951] This removes some stuff for im image that isn't used anymore. Basicly one of the things I did when i brought it back, was to make it so the host widget doesn't have to do any special handling for its imhtml to support <img id="###"> tags. And while this goal was achieved in 0.78, there's still code all over the place that checks flags that aren't used and iterates over lists that will always be empty. This doesn't remove all of it, but removes some of it anyway. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Wed, 02 Jun 2004 05:08:49 +0000
parents e0c50af60837
children 45d2ad4ac1c1
comparison
equal deleted inserted replaced
9165:43ea2b858112 9166:1e51236d825e
223 gaim_signal_emit(gaim_conversations_get_handle(), "sending-im-msg", 223 gaim_signal_emit(gaim_conversations_get_handle(), "sending-im-msg",
224 gaim_conversation_get_account(conv), 224 gaim_conversation_get_account(conv),
225 gaim_conversation_get_name(conv), &sent); 225 gaim_conversation_get_name(conv), &sent);
226 226
227 if (sent != NULL && sent[0] != '\0') { 227 if (sent != NULL && sent[0] != '\0') {
228 GaimConvImFlags imflags = 0;
229 GaimMessageFlags msgflags = GAIM_MESSAGE_SEND; 228 GaimMessageFlags msgflags = GAIM_MESSAGE_SEND;
230
231 if (im->images != NULL) {
232 imflags |= GAIM_CONV_IM_IMAGES;
233 msgflags |= GAIM_MESSAGE_IMAGES;
234 }
235 229
236 if (gc && gc->flags & GAIM_CONNECTION_HTML) { 230 if (gc && gc->flags & GAIM_CONNECTION_HTML) {
237 err = serv_send_im(gc, gaim_conversation_get_name(conv), 231 err = serv_send_im(gc, gaim_conversation_get_name(conv),
238 sent, imflags); 232 sent, 0);
239 } else { 233 } else {
240 gchar *tmp = gaim_unescape_html(sent); 234 gchar *tmp = gaim_unescape_html(sent);
241 err = serv_send_im(gc, gaim_conversation_get_name(conv), 235 err = serv_send_im(gc, gaim_conversation_get_name(conv),
242 tmp, imflags); 236 tmp, 0);
243 g_free(tmp); 237 g_free(tmp);
244 } 238 }
245 239
246 if ((err > 0) && (displayed != NULL)) 240 if ((err > 0) && (displayed != NULL))
247 gaim_conv_im_write(im, NULL, displayed, msgflags, time(NULL)); 241 gaim_conv_im_write(im, NULL, displayed, msgflags, time(NULL));
248
249 if (im->images != NULL) {
250 GSList *tempy;
251 int image;
252
253 for (tempy = im->images;
254 tempy != NULL;
255 tempy = tempy->next) {
256
257 image = GPOINTER_TO_INT(tempy->data);
258 gaim_imgstore_unref(image);
259 }
260
261 g_slist_free(im->images);
262 im->images = NULL;
263 }
264 242
265 gaim_signal_emit(gaim_conversations_get_handle(), "sent-im-msg", 243 gaim_signal_emit(gaim_conversations_get_handle(), "sent-im-msg",
266 gaim_conversation_get_account(conv), 244 gaim_conversation_get_account(conv),
267 gaim_conversation_get_name(conv), sent); 245 gaim_conversation_get_name(conv), sent);
268 } 246 }
980 g_string_free(conv->history, TRUE); 958 g_string_free(conv->history, TRUE);
981 959
982 conversations = g_list_remove(conversations, conv); 960 conversations = g_list_remove(conversations, conv);
983 961
984 if (conv->type == GAIM_CONV_IM) { 962 if (conv->type == GAIM_CONV_IM) {
985 GSList *tempy;
986 int image;
987
988 gaim_conv_im_stop_typing_timeout(conv->u.im); 963 gaim_conv_im_stop_typing_timeout(conv->u.im);
989 gaim_conv_im_stop_type_again_timeout(conv->u.im); 964 gaim_conv_im_stop_type_again_timeout(conv->u.im);
990
991 for (tempy = conv->u.im->images;
992 tempy != NULL;
993 tempy = tempy->next) {
994
995 image = GPOINTER_TO_INT(tempy->data);
996 gaim_imgstore_unref(image);
997 }
998
999 g_slist_free(conv->u.im->images);
1000 965
1001 if (conv->u.im->icon != NULL) 966 if (conv->u.im->icon != NULL)
1002 gaim_buddy_icon_unref(conv->u.im->icon); 967 gaim_buddy_icon_unref(conv->u.im->icon);
1003 968
1004 g_free(conv->u.im); 969 g_free(conv->u.im);