comparison src/conversation.c @ 10971:57e3e958ff49

[gaim-migrate @ 12796] This commit includes the changes I made to oldstatus to make urgent notification/taskbar flashing more sensible (auto- tab switching), the changes to notify.c so that tab switching doesn't reset the counters, and the changes and translations for gaim.desktop committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 06 Jun 2005 01:40:46 +0000
parents ee4ca56ed8a5
children 2b772e7094ef
comparison
equal deleted inserted replaced
10970:a126bdfd7688 10971:57e3e958ff49
531 ops = gaim_conv_window_get_ui_ops(win); 531 ops = gaim_conv_window_get_ui_ops(win);
532 532
533 if (ops != NULL && ops->switch_conversation != NULL) 533 if (ops != NULL && ops->switch_conversation != NULL)
534 ops->switch_conversation(win, conv); 534 ops->switch_conversation(win, conv);
535 535
536 gaim_conversation_set_unseen(conv, GAIM_UNSEEN_NONE);
537
538 gaim_signal_emit(gaim_conversations_get_handle(), 536 gaim_signal_emit(gaim_conversations_get_handle(),
539 "conversation-switched", old_conv, conv); 537 "conversation-switched", old_conv, conv);
540 } 538 }
541 539
542 GaimConversation * 540 GaimConversation *
1360 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) { 1358 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) {
1361 if ((flags & GAIM_MESSAGE_RECV) == GAIM_MESSAGE_RECV) 1359 if ((flags & GAIM_MESSAGE_RECV) == GAIM_MESSAGE_RECV)
1362 gaim_conv_im_set_typing_state(GAIM_CONV_IM(conv), GAIM_NOT_TYPING); 1360 gaim_conv_im_set_typing_state(GAIM_CONV_IM(conv), GAIM_NOT_TYPING);
1363 } 1361 }
1364 1362
1365 if (gaim_conv_window_get_active_conversation(win) != conv) { 1363 if (gaim_conv_window_has_focus(win) &&
1364 gaim_conv_window_get_active_conversation(win) == conv)
1365 {
1366 unseen = GAIM_UNSEEN_NONE;
1367 }
1368 else
1369 {
1366 if ((flags & GAIM_MESSAGE_NICK) == GAIM_MESSAGE_NICK || 1370 if ((flags & GAIM_MESSAGE_NICK) == GAIM_MESSAGE_NICK ||
1367 gaim_conversation_get_unseen(conv) == GAIM_UNSEEN_NICK) 1371 gaim_conversation_get_unseen(conv) == GAIM_UNSEEN_NICK)
1368 unseen = GAIM_UNSEEN_NICK; 1372 unseen = GAIM_UNSEEN_NICK;
1369 else if ((((flags & GAIM_MESSAGE_SYSTEM) == GAIM_MESSAGE_SYSTEM) || 1373 else if ((((flags & GAIM_MESSAGE_SYSTEM) == GAIM_MESSAGE_SYSTEM) ||
1370 ((flags & GAIM_MESSAGE_ERROR) == GAIM_MESSAGE_ERROR)) && 1374 ((flags & GAIM_MESSAGE_ERROR) == GAIM_MESSAGE_ERROR)) &&
1371 gaim_conversation_get_unseen(conv) != GAIM_UNSEEN_TEXT) 1375 gaim_conversation_get_unseen(conv) != GAIM_UNSEEN_TEXT)
1372 unseen = GAIM_UNSEEN_EVENT; 1376 unseen = GAIM_UNSEEN_EVENT;
1373 else 1377 else
1374 unseen = GAIM_UNSEEN_TEXT; 1378 unseen = GAIM_UNSEEN_TEXT;
1375 } 1379 }
1376 else
1377 unseen = GAIM_UNSEEN_NONE;
1378 1380
1379 gaim_conversation_set_unseen(conv, unseen); 1381 gaim_conversation_set_unseen(conv, unseen);
1382
1383 /*
1384 * If we received an IM, and the GaimConvWindow is not active,
1385 * then make this conversation the active tab in this GaimConvWindow.
1386 *
1387 * We do this so that, when the user comes back to the conversation
1388 * window, the first thing they'll see is the new message. This is
1389 * especially important when the IM window is flashing in their
1390 * taskbar--we want the title of the window to be set to the name
1391 * of the person that IMed them most recently.
1392 */
1393 if ((gaim_conversation_get_type(conv) == GAIM_CONV_IM) &&
1394 (flags & (GAIM_MESSAGE_RECV | GAIM_MESSAGE_ERROR)) &&
1395 (!gaim_conv_window_has_focus(win)))
1396 {
1397 gaim_conv_window_switch_conversation(win, conv);
1398 }
1380 } 1399 }
1381 1400
1382 void 1401 void
1383 gaim_conversation_update_progress(GaimConversation *conv, float percent) 1402 gaim_conversation_update_progress(GaimConversation *conv, float percent)
1384 { 1403 {
1618 window = gaim_conversation_get_window(conv); 1637 window = gaim_conversation_get_window(conv);
1619 1638
1620 /* 1639 /*
1621 * Change the active conversation to this conversation unless the 1640 * Change the active conversation to this conversation unless the
1622 * user is already using this window. 1641 * user is already using this window.
1642 * TODO: There's a good chance this is no longer necessary
1623 */ 1643 */
1624 if (!gaim_conv_window_has_focus(window)) 1644 if (!gaim_conv_window_has_focus(window))
1625 gaim_conv_window_switch_conversation(window, conv); 1645 gaim_conv_window_switch_conversation(window, conv);
1626 1646
1627 gaim_conv_window_raise(window); 1647 gaim_conv_window_raise(window);