Mercurial > pidgin
changeset 21754:61725f2eb4a6
merge of 'e7865d4ee742f49f097c7f9c5b14b95b1ec15b5e'
and 'ed1ac2fd1572c0126f1f2890053e45f55d21c48e'
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Tue, 04 Dec 2007 02:50:44 +0000 |
parents | e9760c22bab5 (diff) 866e139a79ef (current diff) |
children | 5b0d9e08992d 430827922828 |
files | |
diffstat | 4 files changed, 24 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/finch/gntconv.c Tue Dec 04 02:49:41 2007 +0000 +++ b/finch/gntconv.c Tue Dec 04 02:50:44 2007 +0000 @@ -772,26 +772,25 @@ !(flags & PURPLE_MESSAGE_NOTIFY)) { char * name = NULL; + GntTextFormatFlags msgflags = GNT_TEXT_FLAG_NORMAL; + gboolean me = FALSE; if (purple_message_meify((char*)message, -1)) { name = g_strdup_printf("*** %s", who); - gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), - name, gnt_color_pair(color_message_action)); + msgflags = gnt_color_pair(color_message_action); + me = TRUE; } else { name = g_strdup_printf("%s", who); if (flags & PURPLE_MESSAGE_SEND) - gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), - name, gnt_color_pair(color_message_send)); + msgflags = gnt_color_pair(color_message_send); + else if (flags & PURPLE_MESSAGE_NICK) + msgflags = gnt_color_pair(color_message_highlight); else - if (flags & PURPLE_MESSAGE_NICK) { - gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), - name, gnt_color_pair(color_message_highlight)); - } else { - gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), - name, gnt_color_pair(color_message_receive)); - } + msgflags = gnt_color_pair(color_message_receive); } - gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), ": ", GNT_TEXT_FLAG_NORMAL); + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), + name, msgflags); + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), me ? " " : ": ", GNT_TEXT_FLAG_NORMAL); g_free(name); } else fl = GNT_TEXT_FLAG_DIM;
--- a/libpurple/connection.c Tue Dec 04 02:49:41 2007 +0000 +++ b/libpurple/connection.c Tue Dec 04 02:50:44 2007 +0000 @@ -38,6 +38,8 @@ #include "signals.h" #include "util.h" +#define KEEPALIVE_INTERVAL 30 + static GList *connections = NULL; static GList *connections_connecting = NULL; static PurpleConnectionUiOps *connection_ui_ops = NULL; @@ -73,7 +75,7 @@ if (on && !gc->keepalive) { purple_debug_info("connection", "Activating keepalive.\n"); - gc->keepalive = purple_timeout_add_seconds(30, send_keepalive, gc); + gc->keepalive = purple_timeout_add_seconds(KEEPALIVE_INTERVAL, send_keepalive, gc); } else if (!on && gc->keepalive > 0) {
--- a/libpurple/prpl.h Tue Dec 04 02:49:41 2007 +0000 +++ b/libpurple/prpl.h Tue Dec 04 02:50:44 2007 +0000 @@ -292,6 +292,13 @@ void (*chat_whisper)(PurpleConnection *, int id, const char *who, const char *message); int (*chat_send)(PurpleConnection *, int id, const char *message, PurpleMessageFlags flags); + + /** If implemented, this will be called regularly for this prpl's + * active connections. You'd want to do this if you need to repeatedly + * send some kind of keepalive packet to the server to avoid being + * disconnected. ("Regularly" is defined by + * <code>KEEPALIVE_INTERVAL</code> in <tt>libpurple/connection.c</tt>.) + */ void (*keepalive)(PurpleConnection *); /** new user registration */
--- a/pidgin/gtkblist.c Tue Dec 04 02:49:41 2007 +0000 +++ b/pidgin/gtkblist.c Tue Dec 04 02:50:44 2007 +0000 @@ -1398,7 +1398,7 @@ pidgin_append_blist_node_proto_menu(menu, buddy->account->gc, node); pidgin_append_blist_node_extended_menu(menu, node); - if (!contact_expanded) + if (!contact_expanded && contact != NULL) pidgin_append_blist_node_move_to_menu(menu, (PurpleBlistNode *)contact); if (node->parent && node->parent->child->next && @@ -5715,11 +5715,11 @@ esc = g_markup_escape_text(group->name, -1); if (selected) - mark = g_strdup_printf("<span weight='bold'>%s</span>%s", esc, group_count); + mark = g_strdup_printf("<span weight='bold'>%s</span>%s", esc ? esc : "", group_count); else mark = g_strdup_printf("<span color='#%02x%02x%02x' weight='bold'>%s</span>%s", textcolor.red>>8, textcolor.green>>8, textcolor.blue>>8, - esc, group_count); + esc ? esc : "", group_count); g_free(esc); return mark;