From: <sa...@us...> - 2006-06-28 16:01:56
|
Revision: 16366 Author: sadrul Date: 2006-06-28 09:01:42 -0700 (Wed, 28 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16366&view=rev Log Message: ----------- Fix a typo ("chat" -> "conv"), plug a memory leak, and auto-scroll the conversation history. Modified Paths: -------------- trunk/console/gntconv.c Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-06-28 05:52:23 UTC (rev 16365) +++ trunk/console/gntconv.c 2006-06-28 16:01:42 UTC (rev 16366) @@ -134,6 +134,7 @@ gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), strip, (flags & GAIM_MESSAGE_NICK) ? GNT_TEXT_FLAG_UNDERLINE : 0); gnt_text_view_next_line(GNT_TEXT_VIEW(ggconv->tv)); + gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), 0); g_free(name); g_free(strip); @@ -167,13 +168,15 @@ gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), (strip = gaim_markup_strip_html(message)), 0); gnt_text_view_next_line(GNT_TEXT_VIEW(ggconv->tv)); + gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), 0); + g_free(strip); g_free(name); } static void -gg_write_conv(GaimConversation *conv, const char *who, const char *message, - GaimMessageFlags flags, time_t mtime) +gg_write_conv(GaimConversation *conv, const char *who, const char *alias, + const char *message, GaimMessageFlags flags, time_t mtime) { GGConv *ggconv = g_hash_table_lookup(ggconvs, conv); char *strip; @@ -182,15 +185,22 @@ g_return_if_fail(ggconv != NULL); strip = gaim_markup_strip_html(message); - name = g_strdup_printf("%s: ", who); + if (alias && *alias) + name = g_strdup_printf("%s: ", alias); + else if (who && *who) + name = g_strdup_printf("%s: ", who); + else + name = g_strdup(""); gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), name, GNT_TEXT_FLAG_BOLD); gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), strip, 0); gnt_text_view_next_line(GNT_TEXT_VIEW(ggconv->tv)); + gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), 0); g_free(strip); + g_free(name); } static void @@ -215,7 +225,7 @@ .destroy_conversation = gg_destroy_conversation, .write_chat = gg_write_chat, .write_im = gg_write_im, - .write_chat = gg_write_conv, + .write_conv = gg_write_conv, .chat_add_users = gg_chat_add_users, .chat_rename_user = gg_chat_rename_user, .chat_remove_users = gg_chat_remove_user, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-09 01:23:15
|
Revision: 16469 Author: sadrul Date: 2006-07-08 18:23:12 -0700 (Sat, 08 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16469&view=rev Log Message: ----------- I have not implemented the /-commands for the conversations. For now, disable sending any message starting with a '/'. Modified Paths: -------------- trunk/console/gntconv.c Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-07-09 01:07:00 UTC (rev 16468) +++ trunk/console/gntconv.c 2006-07-09 01:23:12 UTC (rev 16469) @@ -47,17 +47,29 @@ if (key[0] == '\r' && key[1] == 0) { const char *text = gnt_entry_get_text(GNT_ENTRY(ggconv->entry)); - switch (gaim_conversation_get_type(ggconv->conv)) + if (*text == '/') { - case GAIM_CONV_TYPE_IM: - gaim_conv_im_send_with_flags(GAIM_CONV_IM(ggconv->conv), text, GAIM_MESSAGE_SEND); - break; - case GAIM_CONV_TYPE_CHAT: - gaim_conv_chat_send(GAIM_CONV_CHAT(ggconv->conv), text); - break; - default: - g_return_val_if_reached(FALSE); + /* XXX: Need to check for /-commands here */ + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), + _("Commands are not supported yet. Message was NOT sent."), + GNT_TEXT_FLAG_DIM | GNT_TEXT_FLAG_UNDERLINE); + gnt_text_view_next_line(GNT_TEXT_VIEW(ggconv->tv)); + gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), 0); } + else + { + switch (gaim_conversation_get_type(ggconv->conv)) + { + case GAIM_CONV_TYPE_IM: + gaim_conv_im_send_with_flags(GAIM_CONV_IM(ggconv->conv), text, GAIM_MESSAGE_SEND); + break; + case GAIM_CONV_TYPE_CHAT: + gaim_conv_chat_send(GAIM_CONV_CHAT(ggconv->conv), text); + break; + default: + g_return_val_if_reached(FALSE); + } + } gnt_entry_clear(GNT_ENTRY(ggconv->entry)); return TRUE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-29 09:39:47
|
Revision: 16594 Author: sadrul Date: 2006-07-29 02:39:43 -0700 (Sat, 29 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16594&view=rev Log Message: ----------- Enhancement patch from wabz (Richard Nelson) to show the title of the conversation, and to show the alias of the buddy in the conversation if set. Modified Paths: -------------- trunk/console/gntconv.c Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-07-29 05:36:23 UTC (rev 16593) +++ trunk/console/gntconv.c 2006-07-29 09:39:43 UTC (rev 16594) @@ -162,7 +162,7 @@ conv->ui_data = ggc; type = gaim_conversation_get_type(conv); - title = g_strdup_printf(_("%s"), gaim_conversation_get_name(conv)); + title = g_strdup_printf(_("%s"), gaim_conversation_get_title(conv)); ggc->window = gnt_box_new(FALSE, TRUE); gnt_box_set_title(GNT_BOX(ggc->window), title); gnt_box_set_toplevel(GNT_BOX(ggc->window), TRUE); @@ -244,9 +244,9 @@ gg_write_im(GaimConversation *conv, const char *who, const char *message, GaimMessageFlags flags, time_t mtime) { + GaimAccount *account = gaim_conversation_get_account(conv); if (flags & GAIM_MESSAGE_SEND) { - GaimAccount *account = gaim_conversation_get_account(conv); who = gaim_connection_get_display_name(gaim_account_get_connection(account)); if (!who) who = gaim_account_get_alias(account); @@ -254,7 +254,13 @@ who = gaim_account_get_username(account); } else if (flags & GAIM_MESSAGE_RECV) + { + GaimBuddy *buddy; who = gaim_conversation_get_name(conv); + buddy = gaim_find_buddy(account, who); + if (buddy) + who = gaim_buddy_get_contact_alias(buddy); + } gg_write_common(conv, who, message, flags, mtime); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-28 20:43:17
|
Revision: 17071 Author: sadrul Date: 2006-08-28 13:43:12 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17071&view=rev Log Message: ----------- meify Modified Paths: -------------- trunk/console/gntconv.c Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-08-28 20:27:03 UTC (rev 17070) +++ trunk/console/gntconv.c 2006-08-28 20:43:12 UTC (rev 17071) @@ -245,9 +245,16 @@ gaim_prefs_get_bool("/gaim/gnt/conversations/timestamps")) gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), gaim_utf8_strftime("(%H:%M:%S) ", localtime(&mtime)), GNT_TEXT_FLAG_DIM); + if (who && *who && (flags & (GAIM_MESSAGE_SEND | GAIM_MESSAGE_RECV))) { - char * name = g_strdup_printf("%s: ", who); + char * name = NULL; + + if (gaim_message_meify((char*)message, -1)) + name = g_strdup_printf("*** %s ", who); + else + name = g_strdup_printf("%s: ", who); + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), name, GNT_TEXT_FLAG_BOLD); g_free(name); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-09-01 18:34:57
|
Revision: 17116 http://svn.sourceforge.net/gaim/?rev=17116&view=rev Author: sadrul Date: 2006-09-01 11:34:53 -0700 (Fri, 01 Sep 2006) Log Message: ----------- Show the account name and prpl in conversation-window titles. Modified Paths: -------------- trunk/console/gntconv.c Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-09-01 18:29:50 UTC (rev 17115) +++ trunk/console/gntconv.c 2006-09-01 18:34:53 UTC (rev 17116) @@ -201,6 +201,7 @@ char *title; GaimConversationType type; GaimConversation *cc; + GaimAccount *account; if (ggc) return; @@ -220,8 +221,10 @@ return; } + account = gaim_conversation_get_account(conv); type = gaim_conversation_get_type(conv); - title = g_strdup_printf(_("%s"), gaim_conversation_get_title(conv)); + title = g_strdup_printf(_("%s (%s -- %s)"), gaim_conversation_get_title(conv), + gaim_account_get_username(account), gaim_account_get_protocol_name(account)); ggc->window = gnt_box_new(FALSE, TRUE); gnt_box_set_title(GNT_BOX(ggc->window), title); @@ -633,11 +636,17 @@ void gg_conversation_set_active(GaimConversation *conv) { GGConv *ggconv = conv->ui_data; + GaimAccount *account; + char *title; g_return_if_fail(ggconv); g_return_if_fail(g_list_find(ggconv->list, conv)); ggconv->active_conv = conv; - gnt_screen_rename_widget(ggconv->window, gaim_conversation_get_title(conv)); + account = gaim_conversation_get_account(conv); + title = g_strdup_printf(_("%s (%s -- %s)"), gaim_conversation_get_title(conv), + gaim_account_get_username(account), gaim_account_get_protocol_name(account)); + gnt_screen_rename_widget(ggconv->window, title); + g_free(title); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-09-14 01:37:38
|
Revision: 17273 http://svn.sourceforge.net/gaim/?rev=17273&view=rev Author: sadrul Date: 2006-09-13 18:37:32 -0700 (Wed, 13 Sep 2006) Log Message: ----------- Patch #1558308 "gntgaim - Add buddy typing notification" from Richard Nelson (wabz) "This patch adds/removes to/from the conversation window title when a buddy starts/stops typing." Pretty cool! Modified Paths: -------------- trunk/console/gntconv.c Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-09-14 00:56:36 UTC (rev 17272) +++ trunk/console/gntconv.c 2006-09-14 01:37:32 UTC (rev 17273) @@ -194,7 +194,47 @@ return ret; } +static char * +get_conversation_title(GaimConversation *conv, GaimAccount *account) +{ + return g_strdup_printf(_("%s (%s -- %s)"), gaim_conversation_get_title(conv), + gaim_account_get_username(account), gaim_account_get_protocol_name(account)); +} + static void +update_buddy_typing(GaimAccount *account, const char *who, gpointer null) +{ + GaimConversation *conv; + GGConv *ggc; + GaimConvIm *im = NULL; + char *title, *old_title; + + conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, who, account); + im = GAIM_CONV_IM(conv); + + if (!conv) + return; + + if (gaim_conv_im_get_typing_state(im) == GAIM_TYPING) { + old_title = get_conversation_title(conv, account); + title = g_strdup_printf(_("%s [%s]"), old_title, + gnt_ascii_only() ? "T" : "\342\243\277"); + g_free(old_title); + } else + title = get_conversation_title(conv, account); + ggc = conv->ui_data; + gnt_screen_rename_widget(ggc->window, title); + g_free(title); +} + +static gpointer +gg_conv_get_handle() +{ + static int handle; + return &handle; +} + +static void gg_create_conversation(GaimConversation *conv) { GGConv *ggc = conv->ui_data; @@ -223,9 +263,8 @@ account = gaim_conversation_get_account(conv); type = gaim_conversation_get_type(conv); - title = g_strdup_printf(_("%s (%s -- %s)"), gaim_conversation_get_title(conv), - gaim_account_get_username(account), gaim_account_get_protocol_name(account)); - + title = get_conversation_title(conv, account); + ggc->window = gnt_box_new(FALSE, TRUE); gnt_box_set_title(GNT_BOX(ggc->window), title); gnt_box_set_toplevel(GNT_BOX(ggc->window), TRUE); @@ -255,6 +294,11 @@ g_signal_connect(G_OBJECT(ggc->tv), "size_changed", G_CALLBACK(size_changed_cb), NULL); g_signal_connect(G_OBJECT(ggc->window), "position_set", G_CALLBACK(save_position_cb), NULL); + gaim_signal_connect(gaim_conversations_get_handle(), "buddy-typing", gg_conv_get_handle(), + GAIM_CALLBACK(update_buddy_typing), NULL); + gaim_signal_connect(gaim_conversations_get_handle(), "buddy-typing-stopped", gg_conv_get_handle(), + GAIM_CALLBACK(update_buddy_typing), NULL); + g_free(title); } @@ -648,8 +692,7 @@ ggconv->active_conv = conv; account = gaim_conversation_get_account(conv); - title = g_strdup_printf(_("%s (%s -- %s)"), gaim_conversation_get_title(conv), - gaim_account_get_username(account), gaim_account_get_protocol_name(account)); + title = get_conversation_title(conv, account); gnt_screen_rename_widget(ggconv->window, title); g_free(title); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nos...@us...> - 2006-10-07 17:09:22
|
Revision: 17440 http://svn.sourceforge.net/gaim/?rev=17440&view=rev Author: nosnilmot Date: 2006-10-07 10:09:14 -0700 (Sat, 07 Oct 2006) Log Message: ----------- Fix Coverity CID 291 - don't dereference conv before the NULL check Modified Paths: -------------- trunk/console/gntconv.c Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-10-07 17:05:27 UTC (rev 17439) +++ trunk/console/gntconv.c 2006-10-07 17:09:14 UTC (rev 17440) @@ -234,11 +234,12 @@ char *title, *old_title; conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, who, account); - im = GAIM_CONV_IM(conv); if (!conv) return; + im = GAIM_CONV_IM(conv); + if (gaim_conv_im_get_typing_state(im) == GAIM_TYPING) { old_title = get_conversation_title(conv, account); title = g_strdup_printf(_("%s [%s]"), old_title, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-10-26 23:07:33
|
Revision: 17589 http://svn.sourceforge.net/gaim/?rev=17589&view=rev Author: sadrul Date: 2006-10-26 16:07:28 -0700 (Thu, 26 Oct 2006) Log Message: ----------- glib replaces "'" with "'" when escaping markup. Apparently some protocols (Yahoo, AIM) have issues with that. So replace "'" back with "'". Modified Paths: -------------- trunk/console/gntconv.c Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-10-26 15:55:31 UTC (rev 17588) +++ trunk/console/gntconv.c 2006-10-26 23:07:28 UTC (rev 17589) @@ -105,6 +105,9 @@ else { char *escape = g_markup_escape_text(text, -1); + char *apos = gaim_strreplace(escape, "'", "'"); + g_free(escape); + escape = apos; switch (gaim_conversation_get_type(ggconv->active_conv)) { case GAIM_CONV_TYPE_IM: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-12 22:44:35
|
Revision: 17976 http://svn.sourceforge.net/gaim/?rev=17976&view=rev Author: sadrul Date: 2006-12-12 14:44:33 -0800 (Tue, 12 Dec 2006) Log Message: ----------- This may or may not make typing-notifications to be sent. I'll test when I get home. Modified Paths: -------------- trunk/console/gntconv.c Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-12-12 21:55:45 UTC (rev 17975) +++ trunk/console/gntconv.c 2006-12-12 22:44:33 UTC (rev 17976) @@ -140,7 +140,27 @@ return FALSE; return TRUE; } + else + { + gboolean first = !gnt_entry_get_text(GNT_ENTRY(ggconv->entry)); + if (gaim_prefs_get_bool("/gaim/gnt/conversations/notify_typing")) { + /* Xerox'ed */ + GaimConversation *conv = ggconv->active_conv; + GaimConvIm *im = GAIM_CONV_IM(conv); + gaim_conv_im_stop_send_typed_timeout(im); + gaim_conv_im_start_send_typed_timeout(im); + if (first || (gaim_conv_im_get_type_again(im) != 0 && + time(NULL) > gaim_conv_im_get_type_again(im))) { + unsigned int timeout; + timeout = serv_send_typing(gaim_conversation_get_gc(conv), + gaim_conversation_get_name(conv), + GAIM_TYPING); + gaim_conv_im_set_type_again(im, timeout); + } + } + } + return FALSE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-12 23:49:06
|
Revision: 17977 http://svn.sourceforge.net/gaim/?rev=17977&view=rev Author: sadrul Date: 2006-12-12 15:49:00 -0800 (Tue, 12 Dec 2006) Log Message: ----------- Make sure the typing notification shows up just once in the conversation window. Modified Paths: -------------- trunk/console/gntconv.c Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-12-12 22:44:33 UTC (rev 17976) +++ trunk/console/gntconv.c 2006-12-12 23:49:00 UTC (rev 17977) @@ -244,8 +244,10 @@ scroll = gnt_text_view_get_lines_below(GNT_TEXT_VIEW(ggc->tv)); str = g_strdup_printf(_("\n%s is typing..."), gaim_conversation_get_name(conv)); - gnt_text_view_append_text_with_tag(GNT_TEXT_VIEW(ggc->tv), - str, GNT_TEXT_FLAG_DIM, "typing"); + /* Update an existing notification if there's one. */ + if (gnt_text_view_tag_change(GNT_TEXT_VIEW(ggc->tv), "typing", str, TRUE) == 0) + gnt_text_view_append_text_with_tag(GNT_TEXT_VIEW(ggc->tv), + str, GNT_TEXT_FLAG_DIM, "typing"); g_free(str); if (scroll <= 1) gnt_text_view_scroll(GNT_TEXT_VIEW(ggc->tv), 0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-14 01:06:39
|
Revision: 17990 http://svn.sourceforge.net/gaim/?rev=17990&view=rev Author: sadrul Date: 2006-12-13 17:06:18 -0800 (Wed, 13 Dec 2006) Log Message: ----------- Update the typing notification properly. Some change to sending typing notification. It needs more work. Modified Paths: -------------- trunk/console/gntconv.c Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-12-13 21:54:52 UTC (rev 17989) +++ trunk/console/gntconv.c 2006-12-14 01:06:18 UTC (rev 17990) @@ -47,6 +47,32 @@ #include "config.h" static gboolean +send_typing_notification(GntWidget *w, const char *key, GGConv *ggconv) +{ + if (key[0] != 27 && key[0] != '\r') { + const char *text = gnt_entry_get_text(GNT_ENTRY(ggconv->entry)); + gboolean first = (!text || !*text); + if (gaim_prefs_get_bool("/gaim/gnt/conversations/notify_typing")) { + /* Xerox'ed */ + GaimConversation *conv = ggconv->active_conv; + GaimConvIm *im = GAIM_CONV_IM(conv); + + gaim_conv_im_stop_send_typed_timeout(im); + gaim_conv_im_start_send_typed_timeout(im); + if (first || (gaim_conv_im_get_type_again(im) != 0 && + time(NULL) > gaim_conv_im_get_type_again(im))) { + unsigned int timeout; + timeout = serv_send_typing(gaim_conversation_get_gc(conv), + gaim_conversation_get_name(conv), + GAIM_TYPING); + gaim_conv_im_set_type_again(im, timeout); + } + } + } + return FALSE; +} + +static gboolean entry_key_pressed(GntWidget *w, const char *key, GGConv *ggconv) { if (key[0] == '\r' && key[1] == 0) @@ -142,23 +168,6 @@ } else { - gboolean first = !gnt_entry_get_text(GNT_ENTRY(ggconv->entry)); - if (gaim_prefs_get_bool("/gaim/gnt/conversations/notify_typing")) { - /* Xerox'ed */ - GaimConversation *conv = ggconv->active_conv; - GaimConvIm *im = GAIM_CONV_IM(conv); - - gaim_conv_im_stop_send_typed_timeout(im); - gaim_conv_im_start_send_typed_timeout(im); - if (first || (gaim_conv_im_get_type_again(im) != 0 && - time(NULL) > gaim_conv_im_get_type_again(im))) { - unsigned int timeout; - timeout = serv_send_typing(gaim_conversation_get_gc(conv), - gaim_conversation_get_name(conv), - GAIM_TYPING); - gaim_conv_im_set_type_again(im, timeout); - } - } } return FALSE; @@ -244,10 +253,10 @@ scroll = gnt_text_view_get_lines_below(GNT_TEXT_VIEW(ggc->tv)); str = g_strdup_printf(_("\n%s is typing..."), gaim_conversation_get_name(conv)); - /* Update an existing notification if there's one. */ - if (gnt_text_view_tag_change(GNT_TEXT_VIEW(ggc->tv), "typing", str, TRUE) == 0) - gnt_text_view_append_text_with_tag(GNT_TEXT_VIEW(ggc->tv), - str, GNT_TEXT_FLAG_DIM, "typing"); + /* Updating is a little buggy. So just remove and add a new one */ + gnt_text_view_tag_change(GNT_TEXT_VIEW(ggc->tv), "typing", NULL, TRUE); + gnt_text_view_append_text_with_tag(GNT_TEXT_VIEW(ggc->tv), + str, GNT_TEXT_FLAG_DIM, "typing"); g_free(str); if (scroll <= 1) gnt_text_view_scroll(GNT_TEXT_VIEW(ggc->tv), 0); @@ -317,6 +326,7 @@ gnt_entry_set_always_suggest(GNT_ENTRY(ggc->entry), FALSE); g_signal_connect_after(G_OBJECT(ggc->entry), "key_pressed", G_CALLBACK(entry_key_pressed), ggc); + g_signal_connect(G_OBJECT(ggc->entry), "key_pressed", G_CALLBACK(send_typing_notification), ggc); g_signal_connect(G_OBJECT(ggc->window), "destroy", G_CALLBACK(closing_window), ggc); gnt_widget_set_position(ggc->window, gaim_prefs_get_int(PREF_ROOT "/position/x"), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |