| 2075 if (!(flags & WFLAG_RECV) && !(flags & WFLAG_SYSTEM)) |
2075 if (!(flags & WFLAG_RECV) && !(flags & WFLAG_SYSTEM)) |
| 2076 return; |
2076 return; |
| 2077 if ((c->unseen == 2) || ((c->unseen == 1) && !(flags & WFLAG_NICK))) |
2077 if ((c->unseen == 2) || ((c->unseen == 1) && !(flags & WFLAG_NICK))) |
| 2078 return; |
2078 return; |
| 2079 |
2079 |
| |
2080 if (flags & WFLAG_RECV) |
| |
2081 c->typing_state = NOT_TYPING; |
| |
2082 |
| 2080 |
2083 |
| 2081 if (c->is_chat) { |
2084 if (c->is_chat) { |
| 2082 int offs; |
2085 int offs; |
| 2083 if ((convo_options & OPT_CONVO_COMBINE) && (im_options & OPT_IM_ONE_WINDOW)) |
2086 if ((convo_options & OPT_CONVO_COMBINE) && (im_options & OPT_IM_ONE_WINDOW)) |
| 2084 offs = g_list_length(conversations); |
2087 offs = g_list_length(conversations); |
| 2620 c = g_list_nth_data(chats, page_num); |
2623 c = g_list_nth_data(chats, page_num); |
| 2621 if (c && c->window && c->entry) |
2624 if (c && c->window && c->entry) |
| 2622 gtk_window_set_focus(GTK_WINDOW(c->window), c->entry); |
2625 gtk_window_set_focus(GTK_WINDOW(c->window), c->entry); |
| 2623 if (!GTK_WIDGET_REALIZED(label)) |
2626 if (!GTK_WIDGET_REALIZED(label)) |
| 2624 return; |
2627 return; |
| 2625 if (c->unseen == -1) return; |
|
| 2626 style = gtk_style_new(); |
2628 style = gtk_style_new(); |
| 2627 gtk_style_set_font(style, gdk_font_ref(gtk_style_get_font(label->style))); |
2629 gtk_style_set_font(style, gdk_font_ref(gtk_style_get_font(label->style))); |
| 2628 gtk_widget_set_style(label, style); |
2630 gtk_widget_set_style(label, style); |
| 2629 gtk_style_unref(style); |
2631 gtk_style_unref(style); |
| 2630 if (c) |
2632 if (c) |
| 2633 if (!c->is_chat) { |
2635 if (!c->is_chat) { |
| 2634 GtkWidget *menubar; |
2636 GtkWidget *menubar; |
| 2635 GtkWidget *parent = convo_notebook->parent; |
2637 GtkWidget *parent = convo_notebook->parent; |
| 2636 |
2638 |
| 2637 gtk_widget_freeze_child_notify(GTK_WIDGET(c->window)); |
2639 gtk_widget_freeze_child_notify(GTK_WIDGET(c->window)); |
| 2638 |
2640 |
| 2639 if (convo_menubar != NULL) |
2641 if (convo_menubar != NULL) |
| 2640 gtk_widget_destroy(convo_menubar); |
2642 gtk_widget_destroy(convo_menubar); |
| 2641 |
2643 |
| 2642 menubar = build_conv_menubar(c); |
2644 menubar = build_conv_menubar(c); |
| 2643 gtk_box_pack_start(GTK_BOX(parent), menubar, FALSE, TRUE, 0); |
2645 gtk_box_pack_start(GTK_BOX(parent), menubar, FALSE, TRUE, 0); |
| 2648 } else { |
2650 } else { |
| 2649 gtk_widget_destroy(convo_menubar); |
2651 gtk_widget_destroy(convo_menubar); |
| 2650 convo_menubar = NULL; |
2652 convo_menubar = NULL; |
| 2651 } |
2653 } |
| 2652 |
2654 |
| |
2655 update_convo_status(c); |
| |
2656 |
| 2653 gtk_imhtml_to_bottom(c->text); |
2657 gtk_imhtml_to_bottom(c->text); |
| 2654 } |
2658 } |
| 2655 |
2659 |
| 2656 void update_convo_status(struct conversation *c, int typing_state) { |
2660 void update_convo_status(struct conversation *c) { |
| 2657 if(!c) |
2661 if(!c) |
| 2658 return; |
2662 return; |
| 2659 debug_printf("update_convo_status called for %s\n", c->name); |
2663 debug_printf("update_convo_status called for %s\n", c->name); |
| 2660 if (im_options & OPT_IM_ONE_WINDOW) { /* We'll make the tab green */ |
2664 if (im_options & OPT_IM_ONE_WINDOW) { /* We'll make the tab green */ |
| 2661 GtkStyle *style; |
2665 GtkStyle *style; |
| 2669 offs + g_list_index(ws, c))); |
2673 offs + g_list_index(ws, c))); |
| 2670 style = gtk_style_new(); |
2674 style = gtk_style_new(); |
| 2671 if (!GTK_WIDGET_REALIZED(label)) |
2675 if (!GTK_WIDGET_REALIZED(label)) |
| 2672 gtk_widget_realize(label); |
2676 gtk_widget_realize(label); |
| 2673 gtk_style_set_font(style, gdk_font_ref(gtk_style_get_font(label->style))); |
2677 gtk_style_set_font(style, gdk_font_ref(gtk_style_get_font(label->style))); |
| 2674 if(typing_state == TYPING) { |
2678 if(c->typing_state == TYPING) { |
| 2675 style->fg[0].red = 0x0000; |
2679 style->fg[0].red = 0x0000; |
| 2676 style->fg[0].green = 0x9999; |
2680 style->fg[0].green = 0x9999; |
| 2677 style->fg[0].blue = 0x0000; |
2681 style->fg[0].blue = 0x0000; |
| 2678 } else if(typing_state == TYPED) { |
2682 } else if(c->typing_state == TYPED) { |
| 2679 style->fg[0].red = 0xfffff; |
2683 style->fg[0].red = 0xfffff; |
| 2680 style->fg[0].green = 0xbbbb; |
2684 style->fg[0].green = 0xbbbb; |
| 2681 style->fg[0].blue = 0x2222; |
2685 style->fg[0].blue = 0x2222; |
| 2682 } else if(c->unseen == 2) { |
2686 } else if(c->unseen == 2) { |
| 2683 style->fg[0].red = 0x0000; |
2687 style->fg[0].red = 0x0000; |
| 2705 debug_printf("title was free of typing information\n"); |
2709 debug_printf("title was free of typing information\n"); |
| 2706 len = strlen(win->title); |
2710 len = strlen(win->title); |
| 2707 } |
2711 } |
| 2708 buf = g_malloc(len+1); |
2712 buf = g_malloc(len+1); |
| 2709 g_snprintf(buf, len+1, win->title); |
2713 g_snprintf(buf, len+1, win->title); |
| 2710 if(typing_state == TYPING) { |
2714 if(c->typing_state == TYPING) { |
| 2711 buf2 = g_strconcat(buf,_(" [TYPING]"), NULL); |
2715 buf2 = g_strconcat(buf,_(" [TYPING]"), NULL); |
| 2712 g_free(buf); |
2716 g_free(buf); |
| 2713 buf = buf2; |
2717 buf = buf2; |
| 2714 } else if(typing_state == TYPED) { |
2718 } else if(c->typing_state == TYPED) { |
| 2715 buf2 = g_strconcat(buf,_(" [TYPED]"), NULL); |
2719 buf2 = g_strconcat(buf,_(" [TYPED]"), NULL); |
| 2716 g_free(buf); |
2720 g_free(buf); |
| 2717 buf = buf2; |
2721 buf = buf2; |
| 2718 } |
2722 } |
| 2719 gtk_window_set_title(win, buf); |
2723 gtk_window_set_title(win, buf); |