From: Luke S. <lsc...@us...> - 2004-08-31 01:45:49
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8760/src Modified Files: gtkblist.c gtkconv.c gtkdialogs.c gtklog.c gtklog.h prpl.h Log Message: view chat logs curtesy of datallah Index: gtkblist.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkblist.c,v retrieving revision 1.171 retrieving revision 1.172 diff -u -d -p -r1.171 -r1.172 --- gtkblist.c 25 Aug 2004 21:47:00 -0000 1.171 +++ gtkblist.c 31 Aug 2004 01:45:06 -0000 1.172 @@ -530,9 +530,32 @@ static void gtk_blist_menu_bp_cb(GtkWidg gaim_gtkpounce_dialog_show(b->account, b->name, NULL); } -static void gtk_blist_menu_showlog_cb(GtkWidget *w, GaimBuddy *b) +static void gtk_blist_menu_showlog_cb(GtkWidget *w, GaimBlistNode *node) { - gaim_gtk_log_show(b->name, b->account); + GaimLogType type; + GaimAccount *account; + char *name = NULL; + if (GAIM_BLIST_NODE_IS_BUDDY(node)) { + GaimBuddy *b = (GaimBuddy*) node; + type = GAIM_LOG_IM; + name = g_strdup(b->name); + account = b->account; + } else if (GAIM_BLIST_NODE_IS_CHAT(node)) { + GaimChat *c = (GaimChat*) node; + GaimPluginProtocolInfo *prpl_info = NULL; + type = GAIM_LOG_CHAT; + account = c->account; + prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gaim_find_prpl(gaim_account_get_protocol_id(account))); + if (prpl_info && prpl_info->get_chat_name) { + name = prpl_info->get_chat_name(c->components); + } + } else + return; + + if (name && account) { + gaim_gtk_log_show(type, name, account); + g_free(name); + } } static void gtk_blist_show_systemlog_cb() @@ -1217,6 +1240,8 @@ create_chat_menu(GaimBlistNode *node, Ga G_CALLBACK(gtk_blist_menu_join_cb), node, 0, 0, NULL); gaim_new_check_item(menu, _("Auto-Join"), G_CALLBACK(gtk_blist_menu_autojoin_cb), node, autojoin); + gaim_new_item_from_stock(menu, _("View _Log"), NULL, + G_CALLBACK(gtk_blist_menu_showlog_cb), node, 0, 0, NULL); gaim_gtk_append_blist_node_proto_menu(menu, c->account->gc, node); gaim_gtk_append_blist_node_extended_menu(menu, node); Index: gtkconv.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkconv.c,v retrieving revision 1.470 retrieving revision 1.471 diff -u -d -p -r1.470 -r1.471 --- gtkconv.c 29 Aug 2004 16:59:47 -0000 1.470 +++ gtkconv.c 31 Aug 2004 01:45:06 -0000 1.471 @@ -935,10 +935,18 @@ menu_view_log_cb(gpointer data, guint ac { GaimConvWindow *win = (GaimConvWindow *)data; GaimConversation *conv; + GaimLogType type; conv = gaim_conv_window_get_active_conversation(win); - gaim_gtk_log_show((char *)gaim_conversation_get_name(conv), + if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) + type = GAIM_LOG_IM; + else if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT) + type = GAIM_LOG_CHAT; + else + return; + + gaim_gtk_log_show(type, gaim_conversation_get_name(conv), gaim_conversation_get_account(conv)); } @@ -2752,7 +2760,7 @@ gray_stuff_out(GaimConversation *conv) gtk_widget_show(gtkconv->u.chat->invite); /* Deal with menu items */ - gtk_widget_hide(gtkwin->menu.view_log); + gtk_widget_show(gtkwin->menu.view_log); gtk_widget_hide(gtkwin->menu.send_file); gtk_widget_hide(gtkwin->menu.add_pounce); gtk_widget_hide(gtkwin->menu.get_info); Index: gtkdialogs.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkdialogs.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -p -r1.9 -r1.10 --- gtkdialogs.c 28 Aug 2004 19:09:38 -0000 1.9 +++ gtkdialogs.c 31 Aug 2004 01:45:07 -0000 1.10 @@ -540,12 +540,13 @@ gaim_gtkdialogs_log_cb(gpointer data, Ga username = g_strdup(gaim_normalize(account, gaim_request_fields_get_string(fields, "screenname"))); - if( username != NULL && *username != '\0' && account != NULL ) - gaim_gtk_log_show( username, account ); + if(username != NULL && *username != '\0' && account != NULL ) + gaim_gtk_log_show(GAIM_LOG_IM, username, account); g_free(username); } +/* XXX this needs to deal with logs of all types, not just IM logs */ void gaim_gtkdialogs_log(void) { Index: gtklog.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtklog.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -p -r1.21 -r1.22 --- gtklog.c 20 Aug 2004 05:11:30 -0000 1.21 +++ gtklog.c 31 Aug 2004 01:45:07 -0000 1.22 @@ -248,7 +248,7 @@ static void populate_log_tree(GaimGtkLog } } -void gaim_gtk_log_show(const char *screenname, GaimAccount *account) { +void gaim_gtk_log_show(GaimLogType type, const char *screenname, GaimAccount *account) { /* if (log_viewers && g_hash_table */ GtkWidget *hbox, *vbox; GdkPixbuf *pixbuf, *scale; @@ -272,7 +272,7 @@ void gaim_gtk_log_show(const char *scree } lv = g_new0(GaimGtkLogViewer, 1); - lv->logs = logs = gaim_log_get_logs(GAIM_LOG_IM, screenname, account); + lv->logs = logs = gaim_log_get_logs(type, screenname, account); g_hash_table_insert(log_viewers, ht, lv); /* Window ***********/ Index: gtklog.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtklog.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -p -r1.5 -r1.6 --- gtklog.h 20 Aug 2004 05:11:30 -0000 1.5 +++ gtklog.h 31 Aug 2004 01:45:07 -0000 1.6 @@ -49,6 +49,6 @@ struct _GaimGtkLogViewer { -void gaim_gtk_log_show(const char *screenname, GaimAccount *account); +void gaim_gtk_log_show(GaimLogType type, const char *screenname, GaimAccount *account); void gaim_gtk_syslog_show(); Index: prpl.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/prpl.h,v retrieving revision 1.178 retrieving revision 1.179 diff -u -d -p -r1.178 -r1.179 --- prpl.h 17 Aug 2004 02:52:12 -0000 1.178 +++ prpl.h 31 Aug 2004 01:45:07 -0000 1.179 @@ -255,6 +255,7 @@ struct _GaimPluginProtocolInfo void (*warn)(GaimConnection *, const char *who, gboolean anonymous); void (*join_chat)(GaimConnection *, GHashTable *components); void (*reject_chat)(GaimConnection *, GHashTable *components); + char *(*get_chat_name)(GHashTable *components); void (*chat_invite)(GaimConnection *, int id, const char *who, const char *message); void (*chat_leave)(GaimConnection *, int id); @@ -316,8 +317,8 @@ struct _GaimPluginProtocolInfo /* It's not like we're going to run out of integers for this version number, but we only want to really change it once per release. */ -/* GAIM_PRPL_API_VERSION last changed for version: 0.82 */ -#define GAIM_PRPL_API_VERSION 7 +/* GAIM_PRPL_API_VERSION last changed for version: 0.83 */ +#define GAIM_PRPL_API_VERSION 8 #ifdef __cplusplus extern "C" { |