Mercurial > pidgin.yaz
comparison src/conversation.c @ 11338:17142948653e
[gaim-migrate @ 13551]
Change the GAIM_CONV_IM and GAIM_CONV_CHAT enums to GAIM_CONV_TYPE_IM
and GAIM_CONV_TYPE_CHAT. This touched A LOT of files. Also combined
two oscar header files (one of them was small and dorky).
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 25 Aug 2005 02:33:44 +0000 |
parents | ef9280fdc511 |
children | 201617d49573 |
comparison
equal
deleted
inserted
replaced
11337:1462b64f8fc9 | 11338:17142948653e |
---|---|
145 displayed = g_strdup(message); | 145 displayed = g_strdup(message); |
146 | 146 |
147 plugin_return = | 147 plugin_return = |
148 GPOINTER_TO_INT(gaim_signal_emit_return_1( | 148 GPOINTER_TO_INT(gaim_signal_emit_return_1( |
149 gaim_conversations_get_handle(), | 149 gaim_conversations_get_handle(), |
150 (type == GAIM_CONV_IM ? "writing-im-msg" : "writing-chat-msg"), | 150 (type == GAIM_CONV_TYPE_IM ? "writing-im-msg" : "writing-chat-msg"), |
151 account, conv, &displayed)); | 151 account, conv, &displayed)); |
152 | 152 |
153 if (displayed == NULL) | 153 if (displayed == NULL) |
154 return; | 154 return; |
155 | 155 |
157 g_free(displayed); | 157 g_free(displayed); |
158 return; | 158 return; |
159 } | 159 } |
160 | 160 |
161 gaim_signal_emit(gaim_conversations_get_handle(), | 161 gaim_signal_emit(gaim_conversations_get_handle(), |
162 (type == GAIM_CONV_IM ? "wrote-im-msg" : "wrote-chat-msg"), | 162 (type == GAIM_CONV_TYPE_IM ? "wrote-im-msg" : "wrote-chat-msg"), |
163 account, conv, displayed); | 163 account, conv, displayed); |
164 | 164 |
165 sent = g_strdup(displayed); | 165 sent = g_strdup(displayed); |
166 | 166 |
167 plugin_return = | 167 plugin_return = |
168 GPOINTER_TO_INT(gaim_signal_emit_return_1( | 168 GPOINTER_TO_INT(gaim_signal_emit_return_1( |
169 gaim_conversations_get_handle(), (type == GAIM_CONV_IM ? | 169 gaim_conversations_get_handle(), (type == GAIM_CONV_TYPE_IM ? |
170 "displaying-im-msg" : "displaying-chat-msg"), | 170 "displaying-im-msg" : "displaying-chat-msg"), |
171 account, conv, &displayed)); | 171 account, conv, &displayed)); |
172 | 172 |
173 if (plugin_return) { | 173 if (plugin_return) { |
174 g_free(displayed); | 174 g_free(displayed); |
175 displayed = NULL; | 175 displayed = NULL; |
176 } else { | 176 } else { |
177 gaim_signal_emit(gaim_conversations_get_handle(), | 177 gaim_signal_emit(gaim_conversations_get_handle(), |
178 (type == GAIM_CONV_IM ? "displayed-im-msg" : "displayed-chat-msg"), | 178 (type == GAIM_CONV_TYPE_IM ? "displayed-im-msg" : "displayed-chat-msg"), |
179 account, conv, displayed); | 179 account, conv, displayed); |
180 } | 180 } |
181 | 181 |
182 if (type == GAIM_CONV_IM) { | 182 if (type == GAIM_CONV_TYPE_IM) { |
183 GaimConvIm *im = GAIM_CONV_IM(conv); | 183 GaimConvIm *im = GAIM_CONV_IM(conv); |
184 | 184 |
185 gaim_signal_emit(gaim_conversations_get_handle(), "sending-im-msg", | 185 gaim_signal_emit(gaim_conversations_get_handle(), "sending-im-msg", |
186 account, | 186 account, |
187 gaim_conversation_get_name(conv), &sent); | 187 gaim_conversation_get_name(conv), &sent); |
562 { | 562 { |
563 GList *wins, *convs; | 563 GList *wins, *convs; |
564 GaimConvWindow *win; | 564 GaimConvWindow *win; |
565 GaimConversation *conv; | 565 GaimConversation *conv; |
566 | 566 |
567 if (type == GAIM_CONV_UNKNOWN) | 567 if (type == GAIM_CONV_TYPE_UNKNOWN) |
568 return NULL; | 568 return NULL; |
569 | 569 |
570 for (wins = gaim_get_windows(); wins != NULL; wins = wins->next) { | 570 for (wins = gaim_get_windows(); wins != NULL; wins = wins->next) { |
571 win = (GaimConvWindow *)wins->data; | 571 win = (GaimConvWindow *)wins->data; |
572 | 572 |
589 { | 589 { |
590 GList *wins, *convs; | 590 GList *wins, *convs; |
591 GaimConvWindow *win; | 591 GaimConvWindow *win; |
592 GaimConversation *conv; | 592 GaimConversation *conv; |
593 | 593 |
594 if (type == GAIM_CONV_UNKNOWN) | 594 if (type == GAIM_CONV_TYPE_UNKNOWN) |
595 return NULL; | 595 return NULL; |
596 | 596 |
597 for (wins = g_list_last(gaim_get_windows()); | 597 for (wins = g_list_last(gaim_get_windows()); |
598 wins != NULL; | 598 wins != NULL; |
599 wins = wins->prev) { | 599 wins = wins->prev) { |
652 const char *name) | 652 const char *name) |
653 { | 653 { |
654 GaimConversation *conv; | 654 GaimConversation *conv; |
655 GaimConnection *gc; | 655 GaimConnection *gc; |
656 | 656 |
657 g_return_val_if_fail(type != GAIM_CONV_UNKNOWN, NULL); | 657 g_return_val_if_fail(type != GAIM_CONV_TYPE_UNKNOWN, NULL); |
658 g_return_val_if_fail(account != NULL, NULL); | 658 g_return_val_if_fail(account != NULL, NULL); |
659 g_return_val_if_fail(name != NULL, NULL); | 659 g_return_val_if_fail(name != NULL, NULL); |
660 | 660 |
661 /* Check if this conversation already exists. */ | 661 /* Check if this conversation already exists. */ |
662 if ((conv = gaim_find_conversation_with_account(type, name, account)) != NULL) | 662 if ((conv = gaim_find_conversation_with_account(type, name, account)) != NULL) |
663 { | 663 { |
664 if (gaim_conversation_get_type(conv) != GAIM_CONV_CHAT || | 664 if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_CHAT || |
665 gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv))) | 665 gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv))) |
666 { | 666 { |
667 if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT) | 667 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) |
668 gaim_conversation_chat_cleanup_for_rejoin(conv); | 668 gaim_conversation_chat_cleanup_for_rejoin(conv); |
669 | 669 |
670 return conv; | 670 return conv; |
671 } | 671 } |
672 } | 672 } |
682 conv->name = g_strdup(name); | 682 conv->name = g_strdup(name); |
683 conv->title = g_strdup(name); | 683 conv->title = g_strdup(name); |
684 conv->send_history = g_list_append(NULL, NULL); | 684 conv->send_history = g_list_append(NULL, NULL); |
685 conv->data = g_hash_table_new_full(g_str_hash, g_str_equal, | 685 conv->data = g_hash_table_new_full(g_str_hash, g_str_equal, |
686 g_free, NULL); | 686 g_free, NULL); |
687 conv->log = gaim_log_new(type == GAIM_CONV_CHAT ? GAIM_LOG_CHAT : | 687 conv->log = gaim_log_new(type == GAIM_CONV_TYPE_CHAT ? GAIM_LOG_CHAT : |
688 GAIM_LOG_IM, conv->name, account, | 688 GAIM_LOG_IM, conv->name, account, |
689 conv, time(NULL)); | 689 conv, time(NULL)); |
690 /* copy features from the connection. */ | 690 /* copy features from the connection. */ |
691 conv->features = gc->flags; | 691 conv->features = gc->flags; |
692 | 692 |
693 | 693 |
694 if (type == GAIM_CONV_IM) | 694 if (type == GAIM_CONV_TYPE_IM) |
695 { | 695 { |
696 GaimBuddyIcon *icon; | 696 GaimBuddyIcon *icon; |
697 conv->u.im = g_new0(GaimConvIm, 1); | 697 conv->u.im = g_new0(GaimConvIm, 1); |
698 conv->u.im->conv = conv; | 698 conv->u.im->conv = conv; |
699 GAIM_DBUS_REGISTER_POINTER(conv->u.im, GaimConvIm); | 699 GAIM_DBUS_REGISTER_POINTER(conv->u.im, GaimConvIm); |
703 gaim_conv_im_set_icon(conv->u.im, icon); | 703 gaim_conv_im_set_icon(conv->u.im, icon); |
704 | 704 |
705 gaim_conversation_set_logging(conv, | 705 gaim_conversation_set_logging(conv, |
706 gaim_prefs_get_bool("/core/logging/log_ims")); | 706 gaim_prefs_get_bool("/core/logging/log_ims")); |
707 } | 707 } |
708 else if (type == GAIM_CONV_CHAT) | 708 else if (type == GAIM_CONV_TYPE_CHAT) |
709 { | 709 { |
710 const char *disp; | 710 const char *disp; |
711 | 711 |
712 conv->u.chat = g_new0(GaimConvChat, 1); | 712 conv->u.chat = g_new0(GaimConvChat, 1); |
713 conv->u.chat->conv = conv; | 713 conv->u.chat->conv = conv; |
789 if (gc != NULL) | 789 if (gc != NULL) |
790 { | 790 { |
791 /* Still connected */ | 791 /* Still connected */ |
792 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); | 792 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); |
793 | 793 |
794 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) | 794 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) |
795 { | 795 { |
796 if (gaim_prefs_get_bool("/core/conversations/im/send_typing")) | 796 if (gaim_prefs_get_bool("/core/conversations/im/send_typing")) |
797 serv_send_typing(gc, name, GAIM_NOT_TYPING); | 797 serv_send_typing(gc, name, GAIM_NOT_TYPING); |
798 | 798 |
799 if (gc && prpl_info->convo_closed != NULL) | 799 if (gc && prpl_info->convo_closed != NULL) |
800 prpl_info->convo_closed(gc, name); | 800 prpl_info->convo_closed(gc, name); |
801 } | 801 } |
802 else if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT) | 802 else if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) |
803 { | 803 { |
804 int chat_id = gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv)); | 804 int chat_id = gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv)); |
805 #if 0 | 805 #if 0 |
806 /* | 806 /* |
807 * This is unfortunately necessary, because calling | 807 * This is unfortunately necessary, because calling |
865 | 865 |
866 g_list_free(g_list_first(conv->send_history)); | 866 g_list_free(g_list_first(conv->send_history)); |
867 | 867 |
868 conversations = g_list_remove(conversations, conv); | 868 conversations = g_list_remove(conversations, conv); |
869 | 869 |
870 if (conv->type == GAIM_CONV_IM) { | 870 if (conv->type == GAIM_CONV_TYPE_IM) { |
871 gaim_conv_im_stop_typing_timeout(conv->u.im); | 871 gaim_conv_im_stop_typing_timeout(conv->u.im); |
872 gaim_conv_im_stop_type_again_timeout(conv->u.im); | 872 gaim_conv_im_stop_type_again_timeout(conv->u.im); |
873 | 873 |
874 if (conv->u.im->icon != NULL) | 874 if (conv->u.im->icon != NULL) |
875 gaim_buddy_icon_unref(conv->u.im->icon); | 875 gaim_buddy_icon_unref(conv->u.im->icon); |
879 g_free(conv->u.im); | 879 g_free(conv->u.im); |
880 conv->u.im = NULL; | 880 conv->u.im = NULL; |
881 | 881 |
882 ims = g_list_remove(ims, conv); | 882 ims = g_list_remove(ims, conv); |
883 } | 883 } |
884 else if (conv->type == GAIM_CONV_CHAT) { | 884 else if (conv->type == GAIM_CONV_TYPE_CHAT) { |
885 | 885 |
886 for (node = conv->u.chat->in_room; node != NULL; node = node->next) { | 886 for (node = conv->u.chat->in_room; node != NULL; node = node->next) { |
887 if (node->data != NULL) | 887 if (node->data != NULL) |
888 gaim_conv_chat_cb_destroy((GaimConvChatBuddy *)node->data); | 888 gaim_conv_chat_cb_destroy((GaimConvChatBuddy *)node->data); |
889 node->data = NULL; | 889 node->data = NULL; |
960 | 960 |
961 | 961 |
962 GaimConversationType | 962 GaimConversationType |
963 gaim_conversation_get_type(const GaimConversation *conv) | 963 gaim_conversation_get_type(const GaimConversation *conv) |
964 { | 964 { |
965 g_return_val_if_fail(conv != NULL, GAIM_CONV_UNKNOWN); | 965 g_return_val_if_fail(conv != NULL, GAIM_CONV_TYPE_UNKNOWN); |
966 | 966 |
967 return conv->type; | 967 return conv->type; |
968 } | 968 } |
969 | 969 |
970 void | 970 void |
1066 g_return_if_fail(conv != NULL); | 1066 g_return_if_fail(conv != NULL); |
1067 | 1067 |
1068 account = gaim_conversation_get_account(conv); | 1068 account = gaim_conversation_get_account(conv); |
1069 name = gaim_conversation_get_name(conv); | 1069 name = gaim_conversation_get_name(conv); |
1070 | 1070 |
1071 if(gaim_conversation_get_type(conv) == GAIM_CONV_IM) { | 1071 if(gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) { |
1072 if(account && ((b = gaim_find_buddy(account, name)) != NULL)) | 1072 if(account && ((b = gaim_find_buddy(account, name)) != NULL)) |
1073 text = gaim_buddy_get_alias(b); | 1073 text = gaim_buddy_get_alias(b); |
1074 } else if(gaim_conversation_get_type(conv) == GAIM_CONV_CHAT) { | 1074 } else if(gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) { |
1075 if(account && ((chat = gaim_blist_find_chat(account, name)) != NULL)) | 1075 if(account && ((chat = gaim_blist_find_chat(account, name)) != NULL)) |
1076 text = chat->alias; | 1076 text = chat->alias; |
1077 } | 1077 } |
1078 | 1078 |
1079 | 1079 |
1174 GaimConvIm * | 1174 GaimConvIm * |
1175 gaim_conversation_get_im_data(const GaimConversation *conv) | 1175 gaim_conversation_get_im_data(const GaimConversation *conv) |
1176 { | 1176 { |
1177 g_return_val_if_fail(conv != NULL, NULL); | 1177 g_return_val_if_fail(conv != NULL, NULL); |
1178 | 1178 |
1179 if (gaim_conversation_get_type(conv) != GAIM_CONV_IM) | 1179 if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_IM) |
1180 return NULL; | 1180 return NULL; |
1181 | 1181 |
1182 return conv->u.im; | 1182 return conv->u.im; |
1183 } | 1183 } |
1184 | 1184 |
1185 GaimConvChat * | 1185 GaimConvChat * |
1186 gaim_conversation_get_chat_data(const GaimConversation *conv) | 1186 gaim_conversation_get_chat_data(const GaimConversation *conv) |
1187 { | 1187 { |
1188 g_return_val_if_fail(conv != NULL, NULL); | 1188 g_return_val_if_fail(conv != NULL, NULL); |
1189 | 1189 |
1190 if (gaim_conversation_get_type(conv) != GAIM_CONV_CHAT) | 1190 if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_CHAT) |
1191 return NULL; | 1191 return NULL; |
1192 | 1192 |
1193 return conv->u.chat; | 1193 return conv->u.chat; |
1194 } | 1194 } |
1195 | 1195 |
1247 | 1247 |
1248 for (cnv = gaim_get_conversations(); cnv != NULL; cnv = cnv->next) { | 1248 for (cnv = gaim_get_conversations(); cnv != NULL; cnv = cnv->next) { |
1249 c = (GaimConversation *)cnv->data; | 1249 c = (GaimConversation *)cnv->data; |
1250 name2 = gaim_normalize(account, gaim_conversation_get_name(c)); | 1250 name2 = gaim_normalize(account, gaim_conversation_get_name(c)); |
1251 | 1251 |
1252 if (((type == GAIM_CONV_ANY) || (type == gaim_conversation_get_type(c))) && | 1252 if (((type == GAIM_CONV_TYPE_ANY) || (type == gaim_conversation_get_type(c))) && |
1253 (account == gaim_conversation_get_account(c)) && | 1253 (account == gaim_conversation_get_account(c)) && |
1254 !gaim_utf8_strcasecmp(name1, name2)) { | 1254 !gaim_utf8_strcasecmp(name1, name2)) { |
1255 | 1255 |
1256 break; | 1256 break; |
1257 } | 1257 } |
1289 account = gaim_conversation_get_account(conv); | 1289 account = gaim_conversation_get_account(conv); |
1290 | 1290 |
1291 if (account != NULL) | 1291 if (account != NULL) |
1292 gc = gaim_account_get_connection(account); | 1292 gc = gaim_account_get_connection(account); |
1293 | 1293 |
1294 if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT && | 1294 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT && |
1295 (gc == NULL || !g_slist_find(gc->buddy_chats, conv))) | 1295 (gc == NULL || !g_slist_find(gc->buddy_chats, conv))) |
1296 return; | 1296 return; |
1297 | 1297 |
1298 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM && | 1298 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM && |
1299 !g_list_find(gaim_get_conversations(), conv)) | 1299 !g_list_find(gaim_get_conversations(), conv)) |
1300 return; | 1300 return; |
1301 | 1301 |
1302 if (account != NULL) { | 1302 if (account != NULL) { |
1303 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gaim_find_prpl(gaim_account_get_protocol_id(account))); | 1303 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gaim_find_prpl(gaim_account_get_protocol_id(account))); |
1304 | 1304 |
1305 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM || | 1305 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM || |
1306 !(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { | 1306 !(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
1307 | 1307 |
1308 if (who == NULL) { | 1308 if (who == NULL) { |
1309 if (flags & GAIM_MESSAGE_SEND) { | 1309 if (flags & GAIM_MESSAGE_SEND) { |
1310 b = gaim_find_buddy(account, | 1310 b = gaim_find_buddy(account, |
1311 gaim_account_get_username(account)); | 1311 gaim_account_get_username(account)); |
1312 if (gaim_conversation_get_type(conv) != GAIM_CONV_CHAT) { | 1312 if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_CHAT) { |
1313 if (gaim_account_get_alias(account) != NULL) | 1313 if (gaim_account_get_alias(account) != NULL) |
1314 who = account->alias; | 1314 who = account->alias; |
1315 else if (b != NULL && strcmp(b->name, gaim_buddy_get_contact_alias(b))) | 1315 else if (b != NULL && strcmp(b->name, gaim_buddy_get_contact_alias(b))) |
1316 who = gaim_buddy_get_contact_alias(b); | 1316 who = gaim_buddy_get_contact_alias(b); |
1317 else if (gaim_connection_get_display_name(gc) != NULL) | 1317 else if (gaim_connection_get_display_name(gc) != NULL) |
1324 } | 1324 } |
1325 else { | 1325 else { |
1326 b = gaim_find_buddy(account, | 1326 b = gaim_find_buddy(account, |
1327 gaim_conversation_get_name(conv)); | 1327 gaim_conversation_get_name(conv)); |
1328 | 1328 |
1329 if (b != NULL && gaim_conversation_get_type(conv) != GAIM_CONV_CHAT) | 1329 if (b != NULL && gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_CHAT) |
1330 who = gaim_buddy_get_contact_alias(b); | 1330 who = gaim_buddy_get_contact_alias(b); |
1331 else | 1331 else |
1332 who = gaim_conversation_get_name(conv); | 1332 who = gaim_conversation_get_name(conv); |
1333 } | 1333 } |
1334 } | 1334 } |
1335 else if ((who != NULL) && (*who != '\0') && gaim_conversation_get_type(conv) != GAIM_CONV_CHAT) { | 1335 else if ((who != NULL) && (*who != '\0') && gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_CHAT) { |
1336 b = gaim_find_buddy(account, who); | 1336 b = gaim_find_buddy(account, who); |
1337 | 1337 |
1338 if (b != NULL) | 1338 if (b != NULL) |
1339 who = gaim_buddy_get_contact_alias(b); | 1339 who = gaim_buddy_get_contact_alias(b); |
1340 } | 1340 } |
1349 | 1349 |
1350 /* Tab highlighting */ | 1350 /* Tab highlighting */ |
1351 if (!(flags & GAIM_MESSAGE_RECV) && !(flags & GAIM_MESSAGE_SYSTEM) && !(flags & GAIM_MESSAGE_ERROR)) | 1351 if (!(flags & GAIM_MESSAGE_RECV) && !(flags & GAIM_MESSAGE_SYSTEM) && !(flags & GAIM_MESSAGE_ERROR)) |
1352 return; | 1352 return; |
1353 | 1353 |
1354 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) { | 1354 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) { |
1355 if ((flags & GAIM_MESSAGE_RECV) == GAIM_MESSAGE_RECV) | 1355 if ((flags & GAIM_MESSAGE_RECV) == GAIM_MESSAGE_RECV) |
1356 gaim_conv_im_set_typing_state(GAIM_CONV_IM(conv), GAIM_NOT_TYPING); | 1356 gaim_conv_im_set_typing_state(GAIM_CONV_IM(conv), GAIM_NOT_TYPING); |
1357 } | 1357 } |
1358 | 1358 |
1359 if (gaim_conv_window_has_focus(win) && | 1359 if (gaim_conv_window_has_focus(win) && |
1392 * window, the first thing they'll see is the new message. This is | 1392 * window, the first thing they'll see is the new message. This is |
1393 * especially important when the IM window is flashing in their | 1393 * especially important when the IM window is flashing in their |
1394 * taskbar--we want the title of the window to be set to the name | 1394 * taskbar--we want the title of the window to be set to the name |
1395 * of the person that IMed them most recently. | 1395 * of the person that IMed them most recently. |
1396 */ | 1396 */ |
1397 if ((gaim_conversation_get_type(conv) == GAIM_CONV_IM) && | 1397 if ((gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) && |
1398 (flags & (GAIM_MESSAGE_RECV | GAIM_MESSAGE_ERROR)) && | 1398 (flags & (GAIM_MESSAGE_RECV | GAIM_MESSAGE_ERROR)) && |
1399 (!gaim_conv_window_has_focus(win)) && | 1399 (!gaim_conv_window_has_focus(win)) && |
1400 (gaim_conv_window_is_minimized(win))) | 1400 (gaim_conv_window_is_minimized(win))) |
1401 { | 1401 { |
1402 gaim_conv_window_switch_conversation(win, conv); | 1402 gaim_conv_window_switch_conversation(win, conv); |
1633 | 1633 |
1634 g_return_val_if_fail(who != NULL, FALSE); | 1634 g_return_val_if_fail(who != NULL, FALSE); |
1635 g_return_val_if_fail(account !=NULL, FALSE); | 1635 g_return_val_if_fail(account !=NULL, FALSE); |
1636 g_return_val_if_fail(what != NULL, FALSE); | 1636 g_return_val_if_fail(what != NULL, FALSE); |
1637 | 1637 |
1638 conv = gaim_find_conversation_with_account(GAIM_CONV_ANY, who, account); | 1638 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_ANY, who, account); |
1639 if (conv != NULL) | 1639 if (conv != NULL) |
1640 gaim_conversation_write(conv, NULL, what, GAIM_MESSAGE_ERROR, time(NULL)); | 1640 gaim_conversation_write(conv, NULL, what, GAIM_MESSAGE_ERROR, time(NULL)); |
1641 else | 1641 else |
1642 return FALSE; | 1642 return FALSE; |
1643 window = gaim_conversation_get_window(conv); | 1643 window = gaim_conversation_get_window(conv); |
2448 static GaimGroup * | 2448 static GaimGroup * |
2449 conv_get_group(GaimConversation *conv) | 2449 conv_get_group(GaimConversation *conv) |
2450 { | 2450 { |
2451 GaimGroup *group = NULL; | 2451 GaimGroup *group = NULL; |
2452 | 2452 |
2453 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) | 2453 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) |
2454 { | 2454 { |
2455 GaimBuddy *buddy; | 2455 GaimBuddy *buddy; |
2456 | 2456 |
2457 buddy = gaim_find_buddy(gaim_conversation_get_account(conv), | 2457 buddy = gaim_find_buddy(gaim_conversation_get_account(conv), |
2458 gaim_conversation_get_name(conv)); | 2458 gaim_conversation_get_name(conv)); |
2459 | 2459 |
2460 if (buddy != NULL) | 2460 if (buddy != NULL) |
2461 group = gaim_find_buddys_group(buddy); | 2461 group = gaim_find_buddys_group(buddy); |
2462 | 2462 |
2463 } | 2463 } |
2464 else if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT) | 2464 else if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) |
2465 { | 2465 { |
2466 GaimChat *chat; | 2466 GaimChat *chat; |
2467 | 2467 |
2468 chat = gaim_blist_find_chat(gaim_conversation_get_account(conv), | 2468 chat = gaim_blist_find_chat(gaim_conversation_get_account(conv), |
2469 gaim_conversation_get_name(conv)); | 2469 gaim_conversation_get_name(conv)); |