From: Richard L. <rl...@us...> - 2006-02-11 19:16:58
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31363/src Modified Files: accountopt.c conversation.c gtkconv.c Log Message: SF Patch #1417225 from Sadrul This reworks the conversation signals. Index: accountopt.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/accountopt.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -p -r1.9 -r1.10 --- accountopt.c 20 Nov 2005 17:29:09 -0000 1.9 +++ accountopt.c 11 Feb 2006 19:16:37 -0000 1.10 @@ -114,16 +114,12 @@ gaim_account_option_destroy(GaimAccountO { g_return_if_fail(option != NULL); - if (option->text != NULL) - g_free(option->text); - - if (option->pref_name != NULL) - g_free(option->pref_name); + g_free(option->text); + g_free(option->pref_name); if (option->type == GAIM_PREF_STRING) { - if (option->default_value.string != NULL) - g_free(option->default_value.string); + g_free(option->default_value.string); } else if (option->type == GAIM_PREF_STRING_LIST) { Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.705 retrieving revision 1.706 diff -u -d -p -r1.705 -r1.706 --- conversation.c 4 Feb 2006 20:55:51 -0000 1.705 +++ conversation.c 11 Feb 2006 19:16:37 -0000 1.706 @@ -92,7 +92,6 @@ common_send(GaimConversation *conv, cons GaimConnection *gc; GaimConversationUiOps *ops; char *displayed = NULL, *sent = NULL; - int plugin_return; int err = 0; if (strlen(message) == 0) @@ -118,24 +117,6 @@ common_send(GaimConversation *conv, cons else sent = g_strdup(message); - plugin_return = - GPOINTER_TO_INT(gaim_signal_emit_return_1( - gaim_conversations_get_handle(), - (type == GAIM_CONV_TYPE_IM ? "writing-im-msg" : "writing-chat-msg"), - account, conv, &displayed)); - - if (displayed == NULL) - return; - - if (plugin_return) { - g_free(displayed); - return; - } - - gaim_signal_emit(gaim_conversations_get_handle(), - (type == GAIM_CONV_TYPE_IM ? "wrote-im-msg" : "wrote-chat-msg"), - account, conv, displayed); - msgflags |= GAIM_MESSAGE_SEND; if (type == GAIM_CONV_TYPE_IM) { @@ -838,7 +819,10 @@ gaim_conversation_write(GaimConversation GaimAccount *account; GaimConversationUiOps *ops; const char *alias; + char *displayed = NULL; GaimBuddy *b; + int plugin_return; + GaimConversationType type; /* int logging_font_options = 0; */ g_return_if_fail(conv != NULL); @@ -850,6 +834,7 @@ gaim_conversation_write(GaimConversation return; account = gaim_conversation_get_account(conv); + type = gaim_conversation_get_type(conv); if (account != NULL) gc = gaim_account_get_connection(account); @@ -862,6 +847,22 @@ gaim_conversation_write(GaimConversation !g_list_find(gaim_get_conversations(), conv)) return; + displayed = g_strdup(message); + + plugin_return = + GPOINTER_TO_INT(gaim_signal_emit_return_1( + gaim_conversations_get_handle(), + (type == GAIM_CONV_TYPE_IM ? "writing-im-msg" : "writing-chat-msg"), + account, who, &displayed, conv, flags)); + + if (displayed == NULL) + return; + + if (plugin_return) { + g_free(displayed); + return; + } + if (who == NULL || *who == '\0') who = gaim_conversation_get_name(conv); @@ -904,7 +905,7 @@ gaim_conversation_write(GaimConversation log = conv->logs; while (log != NULL) { - gaim_log_write((GaimLog *)log->data, flags, alias, mtime, message); + gaim_log_write((GaimLog *)log->data, flags, alias, mtime, displayed); log = log->next; } } @@ -915,7 +916,13 @@ gaim_conversation_write(GaimConversation } } - ops->write_conv(conv, who, alias, message, flags, mtime); + ops->write_conv(conv, who, alias, displayed, flags, mtime); + + gaim_signal_emit(gaim_conversations_get_handle(), + (type == GAIM_CONV_TYPE_IM ? "wrote-im-msg" : "wrote-chat-msg"), + account, who, displayed, conv, flags); + + g_free(displayed); } gboolean @@ -1915,8 +1922,7 @@ gaim_conv_chat_cb_destroy(GaimConvChatBu { g_return_if_fail(cb != NULL); - if (cb->name) - g_free(cb->name); + g_free(cb->name); cb->name = NULL; cb->flags = 0; @@ -1965,22 +1971,26 @@ gaim_conversations_init(void) * Register signals **********************************************************************/ gaim_signal_register(handle, "writing-im-msg", - gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER, - gaim_value_new(GAIM_TYPE_BOOLEAN), 3, + gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER, + gaim_value_new(GAIM_TYPE_BOOLEAN), 5, gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_ACCOUNT), + gaim_value_new(GAIM_TYPE_STRING), + gaim_value_new_outgoing(GAIM_TYPE_STRING), gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_CONVERSATION), - gaim_value_new_outgoing(GAIM_TYPE_STRING)); + gaim_value_new(GAIM_TYPE_UINT)); gaim_signal_register(handle, "wrote-im-msg", - gaim_marshal_VOID__POINTER_POINTER_POINTER, - NULL, 3, + gaim_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT, + NULL, 5, gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_ACCOUNT), + gaim_value_new(GAIM_TYPE_STRING), + gaim_value_new(GAIM_TYPE_STRING), gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_CONVERSATION), - gaim_value_new(GAIM_TYPE_STRING)); + gaim_value_new(GAIM_TYPE_UINT)); gaim_signal_register(handle, "sending-im-msg", gaim_marshal_VOID__POINTER_POINTER_POINTER, @@ -2021,22 +2031,26 @@ gaim_conversations_init(void) gaim_value_new(GAIM_TYPE_UINT)); gaim_signal_register(handle, "writing-chat-msg", - gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER, - gaim_value_new(GAIM_TYPE_BOOLEAN), 3, + gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER, + gaim_value_new(GAIM_TYPE_BOOLEAN), 5, gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_ACCOUNT), + gaim_value_new(GAIM_TYPE_STRING), + gaim_value_new_outgoing(GAIM_TYPE_STRING), gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_CONVERSATION), - gaim_value_new_outgoing(GAIM_TYPE_STRING)); + gaim_value_new(GAIM_TYPE_UINT)); gaim_signal_register(handle, "wrote-chat-msg", - gaim_marshal_VOID__POINTER_POINTER_POINTER, - NULL, 3, + gaim_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT, + NULL, 5, gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_ACCOUNT), + gaim_value_new(GAIM_TYPE_STRING), + gaim_value_new(GAIM_TYPE_STRING), gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_CONVERSATION), - gaim_value_new(GAIM_TYPE_STRING)); + gaim_value_new(GAIM_TYPE_UINT)); gaim_signal_register(handle, "sending-chat-msg", gaim_marshal_VOID__POINTER_POINTER_UINT, NULL, 3, Index: gtkconv.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkconv.c,v retrieving revision 1.739 retrieving revision 1.740 diff -u -d -p -r1.739 -r1.740 --- gtkconv.c 7 Feb 2006 02:33:17 -0000 1.739 +++ gtkconv.c 11 Feb 2006 19:16:38 -0000 1.740 @@ -4622,7 +4622,7 @@ gaim_gtkconv_write_conv(GaimConversation plugin_return = GPOINTER_TO_INT(gaim_signal_emit_return_1( gaim_gtk_conversations_get_handle(), (type == GAIM_CONV_TYPE_IM ? "displaying-im-msg" : "displaying-chat-msg"), - account, conv, &displaying, flags)); + account, name, &displaying, conv, flags)); if (plugin_return) { g_free(displaying); @@ -4916,7 +4916,7 @@ gaim_gtkconv_write_conv(GaimConversation gaim_signal_emit(gaim_gtk_conversations_get_handle(), (type == GAIM_CONV_TYPE_IM ? "displayed-im-msg" : "displayed-chat-msg"), - account, conv, message, flags); + account, name, message, conv, flags); g_free(displaying); } @@ -5843,7 +5843,6 @@ gaim_gtkconv_update_buddy_icon(GaimConve gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 100); g_object_unref(G_OBJECT(scale)); - gtkconv->u.im->icon_container = gtk_vbox_new(FALSE, 0); frame = gtk_frame_new(NULL); @@ -5875,9 +5874,11 @@ gaim_gtkconv_update_buddy_icon(GaimConve gtk_widget_show(frame); /* The buddy icon code needs badly to be fixed. */ - buf = gdk_pixbuf_animation_get_static_image(gtkconv->u.im->anim); if(gaim_gtk_conv_window_is_active_conversation(conv)) + { + buf = gdk_pixbuf_animation_get_static_image(gtkconv->u.im->anim); gtk_window_set_icon(GTK_WINDOW(win->window), buf); + } } void @@ -6464,44 +6465,48 @@ gaim_gtk_conversations_init(void) gaim_value_new(GAIM_TYPE_POINTER)); gaim_signal_register(handle, "displaying-im-msg", - gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_UINT, - gaim_value_new(GAIM_TYPE_BOOLEAN), 4, + gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER, + gaim_value_new(GAIM_TYPE_BOOLEAN), 5, gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_ACCOUNT), + gaim_value_new(GAIM_TYPE_STRING), + gaim_value_new_outgoing(GAIM_TYPE_STRING), gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_CONVERSATION), - gaim_value_new_outgoing(GAIM_TYPE_STRING), - gaim_value_new(G_TYPE_INT)); + gaim_value_new(GAIM_TYPE_INT)); gaim_signal_register(handle, "displayed-im-msg", - gaim_marshal_VOID__POINTER_POINTER_POINTER_UINT, - NULL, 4, + gaim_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT, + NULL, 5, gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_ACCOUNT), + gaim_value_new(GAIM_TYPE_STRING), + gaim_value_new(GAIM_TYPE_STRING), gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_CONVERSATION), - gaim_value_new(GAIM_TYPE_STRING), - gaim_value_new(G_TYPE_INT)); + gaim_value_new(GAIM_TYPE_INT)); gaim_signal_register(handle, "displaying-chat-msg", - gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_UINT, - gaim_value_new(GAIM_TYPE_BOOLEAN), 4, + gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER, + gaim_value_new(GAIM_TYPE_BOOLEAN), 5, gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_ACCOUNT), + gaim_value_new(GAIM_TYPE_STRING), + gaim_value_new_outgoing(GAIM_TYPE_STRING), gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_CONVERSATION), - gaim_value_new_outgoing(GAIM_TYPE_STRING), - gaim_value_new(G_TYPE_INT)); + gaim_value_new(GAIM_TYPE_INT)); gaim_signal_register(handle, "displayed-chat-msg", - gaim_marshal_VOID__POINTER_POINTER_POINTER_UINT, - NULL, 4, + gaim_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT, + NULL, 5, gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_ACCOUNT), + gaim_value_new(GAIM_TYPE_STRING), + gaim_value_new(GAIM_TYPE_STRING), gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_CONVERSATION), - gaim_value_new(GAIM_TYPE_STRING), - gaim_value_new(G_TYPE_INT)); + gaim_value_new(GAIM_TYPE_INT)); gaim_signal_register(handle, "conversation-switched", gaim_marshal_VOID__POINTER_POINTER, NULL, 1, |